]> git.proxmox.com Git - qemu.git/log
qemu.git
11 years agoappend the terminating '\0' to bootorder string
Amos Kong [Wed, 20 Mar 2013 10:16:34 +0000 (18:16 +0800)]
append the terminating '\0' to bootorder string

Problem was introduced in commit c8a6ae8b. The last terminating
'\0' was lost, use the right length 5 ("HALT\0").

Reported-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Amos Kong <akong@redhat.com>
Message-id: 1363774594-21001-1-git-send-email-akong@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-20130401.0' into staging
Anthony Liguori [Tue, 2 Apr 2013 13:12:16 +0000 (08:12 -0500)]
Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-20130401.0' into staging

vfio-pci pull request 20130401

# gpg: Signature made Mon 01 Apr 2013 02:40:45 PM CDT using RSA key ID 3BB08B22
# gpg: Can't check signature: public key not found

# By Alex Williamson
# Via Alex Williamson
* awilliam/tags/vfio-pci-for-qemu-20130401.0:
  vfio: cleanup includes
  vfio: Add bootindex support
  vfio-pci: Move devices to D0 on reset
  vfio-pci: Add extra debugging
  qemu vfio-pci: Graphics device quirks
  qemu vfio-pci: Add support for VGA MMIO and I/O port access
  vfio-pci: Add PCIe capability mangling based on bus type
  vfio-pci: Generalize PCI config mangling
  linux-headers: Update to v3.9-rc2

11 years agomicroblaze: Add support for the sleep insn
Edgar E. Iglesias [Thu, 28 Mar 2013 21:59:03 +0000 (22:59 +0100)]
microblaze: Add support for the sleep insn

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
11 years agovfio: cleanup includes
Alex Williamson [Mon, 1 Apr 2013 19:35:40 +0000 (13:35 -0600)]
vfio: cleanup includes

Starting to get messy, put the back in alphabetical order.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
11 years agovfio: Add bootindex support
Alex Williamson [Mon, 1 Apr 2013 19:35:24 +0000 (13:35 -0600)]
vfio: Add bootindex support

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
11 years agovfio-pci: Move devices to D0 on reset
Alex Williamson [Mon, 1 Apr 2013 19:35:08 +0000 (13:35 -0600)]
vfio-pci: Move devices to D0 on reset

Guests may leave devices in a low power state at reboot, but we expect
devices to be woken up for the next boot.  Make this happen.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
11 years agovfio-pci: Add extra debugging
Alex Williamson [Mon, 1 Apr 2013 19:34:56 +0000 (13:34 -0600)]
vfio-pci: Add extra debugging

Often when debugging it's useful to be able to disable bypass paths
so no interactions with the device are missed.  Add some extra debug
options to do this.  Also add device info on read/write BAR accesses,
which is useful when debugging more than one assigned device.  A
couple DPRINTFs also had redundant "vfio:" prefixes.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
11 years agoqemu vfio-pci: Graphics device quirks
Alex Williamson [Mon, 1 Apr 2013 19:34:40 +0000 (13:34 -0600)]
qemu vfio-pci: Graphics device quirks

Graphics cards have a number of different backdoors.  Some of these
are alternative ways to get PCI BAR addresses, some of them are
complete mirrors of PCI config space available through MMIO and
I/O port access.  These quirks cover a number of ATI Radeon and
Nvidia devices.  On the ATI/AMD side, this should enable HD5450
and HD7850 and hopefully a host of devices around those generations.
For Nvidia, my card selection is much more dated.  A 8400gs works
well with both the Window shipped driver and the Nvidia downloaded
driver.  A 7300le works as well, with the caveat that generating
the Window experience index with the Nvidia driver causes the card
to reset several times before generating a BSOD.  An NVS 290 card
seems to run well with the shipped Windows driver, but generates
a BSOD with the Nvidia driver.  All of the Nvidia devices work with
the Linux Nvidia proprietary driver and nouveau, the HD5450 works
with either radeon or fglrx, HD7850 works with vesa and fglrx (not
supported by radeon).  Extremely limited 3D testing.

Device reset is also an issue with graphics.  It's unfortunately
very common that the devices offer no means to reset the card or
doesn't seem effective.  Nvidia devices are pretty good about being
able to get the device to a working state through the VGA BIOS init,
Radeon devices less so, and often require a host reboot.  Work
remains to be done here.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
11 years agoqemu vfio-pci: Add support for VGA MMIO and I/O port access
Alex Williamson [Mon, 1 Apr 2013 19:33:44 +0000 (13:33 -0600)]
qemu vfio-pci: Add support for VGA MMIO and I/O port access

Most VGA cards need some kind of quirk to fully operate since they
hide backdoors to get to other registers outside of PCI config space
within the registers, but this provides the base infrastructure.  If
we could identity map PCI resources for assigned devices we would need
a lot fewer quirks.

To enable this, use a kernel side vfio-pci driver that incorporates
VGA support (v3.9), and use the -vga none option and add the x-vga=on
option for the vfio-pci device.  The "x-" denotes this as an
experimental feature.  You may also need to use a cached copy of the
VGA BIOS for your device, passing it to vfio-pci using the romfile=
option.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
11 years agovfio-pci: Add PCIe capability mangling based on bus type
Alex Williamson [Mon, 1 Apr 2013 17:50:04 +0000 (11:50 -0600)]
vfio-pci: Add PCIe capability mangling based on bus type

Windows seems to pay particular interest to the PCIe header type of
devices and will fail to load drivers if we attach Endpoint devices or
Legacy Endpoint devices to the Root Complex.  We can use
pci_bus_is_express and pci_bus_is_root to determine the bus type and
mangle the type appropriately:

* Legacy PCI
  * No change, capability is unmodified for compatibility.
* PCI Express
  * Integrated Root Complex Endpoint -> Endpoint
* PCI Express Root Complex
  * Endpoint -> Integrated Root Complex Endpoint
  * Legacy Endpoint -> none, capability hidden

We also take this opportunity to explicitly limit supported devices
to Endpoints, Legacy Endpoints, and Root Complex Integrated Endpoints.
We don't currently have support for other types and users often cause
themselves problems by assigning them.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
11 years agovfio-pci: Generalize PCI config mangling
Alex Williamson [Mon, 1 Apr 2013 17:50:04 +0000 (11:50 -0600)]
vfio-pci: Generalize PCI config mangling

Kernel-side vfio virtualizes all of config space, but some parts are
unique to Qemu.  For instance we may or may not expose the ROM BAR,
Qemu manages MSI/MSIX, and Qemu manages the multi-function bit so that
single function devices can appear as multi-function and vica versa.
Generalize this into a bitmap of Qemu emulated bits.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
11 years agolinux-headers: Update to v3.9-rc2
Alex Williamson [Mon, 1 Apr 2013 17:50:04 +0000 (11:50 -0600)]
linux-headers: Update to v3.9-rc2

Unedited scripts/update-linux-headers.sh run against v3.9-rc2 tag

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
11 years agotcg/mips: Implement muls2_i32
Aurelien Jarno [Sun, 24 Mar 2013 00:52:07 +0000 (01:52 +0100)]
tcg/mips: Implement muls2_i32

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-i386: SSE4.2: use clz32/ctz32 instead of reinventing the wheel
Aurelien Jarno [Tue, 26 Mar 2013 18:56:02 +0000 (19:56 +0100)]
target-i386: SSE4.2: use clz32/ctz32 instead of reinventing the wheel

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-i386: enable SSE4.1 and SSE4.2 in TCG mode
Aurelien Jarno [Tue, 26 Mar 2013 18:56:02 +0000 (19:56 +0100)]
target-i386: enable SSE4.1 and SSE4.2 in TCG mode

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-i386: SSE4.2: fix pcmpXstrX instructions with "Masked(-)" polarity
Aurelien Jarno [Tue, 26 Mar 2013 18:56:02 +0000 (19:56 +0100)]
target-i386: SSE4.2: fix pcmpXstrX instructions with "Masked(-)" polarity

valids can equals to -1 if the reg/mem string is empty. Change the
expression to have an empty xor mask in that case.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-i386: SSE4.2: fix pcmpXstrX instructions in "Equal ordered" mode
Aurelien Jarno [Tue, 26 Mar 2013 18:56:02 +0000 (19:56 +0100)]
target-i386: SSE4.2: fix pcmpXstrX instructions in "Equal ordered" mode

The inner loop should only change the current bit of the result, instead
of the whole result.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-i386: SSE4.2: fix pcmpXstrX instructions in "Equal each" mode
Aurelien Jarno [Tue, 26 Mar 2013 18:56:01 +0000 (19:56 +0100)]
target-i386: SSE4.2: fix pcmpXstrX instructions in "Equal each" mode

pcmpXstrX instructions in "Equal each" mode force both invalid element
pair to true. It means (upper - MAX(valids, validd)) bits should be set
to 1, not (upper - MAX(valids, validd) + 1).

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-i386: SSE4.2: fix pcmpXstrX instructions in "Ranges" mode
Aurelien Jarno [Tue, 26 Mar 2013 18:56:01 +0000 (19:56 +0100)]
target-i386: SSE4.2: fix pcmpXstrX instructions in "Ranges" mode

Fix the order of the of the comparisons to match the "Intel 64 and
IA-32 Architectures Software Developer's Manual".

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-i386: SSE4.2: fix pcmpXstrm instructions
Aurelien Jarno [Tue, 26 Mar 2013 18:56:01 +0000 (19:56 +0100)]
target-i386: SSE4.2: fix pcmpXstrm instructions

pcmpXstrm instructions returns their result in the XMM0 register and
not in the first operand.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-i386: SSE4.2: fix pcmpXstri instructions
Aurelien Jarno [Tue, 26 Mar 2013 18:56:01 +0000 (19:56 +0100)]
target-i386: SSE4.2: fix pcmpXstri instructions

ffs1 returns the first bit set to one starting counting from the most
significant bit.

pcmpXstri returns the most significant bit set to one, starting counting
from the least significant bit.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-i386: SSE4.2: fix pcmpgtq instruction
Aurelien Jarno [Tue, 26 Mar 2013 18:56:01 +0000 (19:56 +0100)]
target-i386: SSE4.2: fix pcmpgtq instruction

The "Intel 64 and IA-32 Architectures Software Developer's Manual" (at
least recent versions) clearly says that the comparison is signed.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-i386: SSE4.1: fix pinsrb instruction
Aurelien Jarno [Tue, 26 Mar 2013 18:56:01 +0000 (19:56 +0100)]
target-i386: SSE4.1: fix pinsrb instruction

gen_op_mov_TN_reg() loads the value in cpu_T[0], so this temporary should
be used instead of cpu_tmp0.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Mon, 1 Apr 2013 15:36:09 +0000 (10:36 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

# By Dunrong Huang (1) and others
# Via Stefan Hajnoczi
* stefanha/trivial-patches:
  hw/tcx: Remove unused 'addr' field and the property that sets it
  hw/i386/pc: format load_linux function
  configure: show debug-info option in --help output

11 years agosysbus: Remove sysbus_add_memory and sysbus_del_memory
Peter Maydell [Fri, 15 Mar 2013 14:34:23 +0000 (14:34 +0000)]
sysbus: Remove sysbus_add_memory and sysbus_del_memory

Remove the sysbus_add_memory and sysbus_del_memory functions. These
are trivial wrappers for mapping a memory region into the system
memory space, and have no users now.  Sysbus devices should never map
their own memory regions anyway; the correct API for mapping an mmio
region is for the creator of the device to use sysbus_mmio_map.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Message-id: 1363358063-23973-6-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agohw/milkymist-softusb: set buffer in softusb_read_{dmem, pmem} error path
Peter Maydell [Thu, 28 Mar 2013 18:43:04 +0000 (18:43 +0000)]
hw/milkymist-softusb: set buffer in softusb_read_{dmem, pmem} error path

Make sure we set the buffer to something in the softusb_read_{dmem,pmem}
error paths, since the caller will use the buffer unconditionally.
(Newer gcc is smart enough to spot this and complain about 'may be
used uninitialized'.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1364496184-11994-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomilkymist-softusb: Don't map RAM memory regions in the device itself
Peter Maydell [Fri, 15 Mar 2013 14:34:22 +0000 (14:34 +0000)]
milkymist-softusb: Don't map RAM memory regions in the device itself

Don't map the pmem and dmem RAM memory regions in the milkymist-softusb
device itself. Instead just expose them as sysbus mmio regions which
the device creator can map appropriately. This allows us to drop the
pmem_base and dmem_base properties. Instead of going via
cpu_physical_memory_read/_write when the device wants to access the
RAMs, we just keep a host pointer to the memory and use that.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Acked-by: Michael Walle <michael@walle.cc>
Message-id: 1363358063-23973-5-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomilkymist-minimac2: Just expose buffers as a sysbus mmio region
Peter Maydell [Fri, 15 Mar 2013 14:34:21 +0000 (14:34 +0000)]
milkymist-minimac2: Just expose buffers as a sysbus mmio region

Just expose the register buffers memory as a standard sysbus mmio
region which the creator of the device can map, rather than
providing a qdev property which the creator has to set to the
base address and then doing the mapping in the device's own
init function.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Acked-by: Michael Walle <michael@walle.cc>
Message-id: 1363358063-23973-4-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomusicpal: qdevify musicpal-misc
Peter Maydell [Fri, 15 Mar 2013 14:34:20 +0000 (14:34 +0000)]
musicpal: qdevify musicpal-misc

Make musicpal-misc into its own (trivial) qdev device, so we
can get rid of the abuse of sysbus_add_memory().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Message-id: 1363358063-23973-3-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agosysbus: make SysBusDeviceClass::init optional
Peter Maydell [Fri, 15 Mar 2013 14:34:19 +0000 (14:34 +0000)]
sysbus: make SysBusDeviceClass::init optional

Make the SysBusDeviceClass::init optional, for devices which
genuinely don't need to do anything here. In particular, simple
devices which can do all their initialization in their
instance_init method don't need either a DeviceClass::realize
or SysBusDeviceClass::init method.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-id: 1363358063-23973-2-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotarget-moxie: set do_interrupt to a target-specific helper function
Dunrong Huang [Sun, 31 Mar 2013 01:35:53 +0000 (09:35 +0800)]
target-moxie: set do_interrupt to a target-specific helper function

The value of "do_interrupt" member of CPUClass shoule be set to a
target-specific function, or it will lead to a segfault like below:

$ moxie-softmmu/qemu-system-moxie -M moxiesim
Segmentation fault

Cc: Anthony Green <green@moxielogic.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Andreas Färber <afaerber@suse.de>
Signed-off-by: Dunrong Huang <huangdr@cloud-times.com>
Signed-of-by: Anthony Green <green@moxielogic.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agow32: Fix build with older gcc (unresolved symbol)
Stefan Weil [Fri, 29 Mar 2013 17:20:20 +0000 (18:20 +0100)]
w32: Fix build with older gcc (unresolved symbol)

The cross i586-mingw32msvc-gcc 4.4.4 from Debian Squeeze does not support
__sync_val_compare_and_swap by default.

Using -march=i686 fixes that and should also result in better code.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-moxie: Fix pointer-to-integer conversion (MinGW-w64)
Stefan Weil [Sun, 24 Mar 2013 08:04:48 +0000 (09:04 +0100)]
target-moxie: Fix pointer-to-integer conversion (MinGW-w64)

The type cast must use tcg_target_long instead of long.
This makes a difference for hosts where sizeof(long) != sizeof(void *).

Cc: Anthony Green <green@moxielogic.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Green <green@moxielogic.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agopiix_pci: Fix C99 comments
David Woodhouse [Sat, 23 Feb 2013 00:40:39 +0000 (00:40 +0000)]
piix_pci: Fix C99 comments

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1361580039-4459-4-git-send-email-dwmw2@infradead.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopiix_pci: Use DEVICE() and ISA_BUS()
David Woodhouse [Sat, 23 Feb 2013 00:40:38 +0000 (00:40 +0000)]
piix_pci: Use DEVICE() and ISA_BUS()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1361580039-4459-3-git-send-email-dwmw2@infradead.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopiix_pci: Clean up i440FX object handling
David Woodhouse [Sat, 23 Feb 2013 00:40:37 +0000 (00:40 +0000)]
piix_pci: Clean up i440FX object handling

Define and use I440FX_PCI_DEVICE() instead of using DO_UPCAST().

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1361580039-4459-2-git-send-email-dwmw2@infradead.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-bridge-helper: force usage of a very high MAC address for the bridge
Paolo Bonzini [Fri, 22 Mar 2013 16:57:48 +0000 (17:57 +0100)]
qemu-bridge-helper: force usage of a very high MAC address for the bridge

Linux uses the lowest enslaved MAC address as the MAC address of
the bridge.  Set MAC address to a high value so that it does not
affect the MAC address of the bridge.

Changing the MAC address of the bridge could cause a few seconds
of network downtime.

Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1363971468-21154-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-balloon: cleanup: remove qdev field.
KONRAD Frederic [Wed, 27 Mar 2013 09:49:15 +0000 (10:49 +0100)]
virtio-balloon: cleanup: remove qdev field.

The qdev field is no longer needed, just drop it.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Message-id: 1364377755-15508-7-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-balloon: cleanup: QOM casts.
KONRAD Frederic [Wed, 27 Mar 2013 09:49:14 +0000 (10:49 +0100)]
virtio-balloon: cleanup: QOM casts.

As the virtio-balloon-pci is switched to the new API, we can use QOM
casts.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Message-id: 1364377755-15508-6-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-balloon: cleanup: init and exit function.
KONRAD Frederic [Wed, 27 Mar 2013 09:49:13 +0000 (10:49 +0100)]
virtio-balloon: cleanup: init and exit function.

This remove old init and exit function as they are no longer needed.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Message-id: 1364377755-15508-5-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-balloon-ccw: switch to the new API.
KONRAD Frederic [Wed, 27 Mar 2013 09:49:12 +0000 (10:49 +0100)]
virtio-balloon-ccw: switch to the new API.

Here the virtio-balloon-ccw is modified for the new API. The device
virtio-balloon-ccw extends virtio-ccw-device as before. It creates and
connects a virtio-balloon during the init. The properties are not modified.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Message-id: 1364377755-15508-4-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-balloon-pci: switch to the new API.
KONRAD Frederic [Wed, 27 Mar 2013 09:49:11 +0000 (10:49 +0100)]
virtio-balloon-pci: switch to the new API.

Here the virtio-balloon-pci is modified for the new API. The device
virtio-balloon-pci extends virtio-pci. It creates and connects a
virtio-balloon during the init. The properties are not changed.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Message-id: 1364377755-15508-3-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-balloon: add the virtio-balloon device.
KONRAD Frederic [Wed, 27 Mar 2013 09:49:10 +0000 (10:49 +0100)]
virtio-balloon: add the virtio-balloon device.

Create virtio-balloon which extends virtio-device, so it can be connected on
virtio-bus.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Message-id: 1364377755-15508-2-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'stefanha/block' into staging
Anthony Liguori [Thu, 28 Mar 2013 17:57:37 +0000 (12:57 -0500)]
Merge remote-tracking branch 'stefanha/block' into staging

# By Kevin Wolf (22) and Peter Lieven (1)
# Via Stefan Hajnoczi
* stefanha/block: (23 commits)
  block: Fix direct use of protocols as driver for bdrv_open()
  qcow2: Gather clusters in a looping loop
  qcow2: Move cluster gathering to a non-looping loop
  qcow2: Allow requests with multiple l2metas
  qcow2: Use byte granularity in qcow2_alloc_cluster_offset()
  qcow2: Prepare handle_alloc/copied() for byte granularity
  qcow2: handle_copied(): Implement non-zero host_offset
  qcow2: handle_copied(): Get rid of keep_clusters parameter
  qcow2: handle_copied(): Get rid of nb_clusters parameter
  qcow2: Factor out handle_copied()
  qcow2: Clean up handle_alloc()
  qcow2: Finalise interface of handle_alloc()
  qcow2: handle_alloc(): Get rid of keep_clusters parameter
  qcow2: handle_alloc(): Get rid of nb_clusters parameter
  qcow2: Factor out handle_alloc()
  qcow2: Decouple cluster allocation from cluster reuse code
  qcow2: Change handle_dependency to byte granularity
  qcow2: Improve check for overlapping allocations
  qcow2: Handle dependencies earlier
  qcow2: Remove bogus unlock of s->lock
  ...

11 years agoMerge remote-tracking branch 'stefanha/tracing' into staging
Anthony Liguori [Thu, 28 Mar 2013 17:57:32 +0000 (12:57 -0500)]
Merge remote-tracking branch 'stefanha/tracing' into staging

# By Lluís Vilanova (7) and others
# Via Stefan Hajnoczi
* stefanha/tracing:
  vl: add runstate_set tracepoint
  .gitignore: rename trace/generated-tracers.dtrace
  .gitignore: add trace/generated-events.[ch]
  trace: rebuild generated-events.o when configuration changes
  trace: [stderr] Port to generic event information and new control interface
  trace: [simple] Port to generic event information and new control interface
  trace: [default] Port to generic event information and new control interface
  trace: [monitor] Use new event control interface
  trace: Provide a detailed event control interface
  trace: Provide a generic tracing event descriptor
  trace: [tracetool] Explicitly identify public backends

11 years agovl: add runstate_set tracepoint
Kazuya Saito [Fri, 22 Mar 2013 08:26:59 +0000 (17:26 +0900)]
vl: add runstate_set tracepoint

This patch enables us to know RunState transition. It will be userful
for investigation when the trouble occured in special event such like
live migration, shutdown, suspend, and so on.

Signed-off-by: Kazuya Saito <saito.kazuya@jp.fujitsu.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years ago.gitignore: rename trace/generated-tracers.dtrace
Stefan Hajnoczi [Fri, 8 Mar 2013 15:10:12 +0000 (16:10 +0100)]
.gitignore: rename trace/generated-tracers.dtrace

For a while the file was called trace/generated-tracers-dtrace.dtrace
but today it's called trace/generated-tracers.dtrace.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years ago.gitignore: add trace/generated-events.[ch]
Stefan Hajnoczi [Fri, 8 Mar 2013 15:10:11 +0000 (16:10 +0100)]
.gitignore: add trace/generated-events.[ch]

Don't display autogenerated files in git-status(1).

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agotrace: rebuild generated-events.o when configuration changes
Stefan Hajnoczi [Fri, 8 Mar 2013 14:52:15 +0000 (15:52 +0100)]
trace: rebuild generated-events.o when configuration changes

Make sure to rebuild generated-events.o when ./configure options change.
This prevents linker errors when a stale generated-events.o gets linked
with code compiled against fresh headers.  For example, try building
with ./configure --enable-trace-backend=stderr followed by ./configure
--enable-trace-backend=dtrace.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agotrace: [stderr] Port to generic event information and new control interface
Lluís Vilanova [Tue, 5 Mar 2013 13:48:00 +0000 (14:48 +0100)]
trace: [stderr] Port to generic event information and new control interface

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agotrace: [simple] Port to generic event information and new control interface
Lluís Vilanova [Tue, 5 Mar 2013 13:47:55 +0000 (14:47 +0100)]
trace: [simple] Port to generic event information and new control interface

The backend is forced to dump event numbers using 64 bits, as TraceEventID is
an enum.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agotrace: [default] Port to generic event information and new control interface
Lluís Vilanova [Tue, 5 Mar 2013 13:47:49 +0000 (14:47 +0100)]
trace: [default] Port to generic event information and new control interface

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agotrace: [monitor] Use new event control interface
Lluís Vilanova [Tue, 5 Mar 2013 13:47:43 +0000 (14:47 +0100)]
trace: [monitor] Use new event control interface

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agotrace: Provide a detailed event control interface
Lluís Vilanova [Tue, 5 Mar 2013 13:47:38 +0000 (14:47 +0100)]
trace: Provide a detailed event control interface

This interface decouples event obtaining from interaction.

Events can be obtained through three different methods:

* identifier
* name
* simple wildcard pattern

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agotrace: Provide a generic tracing event descriptor
Lluís Vilanova [Tue, 5 Mar 2013 13:47:32 +0000 (14:47 +0100)]
trace: Provide a generic tracing event descriptor

Uses tracetool to generate a backend-independent tracing event description
(struct TraceEvent).

The values for such structure are generated with the non-public "events"
backend ("events-c" frontend).

The generation of the defines to check if an event is statically enabled is also
moved to the "events" backend ("events-h" frontend).

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agotrace: [tracetool] Explicitly identify public backends
Lluís Vilanova [Tue, 5 Mar 2013 13:47:26 +0000 (14:47 +0100)]
trace: [tracetool] Explicitly identify public backends

Public backends are those printed by "--list-backends" and thus considered valid
by the configure script.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoblock: Fix direct use of protocols as driver for bdrv_open()
Kevin Wolf [Wed, 27 Mar 2013 16:28:18 +0000 (17:28 +0100)]
block: Fix direct use of protocols as driver for bdrv_open()

bdrv_open_common() implements direct use of protocols by copying the
pre-opened BlockDriverStates to bs using bdrv_swap(). It did however
first set some fields in bs, which end up in file after the swap. When
bdrv_open() destroys file, it appears to be open, and because it isn't,
qemu could segfault while trying to close it.

Reorder the operations to return immediately in such cases so that file
is correctly detected as closed.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Gather clusters in a looping loop
Kevin Wolf [Wed, 27 Mar 2013 10:43:49 +0000 (11:43 +0100)]
qcow2: Gather clusters in a looping loop

Instead of just checking once in exactly this order if there are
dependendies, non-COW clusters and new allocation, this starts looping
around these. This way we can, for example, gather non-COW clusters after
new allocations as long as the host cluster offsets stay contiguous.

Once handle_dependencies() is extended so that COW areas of in-flight
allocations can be overwritten, this allows to continue with gathering
other clusters (we wouldn't be able to do that without this change
because we would have missed a possible second dependency in one of the
next clusters).

This means that in the typical sequential write case, we can combine the
COW overwrite of one cluster with the allocation of the next cluster as
soon as something like Delayed COW gets actually implemented. It is only
by avoiding splitting requests this way that Delayed COW actually starts
improving performance noticably.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Move cluster gathering to a non-looping loop
Kevin Wolf [Tue, 26 Mar 2013 16:50:12 +0000 (17:50 +0100)]
qcow2: Move cluster gathering to a non-looping loop

This patch is mainly to separate the indentation change from the
semantic changes. All that really changes here is that everything moves
into a while loop, all 'goto done' become 'break' and at the end of the
loop a new 'break is inserted.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Allow requests with multiple l2metas
Kevin Wolf [Tue, 26 Mar 2013 16:50:11 +0000 (17:50 +0100)]
qcow2: Allow requests with multiple l2metas

Instead of expecting a single l2meta, have a list of them. This allows
to still have a single I/O request for the guest data, even though
multiple l2meta may be needed in order to describe both a COW overwrite
and a new cluster allocation (typical sequential write case).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Use byte granularity in qcow2_alloc_cluster_offset()
Kevin Wolf [Tue, 26 Mar 2013 16:50:10 +0000 (17:50 +0100)]
qcow2: Use byte granularity in qcow2_alloc_cluster_offset()

This gets rid of the nb_clusters and keep_clusters and the associated
complicated calculations. Just advance the number of bytes that have
been processed and everything is fine.

This patch advances the variables even after the last operation even
though they aren't used any more afterwards to make things look more
uniform. A later patch will turn the whole thing into a loop and then
it actually starts making sense.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Prepare handle_alloc/copied() for byte granularity
Kevin Wolf [Tue, 26 Mar 2013 16:50:09 +0000 (17:50 +0100)]
qcow2: Prepare handle_alloc/copied() for byte granularity

This makes handle_alloc() and handle_copied() return byte-granularity
host offsets instead of returning always the cluster start. This is
required so that qcow2_alloc_cluster_offset() can stop aligning
everything to cluster boundaries.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: handle_copied(): Implement non-zero host_offset
Kevin Wolf [Tue, 26 Mar 2013 16:50:08 +0000 (17:50 +0100)]
qcow2: handle_copied(): Implement non-zero host_offset

Look only for clusters that start at a given physical offset.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: handle_copied(): Get rid of keep_clusters parameter
Kevin Wolf [Tue, 26 Mar 2013 16:50:07 +0000 (17:50 +0100)]
qcow2: handle_copied(): Get rid of keep_clusters parameter

Now *bytes is used to return the length of the area that can be written
to without performing an allocation or COW.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: handle_copied(): Get rid of nb_clusters parameter
Kevin Wolf [Tue, 26 Mar 2013 16:50:06 +0000 (17:50 +0100)]
qcow2: handle_copied(): Get rid of nb_clusters parameter

handle_copied() uses its bytes parameter now to determine how many
clusters it should try to find.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Factor out handle_copied()
Kevin Wolf [Tue, 26 Mar 2013 16:50:05 +0000 (17:50 +0100)]
qcow2: Factor out handle_copied()

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Clean up handle_alloc()
Kevin Wolf [Tue, 26 Mar 2013 16:50:04 +0000 (17:50 +0100)]
qcow2: Clean up handle_alloc()

Things can be simplified a bit now. No semantic changes.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Finalise interface of handle_alloc()
Kevin Wolf [Tue, 26 Mar 2013 16:50:03 +0000 (17:50 +0100)]
qcow2: Finalise interface of handle_alloc()

The interface works completely on a byte granularity now and duplicated
parameters are removed.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: handle_alloc(): Get rid of keep_clusters parameter
Kevin Wolf [Tue, 26 Mar 2013 16:50:02 +0000 (17:50 +0100)]
qcow2: handle_alloc(): Get rid of keep_clusters parameter

handle_alloc() is now called with the offset at which the actual new
allocation starts instead of the offset at which the whole write request
starts, part of which may already be processed.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: handle_alloc(): Get rid of nb_clusters parameter
Kevin Wolf [Tue, 26 Mar 2013 16:50:01 +0000 (17:50 +0100)]
qcow2: handle_alloc(): Get rid of nb_clusters parameter

We already communicate the same information in *bytes.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Factor out handle_alloc()
Kevin Wolf [Tue, 26 Mar 2013 16:50:00 +0000 (17:50 +0100)]
qcow2: Factor out handle_alloc()

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Decouple cluster allocation from cluster reuse code
Kevin Wolf [Tue, 26 Mar 2013 16:49:59 +0000 (17:49 +0100)]
qcow2: Decouple cluster allocation from cluster reuse code

This moves some code that prepares the allocation of new clusters to
where the actual allocation happens. This is the minimum required to be
able to move it to a separate function in the next patch.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Change handle_dependency to byte granularity
Kevin Wolf [Tue, 26 Mar 2013 16:49:58 +0000 (17:49 +0100)]
qcow2: Change handle_dependency to byte granularity

This is a more precise description of what really constitutes a
dependency. The behaviour doesn't change at this point because the COW
area of the old request is still aligned to cluster boundaries and
therefore an overlap is detected wheneven the requests touch any part of
the same cluster.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Improve check for overlapping allocations
Kevin Wolf [Tue, 26 Mar 2013 16:49:57 +0000 (17:49 +0100)]
qcow2: Improve check for overlapping allocations

The old code detected an overlapping allocation even when the
allocations didn't actually overlap, but were only adjacent.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Handle dependencies earlier
Kevin Wolf [Tue, 26 Mar 2013 16:49:56 +0000 (17:49 +0100)]
qcow2: Handle dependencies earlier

Handling overlapping allocations isn't just a detail of cluster
allocation. It is rather one of three ways to get the host cluster
offset for a write request:

1. If a request overlaps an in-flight allocations, the cluster offset
   can be taken from there (this is what handle_dependencies will evolve
   into) or the request must just wait until the allocation has
   completed. Accessing the L2 is not valid in this case, it has
   outdated information.

2. Outside overlapping areas, check the clusters that can be written to
   as they are, with no COW involved.

3. If a COW is required, allocate new clusters

Changing the code to reflect this doesn't change the behaviour because
overlaps cannot exist for clusters that are kept in step 2. It does
however make it easier for later patches to work on clusters that belong
to an allocation that is still in flight.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Remove bogus unlock of s->lock
Kevin Wolf [Tue, 26 Mar 2013 16:49:55 +0000 (17:49 +0100)]
qcow2: Remove bogus unlock of s->lock

The unlock wakes up the next coroutine, but the currently running
coroutine will lock it again before it yields, so this doesn't make a
lot of sense.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Fix "total clusters" number in bdrv_check
Kevin Wolf [Tue, 26 Mar 2013 16:49:54 +0000 (17:49 +0100)]
qcow2: Fix "total clusters" number in bdrv_check

This should be based on the virtual disk size, not on the size of the
image.

Interesting observation: With some VM state stored in the image file,
percentages higher than 100% are possible, even though snapshots
themselves are ignored. This is a qcow2 bug to be fixed another day: The
VM state should be discarded in the active L2 tables after completing
the snapshot creation.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqemu-iotests: More concurrent allocation scenarios
Kevin Wolf [Tue, 26 Mar 2013 16:49:53 +0000 (17:49 +0100)]
qemu-iotests: More concurrent allocation scenarios

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agovl.c: call bdrv_init_with_whitelist() before cmdline parsing
Peter Lieven [Thu, 21 Mar 2013 12:07:10 +0000 (13:07 +0100)]
vl.c: call bdrv_init_with_whitelist() before cmdline parsing

commit 4d454574 "qemu-option: move standard option definitions
out of qemu-config.c" broke support for commandline option
groups that where registered during bdrv_init(). In particular
support for -iscsi options was broken since that commit.

Fix by moving the bdrv_init_with_whitelist() before command
line argument parsing.

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agohw/tcx: Remove unused 'addr' field and the property that sets it
Peter Maydell [Tue, 26 Mar 2013 12:35:09 +0000 (12:35 +0000)]
hw/tcx: Remove unused 'addr' field and the property that sets it

Remove the 'addr' field from TCXState (since it is completely unused),
also the qdev property which sets it. This seems to be a relic from
many years past; devices don't need to know where they are mapped.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agohw/i386/pc: format load_linux function
liguang [Tue, 26 Mar 2013 08:43:19 +0000 (16:43 +0800)]
hw/i386/pc: format load_linux function

Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoconfigure: show debug-info option in --help output
Dunrong Huang [Sun, 24 Mar 2013 07:05:27 +0000 (15:05 +0800)]
configure: show debug-info option in --help output

"--enable-debug-info" and "--disable-debug-info" were not shown
in --help output.

Signed-off-by: Dunrong Huang <huangdr@cloud-times.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agospice-qemu-char: Drop hackish vmc_register on spice_chr_write
Hans de Goede [Tue, 26 Mar 2013 10:08:03 +0000 (11:08 +0100)]
spice-qemu-char: Drop hackish vmc_register on spice_chr_write

Now that the core takes care of fe_open tracking we no longer need this hack.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Message-id: 1364292483-16564-12-git-send-email-hdegoede@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-serial: propagate guest_connected to the port on post_load
Alon Levy [Tue, 26 Mar 2013 10:08:02 +0000 (11:08 +0100)]
virtio-serial: propagate guest_connected to the port on post_load

When migrating a host with with a spice agent running the mouse becomes
non operational after the migration due to the agent state being
inconsistent between the guest and the client.

After migration the spicevmc backend on the destination has never been notified
of the (non 0) guest_connected state. Virtio-serial holds this state
information and migrates it, this patch properly propagates this information
to virtio-console and through that to interested chardev backends.

rhbz #725965

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Message-id: 1364292483-16564-11-git-send-email-hdegoede@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-serial: Consolidate guest_open/guest_close into set_guest_connected
Hans de Goede [Tue, 26 Mar 2013 10:08:01 +0000 (11:08 +0100)]
virtio-serial: Consolidate guest_open/guest_close into set_guest_connected

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Message-id: 1364292483-16564-10-git-send-email-hdegoede@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-char: add_handlers: Don't re-send the be_open event on unregister
Hans de Goede [Tue, 26 Mar 2013 10:08:00 +0000 (11:08 +0100)]
qemu-char: add_handlers: Don't re-send the be_open event on unregister

Resending the be_open event only is useful when a frontend is registering, not
when it is unregistering.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Message-id: 1364292483-16564-9-git-send-email-hdegoede@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-char: Move incrementing of avail_connections to qdev-properties-system
Hans de Goede [Tue, 26 Mar 2013 10:07:59 +0000 (11:07 +0100)]
qemu-char: Move incrementing of avail_connections to qdev-properties-system

The decrement of avail_connections is done in qdev-properties-system move
the increment there too for proper balancing of the calls.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Message-id: 1364292483-16564-8-git-send-email-hdegoede@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-char: Consolidate guest_close/guest_open into a set_fe_open callback
Hans de Goede [Tue, 26 Mar 2013 10:07:58 +0000 (11:07 +0100)]
qemu-char: Consolidate guest_close/guest_open into a set_fe_open callback

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Message-id: 1364292483-16564-7-git-send-email-hdegoede@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-char: Cleanup: consolidate fe_open/fe_close into fe_set_open
Hans de Goede [Tue, 26 Mar 2013 10:07:57 +0000 (11:07 +0100)]
qemu-char: Cleanup: consolidate fe_open/fe_close into fe_set_open

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Message-id: 1364292483-16564-6-git-send-email-hdegoede@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-char: Automatically do fe_open / fe_close on qemu_chr_add_handlers
Hans de Goede [Tue, 26 Mar 2013 10:07:56 +0000 (11:07 +0100)]
qemu-char: Automatically do fe_open / fe_close on qemu_chr_add_handlers

Most frontends can't really determine if the guest actually has the frontend
side open. So lets automatically generate fe_open / fe_close as soon as a
frontend becomes ready (as signalled by calling qemu_chr_add_handlers) /
becomes non ready (as signalled by setting all handlers to NULL).

And allow frontends which can actually determine if the guest is listening to
opt-out of this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Message-id: 1364292483-16564-5-git-send-email-hdegoede@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-char: Add fe_open tracking
Hans de Goede [Tue, 26 Mar 2013 10:07:55 +0000 (11:07 +0100)]
qemu-char: Add fe_open tracking

Add tracking of the fe_open state to struct CharDriverState.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Message-id: 1364292483-16564-4-git-send-email-hdegoede@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-char: Rename qemu_chr_generic_open to qemu_chr_be_generic_open
Hans de Goede [Tue, 26 Mar 2013 10:07:54 +0000 (11:07 +0100)]
qemu-char: Rename qemu_chr_generic_open to qemu_chr_be_generic_open

To better reflect that it is for handling a backend being opened.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Message-id: 1364292483-16564-3-git-send-email-hdegoede@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-char: Rename opened to be_open
Hans de Goede [Tue, 26 Mar 2013 10:07:53 +0000 (11:07 +0100)]
qemu-char: Rename opened to be_open

Rename the opened variable to be_open to reflect that it contains the
opened state of the backend.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Message-id: 1364292483-16564-2-git-send-email-hdegoede@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agocompiler: fix warning with GCC 4.8.0
Paolo Bonzini [Wed, 27 Mar 2013 13:34:32 +0000 (14:34 +0100)]
compiler: fix warning with GCC 4.8.0

GCC 4.8.0 introduces a new warning:

    block/qcow2-snapshot.c: In function 'qcow2_write_snapshots’:
    block/qcow2-snapshot.c:252:18: error: typedef 'qemu_build_bug_on__253'
              locally defined but not used [-Werror=unused-local-typedefs]
         QEMU_BUILD_BUG_ON(offsetof(QCowHeader, snapshots_offset) !=
                  ^
    cc1: all warnings being treated as errors

(Caret diagnostics aren't perfect yet with macros... :)) Work around it
with __attribute__((unused)).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1364391272-1128-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'mst/tags/for_anthony' into staging
Anthony Liguori [Tue, 26 Mar 2013 21:16:43 +0000 (16:16 -0500)]
Merge remote-tracking branch 'mst/tags/for_anthony' into staging

virtio,pci,qom

Work by Alex to support VGA assignment,
pci and virtio fixes by Stefan, Jason and myself, and a
new qmp event for hotplug support by myself.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
# gpg: Signature made Tue 26 Mar 2013 02:02:24 PM CDT using RSA key ID D28D5469
# gpg: Can't check signature: public key not found

# By Alex Williamson (13) and others
# Via Michael S. Tsirkin
* mst/tags/for_anthony: (23 commits)
  pcie: Add endpoint capability initialization wrapper
  roms: switch oldnoconfig to olddefconfig
  pcie: Mangle types to match topology
  pci: Create and use API to determine root buses
  pci: Create pci_bus_is_express helper
  pci: Q35, Root Ports, and Switches create PCI Express buses
  pci: Allow PCI bus creation interfaces to specify the type of bus
  pci: Move PCI and PCIE type defines
  pci: Create and register a new PCI Express TypeInfo
  exec: assert that RAMBlock size is non-zero
  pci: refuse empty ROM files
  pci_bridge: Remove duplicate IRQ swizzle function
  pci_bridge: Use a default map_irq function
  pci: Fix INTx routing notifier recursion
  pci_bridge: drop formatting from source
  pci_bridge: factor out common code
  pci: Teach PCI Bridges about VGA routing
  pci: Add PCI VGA helpers
  virtio-pci: guest notifier mask without non-irqfd
  virtio-net: remove layout assumptions for mq ctrl
  ...

11 years agopcie: Add endpoint capability initialization wrapper
Alex Williamson [Tue, 19 Mar 2013 18:11:24 +0000 (12:11 -0600)]
pcie: Add endpoint capability initialization wrapper

Fix the awkward API of mangling the caller specified PCIe type and
just provide an interface to initialize an endpoint device.  This
will pick either a regular endpoint or integrated endpoint based on
the bus and return pcie_cap_init to doing exactly what is asked.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
11 years agoroms: switch oldnoconfig to olddefconfig
Michael S. Tsirkin [Thu, 21 Mar 2013 12:04:21 +0000 (14:04 +0200)]
roms: switch oldnoconfig to olddefconfig

When a new option is added that qemu does not know
about, the prudent thing is to use the default not
force it to "no".

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
11 years agopcie: Mangle types to match topology
Alex Williamson [Thu, 14 Mar 2013 22:01:35 +0000 (16:01 -0600)]
pcie: Mangle types to match topology

Windows will fail to start drivers for devices with an Endpoint type
PCIe capability attached to a Root Complex (code 10 - Device cannot
start).  The proper type for such a device is Root Complex Integrated
Endpoint.  Devices don't care which they are, so do this conversion
automatically.

This allows the Windows driver to load for nec-usb-xhci when attached
to pcie.0 of a q35 machine.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
11 years agopci: Create and use API to determine root buses
Alex Williamson [Thu, 14 Mar 2013 22:01:29 +0000 (16:01 -0600)]
pci: Create and use API to determine root buses

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
11 years agopci: Create pci_bus_is_express helper
Alex Williamson [Thu, 14 Mar 2013 22:01:23 +0000 (16:01 -0600)]
pci: Create pci_bus_is_express helper

For testing the bus type.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>