sdk/emulator/qemu.git
11 years agostellaris: QOM cast cleanup for gptm_state
Andreas Färber [Wed, 24 Jul 2013 07:03:33 +0000 (09:03 +0200)]
stellaris: QOM cast cleanup for gptm_state

Introduce a type constant, use QOM casts, rename the parent field and
prepare for QOM realize.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agospitz: QOM cast cleanup for SpitzKeyboardState
Andreas Färber [Wed, 24 Jul 2013 06:58:32 +0000 (08:58 +0200)]
spitz: QOM cast cleanup for SpitzKeyboardState

Introduce a type constant, use QOM casts, rename the parent field and
prepare for QOM realize.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agospitz: QOM cast cleanup for SLNANDState
Andreas Färber [Wed, 24 Jul 2013 06:54:33 +0000 (08:54 +0200)]
spitz: QOM cast cleanup for SLNANDState

Introduce a type constant, use QOM casts and rename the parent field.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopxa2xx_pic: QOM cast cleanup for PXA2xxPICState
Andreas Färber [Wed, 24 Jul 2013 00:08:09 +0000 (02:08 +0200)]
pxa2xx_pic: QOM cast cleanup for PXA2xxPICState

Introduce a type constant, use QOM casts, rename the parent field and
prepare for QOM realize.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopxa2xx_gpio: QOM cast cleanup for PXA2xxGPIOInfo
Andreas Färber [Wed, 24 Jul 2013 00:03:39 +0000 (02:03 +0200)]
pxa2xx_gpio: QOM cast cleanup for PXA2xxGPIOInfo

Introduce a type constant, use QOM casts, rename the parent field and
prepare for QOM realize.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopxa2xx: QOM cast cleanup for PXA2xxI2CState
Andreas Färber [Tue, 23 Jul 2013 23:56:59 +0000 (01:56 +0200)]
pxa2xx: QOM cast cleanup for PXA2xxI2CState

Introduce a type constant, use QOM casts, rename the parent field and
prepare for QOM realize.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopxa2xx: QOM cast cleanup for PXA2xxRTCState
Andreas Färber [Tue, 23 Jul 2013 23:50:26 +0000 (01:50 +0200)]
pxa2xx: QOM cast cleanup for PXA2xxRTCState

Introduce a type constant, use QOM casts and rename the parent field.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopxa2xx: QOM cast cleanup for PXA2xxSSPState
Andreas Färber [Tue, 23 Jul 2013 23:45:10 +0000 (01:45 +0200)]
pxa2xx: QOM cast cleanup for PXA2xxSSPState

Introduce a type constant, use QOM casts, rename the parent field and
prepare for QOM realize.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomusicpal: QOM cast cleanup for musicpal_key_state
Andreas Färber [Tue, 23 Jul 2013 23:38:59 +0000 (01:38 +0200)]
musicpal: QOM cast cleanup for musicpal_key_state

Introduce a type constant, use QOM casts, rename the parent field and
prepare for QOM realize.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomusicpal: QOM cast cleanup for musicpal_gpio_state
Andreas Färber [Tue, 23 Jul 2013 23:36:24 +0000 (01:36 +0200)]
musicpal: QOM cast cleanup for musicpal_gpio_state

Introduce a type constant, use QOM casts, rename the parent field and
prepare for QOM realize.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomusicpal: QOM cast cleanup for mv88w8618_flashcfg
Andreas Färber [Tue, 23 Jul 2013 23:32:00 +0000 (01:32 +0200)]
musicpal: QOM cast cleanup for mv88w8618_flashcfg

Introduce a type constant, use QOM casts and rename the parent field.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomusicpal: QOM cast cleanup for mv88w8618_pit_state
Andreas Färber [Tue, 23 Jul 2013 23:27:32 +0000 (01:27 +0200)]
musicpal: QOM cast cleanup for mv88w8618_pit_state

Introduce a type constant, use QOM casts and rename the parent field.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomusicpal: QOM cast cleanup mv88w8618_pic_state
Andreas Färber [Tue, 23 Jul 2013 23:22:07 +0000 (01:22 +0200)]
musicpal: QOM cast cleanup mv88w8618_pic_state

Introduce a type constant, use QOM casts and rename the parent field.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomusicpal: QOM cast cleanup for musicpal_lcd_state
Andreas Färber [Tue, 23 Jul 2013 23:16:13 +0000 (01:16 +0200)]
musicpal: QOM cast cleanup for musicpal_lcd_state

Introduce a type constant, use QOM casts, rename the parent field and
prepare for QOM realize.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomusicpal: QOM cast cleanup for mv88w8618_eth_state
Andreas Färber [Tue, 23 Jul 2013 23:12:52 +0000 (01:12 +0200)]
musicpal: QOM cast cleanup for mv88w8618_eth_state

Introduce type constant and use QOM casts.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomusicpal: Fix typo in name of local function
Stefan Weil [Sun, 28 Jul 2013 05:54:55 +0000 (07:54 +0200)]
musicpal: Fix typo in name of local function

The misspelling was spotted by Andreas Färber.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agointegratorcp: QOM cast cleanup for icp_pic_state
Andreas Färber [Tue, 23 Jul 2013 23:08:01 +0000 (01:08 +0200)]
integratorcp: QOM cast cleanup for icp_pic_state

Introduce type constant and use QOM cast.
Fix indentation.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agointegratorcp: QOM cast cleanup for integratorcm_state
Andreas Färber [Tue, 23 Jul 2013 23:00:27 +0000 (01:00 +0200)]
integratorcp: QOM cast cleanup for integratorcm_state

Rename to IntegratorCMState, introduce type constant and use QOM cast.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agohighbank: QOM cast cleanup for HighbankRegsState
Andreas Färber [Tue, 23 Jul 2013 22:52:40 +0000 (00:52 +0200)]
highbank: QOM cast cleanup for HighbankRegsState

Add type constant and use QOM casts.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoarmv7m: QOM cast cleanup for BitBandState
Andreas Färber [Tue, 23 Jul 2013 22:46:43 +0000 (00:46 +0200)]
armv7m: QOM cast cleanup for BitBandState

Introduce TYPE_* constant and use QOM cast.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoimx_ccm: QOM cast cleanup
Andreas Färber [Fri, 26 Jul 2013 19:50:54 +0000 (21:50 +0200)]
imx_ccm: QOM cast cleanup

Introduce type constant and use QOM casts.

Acked-by: Peter Chubb <peter.chubb@nicta.com.au>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoimx_avic: QOM cast cleanup
Andreas Färber [Fri, 26 Jul 2013 17:31:08 +0000 (19:31 +0200)]
imx_avic: QOM cast cleanup

Introduce type constant, use QOM casts and prepare SysBus initfn for QOM
realize by resolving SysBusDevice vs. DeviceState "dev" name conflict.

Acked-by: Peter Chubb <peter.chubb@nicta.com.au>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotcx: QOM cast cleanup
Andreas Färber [Wed, 24 Jul 2013 23:13:54 +0000 (01:13 +0200)]
tcx: QOM cast cleanup

Introduce a type constant, use QOM casts and rename the parent field.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopl110: QOM'ify pl110, pl110_versatile and pl111
Andreas Färber [Wed, 24 Jul 2013 23:09:03 +0000 (01:09 +0200)]
pl110: QOM'ify pl110, pl110_versatile and pl111

Let pl110_versatile and pl111 inherit from pl110 and use PL110() cast;
set their version index in an instance_init.

Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Set version PL110 explicitly, suggested by Hu Tao; fixed inheritence]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopl110: Rename pl110_state to PL110State
Andreas Färber [Wed, 24 Jul 2013 22:57:23 +0000 (00:57 +0200)]
pl110: Rename pl110_state to PL110State

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomilkymist-vgafb: QOM cast cleanup
Andreas Färber [Wed, 24 Jul 2013 22:53:39 +0000 (00:53 +0200)]
milkymist-vgafb: QOM cast cleanup

Introduce a type constant, use QOM casts and rename the parent field.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomilkymist-tmu2: QOM cast cleanup
Andreas Färber [Wed, 24 Jul 2013 22:48:23 +0000 (00:48 +0200)]
milkymist-tmu2: QOM cast cleanup

Introduce a type constant, use QOM casts and rename the parent field.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agojazz_led: QOM cast cleanup
Andreas Färber [Wed, 24 Jul 2013 22:35:51 +0000 (00:35 +0200)]
jazz_led: QOM cast cleanup

Introduce a type constant, use QOM casts and rename the parent field.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agog364fb: QOM cast cleanup
Andreas Färber [Wed, 24 Jul 2013 22:30:30 +0000 (00:30 +0200)]
g364fb: QOM cast cleanup

Introduce a type constant, use QOM casts and rename the parent field and
prepare for QOM realize.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoexynos4210_fimd: QOM cast cleanup
Andreas Färber [Wed, 24 Jul 2013 22:24:50 +0000 (00:24 +0200)]
exynos4210_fimd: QOM cast cleanup

Introduce a type constant, use QOM casts and rename the parent field.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoonenand: QOM cast cleanup
Andreas Färber [Wed, 24 Jul 2013 08:44:48 +0000 (10:44 +0200)]
onenand: QOM cast cleanup

Introduce a type constant, use QOM casts and rename the parent field and
prepare for QOM realize.

Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopl041: QOM cast cleanup
Andreas Färber [Wed, 24 Jul 2013 08:19:32 +0000 (10:19 +0200)]
pl041: QOM cast cleanup

Introduce a type constant, use QOM casts and rename the parent field.

Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopl041: Rename pl041_state to PL041State
Andreas Färber [Sat, 27 Jul 2013 17:45:52 +0000 (19:45 +0200)]
pl041: Rename pl041_state to PL041State

Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Split off renaming from QOM cast changes]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomilkymist-ac97: QOM cast cleanup
Andreas Färber [Wed, 24 Jul 2013 08:15:29 +0000 (10:15 +0200)]
milkymist-ac97: QOM cast cleanup

Introduce a type constant, use QOM casts and rename the parent field.

Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoaudio/marvell_88w8618: QOM cast cleanup
Andreas Färber [Wed, 24 Jul 2013 08:10:44 +0000 (10:10 +0200)]
audio/marvell_88w8618: QOM cast cleanup

Introduce a type constant, use QOM casts and rename the parent field.

Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocs4231: QOM cast cleanup
Andreas Färber [Wed, 24 Jul 2013 08:04:31 +0000 (10:04 +0200)]
cs4231: QOM cast cleanup

Introduce a type constant, use QOM casts and rename the parent field.

Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoxilinx_uartlite: QOM cast cleanups
Andreas Färber [Wed, 24 Jul 2013 21:37:28 +0000 (23:37 +0200)]
xilinx_uartlite: QOM cast cleanups

Introduce type constant and use QOM casts.

Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoxilinx_uartlite: Rename xlx_uartlite to XilinxUARTLite
Andreas Färber [Wed, 24 Jul 2013 21:34:25 +0000 (23:34 +0200)]
xilinx_uartlite: Rename xlx_uartlite to XilinxUARTLite

Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoetraxfs_ser: QOM cast cleanups
Andreas Färber [Wed, 24 Jul 2013 19:52:26 +0000 (21:52 +0200)]
etraxfs_ser: QOM cast cleanups

Rename etrax_serial to ETRAXSerial, introduce type constant and use QOM
casts.

Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopcie_port: Turn PCIEPort and PCIESlot into abstract QOM types
Andreas Färber [Fri, 12 Jul 2013 17:56:00 +0000 (19:56 +0200)]
pcie_port: Turn PCIEPort and PCIESlot into abstract QOM types

Move PCIEPort's "port" property to the new type, same for "aer_log_max".
Move PCIESlot's "chassis" and "slot" properties to the new type.

Reviewed-by: Don Koch <dkoch@verizon.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopci-bridge/i82801b11: Rename parent field
Andreas Färber [Fri, 12 Jul 2013 17:21:22 +0000 (19:21 +0200)]
pci-bridge/i82801b11: Rename parent field

Rename it to avoid accidental use.

Reviewed-by: Don Koch <dkoch@verizon.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopci-bridge-dev: QOM parent field cleanup
Andreas Färber [Fri, 12 Jul 2013 17:16:46 +0000 (19:16 +0200)]
pci-bridge-dev: QOM parent field cleanup

Rename it to avoid accidental use.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Don Koch <dkoch@verizon.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopci-bridge: Turn PCIBridge into abstract QOM type
Andreas Färber [Thu, 11 Jul 2013 15:13:43 +0000 (17:13 +0200)]
pci-bridge: Turn PCIBridge into abstract QOM type

Introduce TYPE_PCI_BRIDGE as base type and use PCI_BRIDGE() casts.

Reviewed-by: Don Koch <dkoch@verizon.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
[AF: Updated pbm-bridge parent to TYPE_PCI_BRIDGE]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoarm11mpcore: QOM cast cleanups for mpcore_rirq_state
Andreas Färber [Wed, 24 Jul 2013 22:11:10 +0000 (00:11 +0200)]
arm11mpcore: QOM cast cleanups for mpcore_rirq_state

Introduce a type constant, use QOM casts, rename the parent field and
prepare for QOM realize.

Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoarm11mpcore: QOM cast cleanups for ARM11MPCorePriveState
Andreas Färber [Wed, 24 Jul 2013 21:59:01 +0000 (23:59 +0200)]
arm11mpcore: QOM cast cleanups for ARM11MPCorePriveState

Introduce a type constant, use QOM casts and rename the parent field.

Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu/a15mpcore: QOM cast cleanup
Andreas Färber [Sun, 30 Jun 2013 19:03:27 +0000 (21:03 +0200)]
cpu/a15mpcore: QOM cast cleanup

Introduce type constant and cast macro and rename A15MPPrivState::busdev
field to parent_obj to enforce its use.

Prepares for QOM realize.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
11 years agotimer/arm_mptimer: QOM cast cleanup
Andreas Färber [Sun, 30 Jun 2013 17:37:10 +0000 (19:37 +0200)]
timer/arm_mptimer: QOM cast cleanup

Introduce type constant and cast macro and rename
ARMMPTimerState::busdev to enforce its use.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
11 years agocpu/a9mpcore: QOM casting cleanup
Andreas Färber [Sun, 30 Jun 2013 17:07:29 +0000 (19:07 +0200)]
cpu/a9mpcore: QOM casting cleanup

Introduce type constant and cast macro and enforce its use by
renaming A9MPPrivState::busdev field to parent_obj.

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
11 years agoide: Introduce abstract QOM type for PCIIDEState
Andreas Färber [Wed, 17 Jul 2013 16:44:48 +0000 (18:44 +0200)]
ide: Introduce abstract QOM type for PCIIDEState

Needed for QOM casts.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoide/piix: QOM casting sweep
Peter Crosthwaite [Mon, 24 Jun 2013 06:56:30 +0000 (16:56 +1000)]
ide/piix: QOM casting sweep

Use standard QOM cast macro. Remove usage of DO_UPCAST() and
direct -> style upcasting.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agofdc: Fix inheritence for SUNW,fdtwo
Andreas Färber [Fri, 26 Jul 2013 23:55:26 +0000 (01:55 +0200)]
fdc: Fix inheritence for SUNW,fdtwo

Since commit dd3be7420774f7dc8f37a96ca24d07f0b6f31b3b SUNW,fdtwo's
initfn (realizefn since 940194c2369e50d91d1abf6f36d43853eea5e539)
was using SYSBUS_FDC() cast. This uses type sysbus-fdc rather than
SUNW,fdtwo.

Fix this by letting SUNW,fdtwo and sysbus-fdc both inherit from an
abstract type base-sysbus-fdc.

This allows to consolidate realizefns by using instance_init functions.
Clean up variable names and variable order while at it.

Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: Hu Tao <hutao@cn.fujitsu.com>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoMerge remote-tracking branch 'stefanha/block' into staging
Anthony Liguori [Mon, 29 Jul 2013 16:33:48 +0000 (11:33 -0500)]
Merge remote-tracking branch 'stefanha/block' into staging

# By Stefan Hajnoczi (4) and others
# Via Stefan Hajnoczi
* stefanha/block:
  dataplane: refuse to start if device is already in use
  dataplane: enable virtio-blk x-data-plane=on live migration
  migration: fix spice migration
  migration: notify migration state before starting thread
  block: Repair the throttling code.
  gluster: Add image resize support

Message-id: 1375112172-24863-1-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging
Anthony Liguori [Mon, 29 Jul 2013 16:33:34 +0000 (11:33 -0500)]
Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging

QOM CPUState refactorings

* Fix x86 cpu-add
* Change KVM PMU behavior for 1.6

# gpg: Signature made Mon 29 Jul 2013 10:28:18 AM CDT using RSA key ID 3E7E013F
# gpg: Can't check signature: public key not found

# By Eduardo Habkost (2) and Andreas Färber (1)
# Via Andreas Färber
* afaerber/tags/qom-cpu-for-anthony:
  target-i386: Disable PMU CPUID leaf by default
  target-i386: Pass X86CPU object to cpu_x86_find_by_name()
  cpu: Partially revert "cpu: Change qemu_init_vcpu() argument to CPUState"

11 years agoqapi: Rename ChardevBackend member "memory" to "ringbuf"
Markus Armbruster [Fri, 26 Jul 2013 14:44:34 +0000 (16:44 +0200)]
qapi: Rename ChardevBackend member "memory" to "ringbuf"

Commit 1da48c6 called the new member "memory" after commit 3949e59
standardized "ringbuf".  Rename for consistency.

However, member name "memory" is visible in QMP since 1.5.  It's
undocumented just like the driver name.  Keep it working anyway.

Cc: qemu-stable@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1374849874-25531-4-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-char: Register ring buffer driver with correct name "ringbuf"
Markus Armbruster [Fri, 26 Jul 2013 14:44:33 +0000 (16:44 +0200)]
qemu-char: Register ring buffer driver with correct name "ringbuf"

The driver is new in 1.4, with the documented name "ringbuf".
However, it's actual name is the completely undocumented "memory".
Screwed up in commit 3949e59.  Fix code to match documentation.

Keep the undocumented name working as an alias for compatibility.

Cc: qemu-stable@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1374849874-25531-3-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoRevert "chardev: Make the name of memory device consistent"
Markus Armbruster [Fri, 26 Jul 2013 14:44:32 +0000 (16:44 +0200)]
Revert "chardev: Make the name of memory device consistent"

This reverts commit 6a85e60cb994bd95d1537aafbff65816f3de4637.

Commit 51767e7 "qemu-char: Add new char backend CirMemCharDriver"
introduced a memory ring buffer character device driver named
"memory".  Commit 3949e59 "qemu-char: Saner naming of memchar stuff &
doc fixes" changed the driver name to "ringbuf", along with a whole
bunch of other names, with the following rationale:

    Naming is a mess.  The code calls the device driver
    CirMemCharDriver, the public API calls it "memory", "memchardev",
    or "memchar", and the special commands are named like
    "memchar-FOO".  "memory" is a particularly unfortunate choice,
    because there's another character device driver called
    MemoryDriver.  Moreover, the device's distinctive property is that
    it's a ring buffer, not that's in memory.

This is what we released in 1.4.0.

Unfortunately, the rename missed a critical instance of "memory": the
actual driver name.  Thus, the new device could be used only by an
entirely undocumented name.  The documented name did not work.
Bummer.

Commit 6a85e60 fixes this by changing the documentation to match the
code.  It also changes some, but not all related occurences of
"ringbuf" to "memory".  Left alone are identifiers in C code, HMP and
QMP commands.  The latter are external interface, so they can't be
changed.

The result is an inconsistent mess.  Moreover, "memory" is a rotten
name.  The device's distinctive property is that it's a ring buffer,
not that's in memory.  User's don't care whether it's in RAM, flash,
or carved into chocolate tablets by Oompa Loompas.

Revert the commit.  Next commit will fix just the bug.

Cc: qemu-stable@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1374849874-25531-2-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqapi.py: Permit comments starting anywhere on the line
Markus Armbruster [Sat, 27 Jul 2013 15:42:01 +0000 (17:42 +0200)]
qapi.py: Permit comments starting anywhere on the line

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1374939721-7876-10-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqapi.py: Rename expr_eval to expr in parse_schema()
Markus Armbruster [Sat, 27 Jul 2013 15:42:00 +0000 (17:42 +0200)]
qapi.py: Rename expr_eval to expr in parse_schema()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1374939721-7876-9-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqapi.py: Fix diagnosing non-objects at a schema's top-level
Markus Armbruster [Sat, 27 Jul 2013 15:41:59 +0000 (17:41 +0200)]
qapi.py: Fix diagnosing non-objects at a schema's top-level

Report syntax error instead of crashing.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1374939721-7876-8-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqapi.py: Fix schema parser to check syntax systematically
Markus Armbruster [Sat, 27 Jul 2013 15:41:58 +0000 (17:41 +0200)]
qapi.py: Fix schema parser to check syntax systematically

Fixes at least the following parser bugs:

* accepts any token in place of a colon

* treats comma as optional

* crashes when closing braces or brackets are missing

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1374939721-7876-7-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqapi.py: Reject invalid characters in schema file
Markus Armbruster [Sat, 27 Jul 2013 15:41:57 +0000 (17:41 +0200)]
qapi.py: Reject invalid characters in schema file

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1374939721-7876-6-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqapi.py: Decent syntax error reporting
Markus Armbruster [Sat, 27 Jul 2013 15:41:56 +0000 (17:41 +0200)]
qapi.py: Decent syntax error reporting

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1374939721-7876-5-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqapi.py: Restructure lexer and parser
Markus Armbruster [Sat, 27 Jul 2013 15:41:55 +0000 (17:41 +0200)]
qapi.py: Restructure lexer and parser

The parser has a rather unorthodox structure:

    Until EOF:

        Read a section:

            Generator function get_expr() yields one section after the
            other, as a string.  An unindented, non-empty line that
            isn't a comment starts a new section.

        Lexing:

            Split section into a list of tokens (strings), with help
            of generator function tokenize().

        Parsing:

            Parse the first expression from the list of tokens, with
            parse(), throw away any remaining tokens.

            In parse_schema(): record value of an enum, union or
            struct key (if any) in the appropriate global table,
            append expression to the list of expressions.

    Return list of expressions.

Known issues:

(1) Indentation is significant, unlike in real JSON.

(2) Neither lexer nor parser have any idea of source positions.  Error
    reporting is hard, let's go shopping.

(3) The one error we bother to detect, we "report" via raise.

(4) The lexer silently ignores invalid characters.

(5) If everything in a section gets ignored, the parser crashes.

(6) The lexer treats a string containing a structural character exactly
    like the structural character.

(7) Tokens trailing the first expression in a section are silently
    ignored.

(8) The parser accepts any token in place of a colon.

(9) The parser treats comma as optional.

(10) parse() crashes on unexpected EOF.

(11) parse_schema() crashes when a section's expression isn't a JSON
    object.

Replace this piece of original art by a thoroughly unoriginal design.
Takes care of (1), (2), (5), (6) and (7), and lays the groundwork for
addressing the others.  Generated source files remain unchanged.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1374939721-7876-4-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotests: Use qapi-schema-test.json as schema parser test
Markus Armbruster [Sat, 27 Jul 2013 15:41:54 +0000 (17:41 +0200)]
tests: Use qapi-schema-test.json as schema parser test

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1374939721-7876-3-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotests: QAPI schema parser tests
Markus Armbruster [Sat, 27 Jul 2013 15:41:53 +0000 (17:41 +0200)]
tests: QAPI schema parser tests

The parser handles erroneous input badly.  To be improved shortly.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-id: 1374939721-7876-2-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomemory: add tracepoints for MMIO reads/writes
Paolo Bonzini [Sun, 28 Jul 2013 12:57:22 +0000 (14:57 +0200)]
memory: add tracepoints for MMIO reads/writes

This is quite handy to debug softmmu targets.

Reviewed-by: Andreas Faerber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1375016242-32651-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotpm.c: Don't try to put -1 in a variable of type TpmModel
Peter Maydell [Mon, 29 Jul 2013 11:22:11 +0000 (12:22 +0100)]
tpm.c: Don't try to put -1 in a variable of type TpmModel

The TpmModel type is an enum (valid values 0 and 1), which means
the compiler can legitimately decide that comparisons like
'tpm_models[i] == -1' are never true. (For example it could
pick 'unsigned char' as its type for representing the enum.)

Avoid this issue by using TPM_MODEL_MAX to mark entries in
the tpm_models[] array which aren't filled in, instead of -1.

This silences a clang warning:

 tpm.c:43:27: error: comparison of constant -1 with expression of type
      'enum TpmModel' is always false [-Werror,-Wtautological-constant-out-of-range-compare]
        if (tpm_models[i] == -1) {
            ~~~~~~~~~~~~~ ^  ~~

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375096931-13842-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agodevices: Associate devices to their logical category
Marcel Apfelbaum [Mon, 29 Jul 2013 14:17:45 +0000 (17:17 +0300)]
devices: Associate devices to their logical category

The category will be used to sort the devices displayed in
the command line help.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Message-id: 1375107465-25767-4-git-send-email-marcel.a@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-help: Sort devices by logical functionality
Marcel Apfelbaum [Mon, 29 Jul 2013 14:17:44 +0000 (17:17 +0300)]
qemu-help: Sort devices by logical functionality

Categorize devices that appear as output to "-device ?" command
by logical functionality. Sort the devices by logical categories
before showing them to user.

The sort is done by functionality rather than alphabetical.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Message-id: 1375107465-25767-3-git-send-email-marcel.a@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agohw: import bitmap operations in qdev-core header
Marcel Apfelbaum [Mon, 29 Jul 2013 14:17:43 +0000 (17:17 +0300)]
hw: import bitmap operations in qdev-core header

Made small tweaks in code to prevent compilation issues
when importing qemu/bitmap.h in qdev-core

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Message-id: 1375107465-25767-2-git-send-email-marcel.a@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agospapr-vscsi: fix SOLNT bit in SRP_RSP
Alexey Kardashevskiy [Mon, 29 Jul 2013 04:48:39 +0000 (14:48 +1000)]
spapr-vscsi: fix SOLNT bit in SRP_RSP

The driver calculates SOLNT bit from UCSOLNT and  SCSOLNT bits from
the request. The iu pointer has a type of srp_iu* which points to a union,
so cmd and rsp overlap. As the vscsi_send_rsp function calls
memset(iu, 0, sizeof(rsp)), it clears first 36 bytes of both cmd and rsp
so cmd.sol_not is always zero at the moment of calculating rsp.sol_not.

This fixes the bug.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Message-id: 1375073319-17488-1-git-send-email-aik@ozlabs.ru
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoxics: rename types to be sane and follow coding style
Anthony Liguori [Thu, 18 Jul 2013 19:33:04 +0000 (14:33 -0500)]
xics: rename types to be sane and follow coding style

    Basically, in HW the layout of the interrupt network is:

     - One ICP per processor thread (the "presenter"). This contains the
    registers to fetch a pending interrupt (ack), EOI, and control the
    processor priority.

     - One ICS per logical source of interrupts (ie, one per PCI host
    bridge, and a few others here or there). This contains the per-interrupt
    source configuration (target processor(s), priority, mask) and the
    per-interrupt internal state.

    Under PAPR, there is a single "virtual" ICS ... somewhat (it's a bit
    oddball what pHyp does here, arguably there are two but we can ignore
    that distinction). There is no register level access. A pair of firmware
    (RTAS) calls is used to configure each virtual interrupt.

    So our model here is somewhat the same. We have one ICS in the emulated
    XICS which arguably *is* the emulated XICS, there's no point making it a
    separate "device", that would just be gross, and each VCPU has an
    associated ICP.

Yet we call the "XICS" struct icp_state and then the ICPs
'struct icp_server_state'.  It's particularly confusing when all of the
functions have xics_prefixes yet take *icp arguments.

Rename:

  struct icp_state -> XICSState
  struct icp_server_state -> ICPState
  struct ics_state -> ICSState
  struct ics_irq_state -> ICSIRQState

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Message-id: 1374175984-8930-12-git-send-email-aliguori@us.ibm.com
[aik: added ics_resend() on post_load]
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopseries: savevm support with KVM
Alexey Kardashevskiy [Thu, 18 Jul 2013 19:33:03 +0000 (14:33 -0500)]
pseries: savevm support with KVM

At present, the savevm / migration support for the pseries machine will not
work when KVM is enabled.  That's because KVM manages the guest's hash page
table in the host kernel, so qemu has no visibility of it.  This patch
fixes this by using new kernel interfaces to extract and reinsert the
guest's hash table during the migration process.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Message-id: 1374175984-8930-11-git-send-email-aliguori@us.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopseries: savevm support for PCI host bridge
David Gibson [Thu, 18 Jul 2013 19:33:02 +0000 (14:33 -0500)]
pseries: savevm support for PCI host bridge

This adds the necessary support for saving the state of the PAPR virtual
PCI host bridge (or host bridges).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374175984-8930-10-git-send-email-aliguori@us.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopseries: savevm support for pseries machine
David Gibson [Thu, 18 Jul 2013 19:33:01 +0000 (14:33 -0500)]
pseries: savevm support for pseries machine

This adds the necessary pieces to implement savevm / migration for the
pseries machine.  The most complex part here is migrating the hash
table - for the paravirtualized pseries machine the guest's hash page
table is not stored within guest memory, but externally and the guest
accesses it via hypercalls.

This patch uses a hypervisor reserved bit of the HPTE as a dirty bit
(tracking changes to the HPTE itself, not the page it references).
This is used to implement a live migration style incremental save and
restore of the hash table contents.

Normally a hash table is 16MB but it can get bigger depending on how
much RAM the guest has. Due to its nature, updates to it are random so
the live migration style is used for it.

In addition it adds VMStateDescription information to save and restore
the (few) remaining pieces of state information needed by the pseries
machine.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374175984-8930-9-git-send-email-aliguori@us.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopseries: savevm support for PAPR virtual SCSI
David Gibson [Thu, 18 Jul 2013 19:33:00 +0000 (14:33 -0500)]
pseries: savevm support for PAPR virtual SCSI

This patch adds the necessary support for saving the state of the PAPR VIO
virtual SCSI device. This also saves and restores active SCSI requests.

[aik: implemented vscsi_req save/restore]
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Message-id: 1374175984-8930-8-git-send-email-aliguori@us.ibm.com
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopseries: rework PAPR virtual SCSI
Alexey Kardashevskiy [Thu, 18 Jul 2013 19:32:59 +0000 (14:32 -0500)]
pseries: rework PAPR virtual SCSI

The patch reimplements handling of indirect requests in order to
simplify upcoming live migration support.
- all pointers (except SCSIRequest*) were replaces with integer
indexes and offsets;
- DMA'ed srp_direct_buf kept untouched (ie. BE format);
- vscsi_fetch_desc() is added, now it is the only place where
descriptors are fetched and byteswapped;
- vscsi_req struct fields converted to migration-friendly types;
- many dprintf()'s fixed.

This also removed an unused field 'lun' from the spapr_vscsi device
which is assigned, but never used.  So, remove it.

[David Gibson: removed unused 'lun']
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Message-id: 1374175984-8930-7-git-send-email-aliguori@us.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agospapr-tce: make sPAPRTCETable a proper device
Anthony Liguori [Thu, 18 Jul 2013 19:32:58 +0000 (14:32 -0500)]
spapr-tce: make sPAPRTCETable a proper device

Model TCE tables as a device that's hooked up as a child object to
the owner.  Besides the code cleanup, we get a few nice benefits:

1) free actually works now (it was dead code before)

2) the TCE information is visible in the device tree

3) we can expose table information as properties such that if we
   change the window_size, we can use globals to keep migration
   working.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Message-id: 1374175984-8930-6-git-send-email-aliguori@us.ibm.com
[dwg: pseries: savevm support for PAPR TCE tables]
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
[alexey: ppc kvm: fix to compile]
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopseries: savevm support for PAPR VIO logical tty
David Gibson [Thu, 18 Jul 2013 19:32:57 +0000 (14:32 -0500)]
pseries: savevm support for PAPR VIO logical tty

This patch adds the necessary VMStateDescription information to support
savevm/loadvm for the spapr_tty (PAPR logical serial) device.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374175984-8930-5-git-send-email-aliguori@us.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopseries: savevm support for PAPR VIO logical lan
David Gibson [Thu, 18 Jul 2013 19:32:56 +0000 (14:32 -0500)]
pseries: savevm support for PAPR VIO logical lan

This patch adds the necessary VMStateDescription information to support
savevm/loadvm for the spapr_llan (PAPR logical lan) device.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374175984-8930-4-git-send-email-aliguori@us.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopseries: savevm support for VIO devices
David Gibson [Thu, 18 Jul 2013 19:32:55 +0000 (14:32 -0500)]
pseries: savevm support for VIO devices

This patch adds helpers to allow PAPR VIO devices to save state common
to all VIO devices during savevm.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374175984-8930-3-git-send-email-aliguori@us.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotarget-ppc: Convert ppc cpu savevm to VMStateDescription
Alexey Kardashevskiy [Thu, 18 Jul 2013 19:32:54 +0000 (14:32 -0500)]
target-ppc: Convert ppc cpu savevm to VMStateDescription

The savevm code for the powerpc cpu emulation is currently based around
the old register_savevm() rather than register_vmstate() method.  It's also
rather broken, missing some important state on some CPU models.

This patch completely rewrites the savevm for target-ppc, using the new
VMStateDescription approach.  Exactly what needs to be saved in what
configurations has been more carefully examined, too.  This introduces a
new version (5) of the cpu save format.  The old load function is retained
to support version 4 images.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Message-id: 1374175984-8930-2-git-send-email-aliguori@us.ibm.com
[aik: ppc cpu savevm convertion fixed to use PowerPCCPU instead of CPUPPCState]
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agodataplane: refuse to start if device is already in use
Stefan Hajnoczi [Mon, 29 Jul 2013 13:02:00 +0000 (15:02 +0200)]
dataplane: refuse to start if device is already in use

Dataplane must check whether a block device is in use before launching
the dataplane thread.  This is necessary since the thread does not
synchronize with the main loop and I/O requests could cause corruption.

One example is when a drive is added and a block job is started before
hotplugging the virtio-blk-pci adapter.  In this case we must not use
dataplane mode.

Cc: qemu-stable@nongnu.org
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agodataplane: enable virtio-blk x-data-plane=on live migration
Stefan Hajnoczi [Mon, 29 Jul 2013 13:01:59 +0000 (15:01 +0200)]
dataplane: enable virtio-blk x-data-plane=on live migration

Although the dataplane thread does not cooperate with dirty memory
logging yet it's fairly easy to temporarily disable dataplane during
live migration.  This way virtio-blk can live migrate when
x-data-plane=on.

The dataplane thread will restart after migration is cancelled or if the
guest resuming virtio-blk operation after migration completes.

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agomigration: fix spice migration
Stefan Hajnoczi [Mon, 29 Jul 2013 13:01:58 +0000 (15:01 +0200)]
migration: fix spice migration

Commit 29ae8a4133082e16970c9d4be09f4b6a15034617 ("rdma: introduce
MIG_STATE_NONE and change MIG_STATE_SETUP state transition") changed the
state transitions during migration setup.

Spice used to be notified with MIG_STATE_ACTIVE and it detected this
using migration_is_active().  Spice is now notified with
MIG_STATE_SETUP and migration_is_active() no longer works.

Replace migration_is_active() with migration_in_setup() to fix spice
migration.

Cc: Michael R. Hines <mrhines@us.ibm.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agomigration: notify migration state before starting thread
Stefan Hajnoczi [Mon, 29 Jul 2013 13:01:57 +0000 (15:01 +0200)]
migration: notify migration state before starting thread

The migration thread runs outside the QEMU global mutex when possible.
Therefore we must notify migration state change *before* starting the
migration thread.

This allows registered listeners to act before live migration iterations
begin.  Therefore they can get into a state that allows for live
migration.  When the migration thread starts everything will be ready.

Without this patch there is a race condition during migration setup,
depending on whether the migration thread has already transitioned from
SETUP to ACTIVE state.

Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoblock: Repair the throttling code.
Benoît Canet [Fri, 26 Jul 2013 20:39:22 +0000 (22:39 +0200)]
block: Repair the throttling code.

The throttling code was segfaulting since commit
02ffb504485f0920cfc75a0982a602f824a9a4f4 because some qemu_co_queue_next caller
does not run in a coroutine.
qemu_co_queue_do_restart assume that the caller is a coroutinne.
As suggested by Stefan fix this by entering the coroutine directly.
Also make sure like suggested that qemu_co_queue_next() and
qemu_co_queue_restart_all() can be called only in coroutines.

Signed-off-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agogluster: Add image resize support
Paolo Bonzini [Fri, 19 Jul 2013 14:21:33 +0000 (19:51 +0530)]
gluster: Add image resize support

Implement .bdrv_truncate in GlusterFS block driver so that GlusterFS backend
can support image resizing.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Tested-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agotarget-i386: Disable PMU CPUID leaf by default
Eduardo Habkost [Fri, 26 Jul 2013 20:09:36 +0000 (17:09 -0300)]
target-i386: Disable PMU CPUID leaf by default

Bug description: QEMU currently gets all bits from GET_SUPPORTED_CPUID
for CPUID leaf 0xA and passes them directly to the guest. This makes
the guest ABI depend on host kernel and host CPU capabilities, and
breaks live migration if we migrate between hosts with different
capabilities (e.g., different number of PMU counters).

Add a "pmu" property to X86CPU, and set it to true only on "-cpu host",
or on pc-*-1.5 and older machine-types.

For now, setting pmu=on will enable the current passthrough mode that
doesn't have any ABI stability guarantees, but in the future we may
implement a mode where the PMU CPUID bits are stable and configurable.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-i386: Pass X86CPU object to cpu_x86_find_by_name()
Eduardo Habkost [Fri, 26 Jul 2013 20:09:35 +0000 (17:09 -0300)]
target-i386: Pass X86CPU object to cpu_x86_find_by_name()

This will help us change the initialization code to not require carrying
some intermediate values in a x86_def_t struct (and eventually kill the
x86_def_t struct entirely).

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Partially revert "cpu: Change qemu_init_vcpu() argument to CPUState"
Andreas Färber [Sat, 27 Jul 2013 00:53:25 +0000 (02:53 +0200)]
cpu: Partially revert "cpu: Change qemu_init_vcpu() argument to CPUState"

Commit c643bed99 moved qemu_init_vcpu() calls to common CPUState code.
This causes x86 cpu-add to fail with "KVM: setting VAPIC address failed".

The reason for the failure is that CPUClass::kvm_fd is not yet
initialized in the following call graph:
->x86_cpu_realizefn
 ->x86_cpu_apic_realize
  ->qdev_init
   ->device_set_realized
    ->device_reset (hotplugged == 1)
     ->apic_reset_common
      ->vapic_base_update
       ->kvm_apic_vapic_base_update
This causes attempted KVM vCPU ioctls to fail.

By contrast, in the non-hotplug case the APIC is reset much later, when
the vCPU is already initialized.

As a quick and safe solution, move the qemu_init_vcpu() call back into
the targets' realize functions.

Reported-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Acked-by: Igor Mammedov <imammedo@redhat.com> (for i386)
Tested-by: Jia Liu <proljc@gmail.com> (for openrisc)
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoMerge remote-tracking branch 'sstabellini/xen-130729' into staging
Anthony Liguori [Mon, 29 Jul 2013 12:30:31 +0000 (07:30 -0500)]
Merge remote-tracking branch 'sstabellini/xen-130729' into staging

# By Paul Durrant (1) and Stefano Stabellini (1)
# Via Stefano Stabellini
* sstabellini/xen-130729:
  Xen PV Device
  xen_disk: support "direct-io-safe" backend option

Message-id: 1375096790-12815-1-git-send-email-stefano.stabellini@eu.citrix.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'agraf/s390-for-upstream' into staging
Anthony Liguori [Mon, 29 Jul 2013 12:30:21 +0000 (07:30 -0500)]
Merge remote-tracking branch 'agraf/s390-for-upstream' into staging

# By Alexander Graf (1) and others
# Via Alexander Graf
* agraf/s390-for-upstream:
  s390: update s390-ccw.img
  s390/ipl: Fix boot order
  s390/IPL: Allow boot from other ssid than 0

Message-id: 1375092324-23943-1-git-send-email-agraf@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'sweil/w32' into staging
Anthony Liguori [Mon, 29 Jul 2013 12:30:06 +0000 (07:30 -0500)]
Merge remote-tracking branch 'sweil/w32' into staging

# By Stefan Weil (10) and others
# Via Aurelien Jarno (1) and Stefan Weil (1)
* sweil/w32: (27 commits)
  w32, w64: Add build rule for installer
  target-mips: fix mipsdsp_mul_q31_q31
  mips_malta: fix copy of the 0x1fc00000 region
  linux-user: correct argument number for sys_mremap and sys_splice
  target-mips: Remove assignment to a variable which is never used
  target-mips: fix mipsdsp_trunc16_sat16_round
  hw/mips: align initrd to 64KB to avoid kernel error
  pflash_cfi01: duplicate status byte from bits 23:16 for 32bit reads
  mips_malta: generate SMBUS EEPROM data
  mips_malta: cap BIOS endian swap length at 0x3e0000 bytes
  mips_malta: generate SPD EEPROM data at runtime
  mips_malta: correct reading MIPS revision at 0x1fc00010
  mips_malta: fix BIOS endianness swapping
  mips_malta: QOM cast cleanup
  target-mips: fix branch in likely delay slot tcg assert
  target-mips: fix multiplication in mipsdsp_rndq15_mul_q15_q15
  target-mips: Remove assignment to a variable which is never used
  misc: Use g_assert_not_reached for code which is expected to be unreachable
  qemu-options: mention C-a h in the -nographic doc
  misc: Fix new typos in comments and strings
  ...

Message-id: 1374989579-24933-1-git-send-email-sw@weilnetz.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoXen PV Device
Paul Durrant [Mon, 29 Jul 2013 10:58:01 +0000 (10:58 +0000)]
Xen PV Device

Introduces a new Xen PV PCI device which will act as a binding point for
PV drivers for Xen.
The device has parameterized vendor-id, device-id and revision to allow to
be configured as a binding point for any vendor's PV drivers.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
11 years agoxen_disk: support "direct-io-safe" backend option
Stefano Stabellini [Mon, 29 Jul 2013 10:56:38 +0000 (10:56 +0000)]
xen_disk: support "direct-io-safe" backend option

Support backend option "direct-io-safe".  This is documented as
follows in the Xen backend specification:

 * direct-io-safe
 *      Values:         0/1 (boolean)
 *      Default Value:  0
 *
 *      The underlying storage is not affected by the direct IO memory
 *      lifetime bug.  See:
 *        http://lists.xen.org/archives/html/xen-devel/2012-12/msg01154.html
 *
 *      Therefore this option gives the backend permission to use
 *      O_DIRECT, notwithstanding that bug.
 *
 *      That is, if this option is enabled, use of O_DIRECT is safe,
 *      in circumstances where we would normally have avoided it as a
 *      workaround for that bug.  This option is not relevant for all
 *      backends, and even not necessarily supported for those for
 *      which it is relevant.  A backend which knows that it is not
 *      affected by the bug can ignore this option.
 *
 *      This option doesn't require a backend to use O_DIRECT, so it
 *      should not be used to try to control the caching behaviour.

Also, BDRV_O_NATIVE_AIO is ignored if BDRV_O_NOCACHE, so clarify the
default flags passed to the qemu block layer.

The original proposal for a "cache" backend option has been dropped
because it was believed too wide, especially considering that at the
moment the backend doesn't have a way to tell the toolstack that it is
capable of supporting it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
11 years agos390: update s390-ccw.img
Alexander Graf [Mon, 24 Jun 2013 12:56:51 +0000 (14:56 +0200)]
s390: update s390-ccw.img

This enables the following patches:

  s390/IPL: Allow boot from other ssid than 0
  s390/ipl: Fix spurious errors in virtio

Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agos390/ipl: Fix boot order
Christian Borntraeger [Tue, 18 Jun 2013 12:31:52 +0000 (14:31 +0200)]
s390/ipl: Fix boot order

The latest ipl code adaptions collided with some of the virtio
refactoring rework. This resulted in always booting the first
disk. Let's fix booting from a given ID.
The new code also checks for command lines without bootindex to
avoid random behaviour when accessing dev_st (==0).

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agos390/IPL: Allow boot from other ssid than 0
Dominik Dingel [Mon, 17 Jun 2013 12:29:42 +0000 (14:29 +0200)]
s390/IPL: Allow boot from other ssid than 0

We now take the subchannel set id also into account to find the boot device.
If we want to use a subchannel set other than the default set 0, we first
need to enable the mss facility.

Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agow32, w64: Add build rule for installer
Stefan Weil [Mon, 15 Jul 2013 21:49:57 +0000 (23:49 +0200)]
w32, w64: Add build rule for installer

The new rules in Makefile allow building installers for QEMU on Windows
using NSIS, a package which is also available for Linux distributions
(so cross builds are possible).

The rules for NSIS are in qemu.nsi which also uses two new images.

Signed-off-by: Stefan Weil <sw@weilnetz.de>