summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-10-04accel: Remove tcg_available() functionEduardo Habkost3-7/+0
As the function always return 1, it is not needed anymore. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04accel: Move qtest accel registration to qtest.cEduardo Habkost3-20/+26
As qtest_availble() returns 1 only when CONFIG_POSIX is set, keep setting AccelClass.available to keep current behavior (this is different from what we did for KVM and Xen). This also allows us to make qtest_init_accel() static. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04accel: Move Xen registration code to xen-common.cEduardo Habkost4-26/+24
Note that this has an user-visible side-effect: instead of reporting "Xen is not supported for this target", QEMU binaries not supporting Xen will report "xen accelerator does not exist". As xen_available() always return 1 when CONFIG_XEN is enabled, we don't need to set AccelClass.available anymore. xen_enabled() is not being removed yet, but only because vl.c is still using it. This also allows us to make xen_init() static. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04accel: Move KVM accel registration to kvm-all.cEduardo Habkost4-26/+25
Note that this has an user-visible side-effect: instead of reporting "KVM is not supported for this target", QEMU binaries not supporting KVM will report "kvm accelerator does not exist". As kvm_availble() always return 1 when CONFIG_KVM is enabled, we don't need to set AccelClass.available anymore. kvm_enabled() is not being completely removed yet only because qmp_query_kvm() still uses it. This also allows us to make kvm_init() static. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04accel: Report unknown accelerator as "not found" instead of "does not exist"Eduardo Habkost1-1/+1
As the accelerator classes won't be registered anymore if they are not enabled at compile time, saying "does not exist" may be misleading, as the accelerator may be simply disabled. Change the wording to just say "not found". Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04accel: Make AccelClass.available() optionalEduardo Habkost1-1/+1
When we move accel classes outside accel.c, the available() function won't be necessary anymore, because the classes will be registered only if the accelerator code is really enabled at build time. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04accel: Use QOM classes for accel typesEduardo Habkost2-24/+123
Instead of having a static AccelType array, register a class for each accelerator type, and use class name lookup to find accelerator information. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04accel: Move accel name lookup to separate functionEduardo Habkost1-24/+33
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04accel: Simplify configure_accelerator() using AccelType *acc variableEduardo Habkost1-8/+10
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04accel: Create AccelType typedefEduardo Habkost1-2/+4
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04accel: Move accel code to accel.cEduardo Habkost4-80/+147
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04vl.c: Small coding style fixEduardo Habkost1-1/+1
Just to make checkpatch.pl happy when moving the code. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04qemu-char: Print the remote and local addresses for a socketCorey Minyard1-9/+18
It seems that it might be a good idea to know what is at the remote end of a socket for tracking down issues. So add that to the socket filename. Signed-off-by: Corey Minyard <cminyard@mvista.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04qemu-char: Add reconnecting to client socketsCorey Minyard3-17/+96
Adds a "reconnect" option to socket backends that gives a reconnect timeout. This only applies to client sockets. If the other end of a socket closes the connection, qemu will attempt to reconnect after the given number of seconds. Signed-off-by: Corey Minyard <cminyard@mvista.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04qemu-char: set socket filename to disconnected when not connectedCorey Minyard1-38/+72
This way we can tell if the socket is connected or not. It also splits the string conversions out into separate functions to make this more convenient. Signed-off-by: Corey Minyard <cminyard@mvista.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04qemu-char: Move some items into TCPCharDriverCorey Minyard1-14/+51
This keeps them from having to be passed around and makes them available for later functions, like printing and reconnecting. Signed-off-by: Corey Minyard <cminyard@mvista.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04qemu-char: Rework qemu_chr_open_socket() for reconnectCorey Minyard1-50/+68
Move all socket configuration to qmp_chardev_open_socket(). qemu_chr_open_socket_fd() just opens the socket. This is getting ready for the reconnect code, which will call open_sock_fd() on a reconnect attempt. Signed-off-by: Corey Minyard <cminyard@mvista.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-04qemu-char: Make the filename size for a chardev a #defineCorey Minyard1-7/+9
Signed-off-by: Corey Minyard <cminyard@mvista.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell17-294/+755
This update brings dataplane to virtio-scsi (NOT yet 100% thread-safe, though, which makes it really, really experimental. It also brings asynchronous cancellation to the SCSI subsystem and implements it in virtio-scsi. This is a pretty important feature. Almost all the work here was done by Fam Zheng. I also included the virtio refcount fixes from Gonglei, because they had a small conflict with virtio-scsi dataplane. This pull request is using the new subkey 4E6B09D7. # gpg: Signature made Tue 30 Sep 2014 12:31:02 BST using RSA key ID 4E6B09D7 # gpg: Good signature from "Paolo Bonzini <pbonzini@redhat.com>" # gpg: aka "Paolo Bonzini <bonzini@gnu.org>" * remotes/bonzini/tags/for-upstream: (39 commits) block/iscsi: handle failure on malloc of the allocationmap util: introduce bitmap_try_new virtio-scsi: Handle TMF request cancellation asynchronously scsi: Introduce scsi_req_cancel_async scsi: Introduce scsi_req_cancel_complete scsi: Drop SCSIReqOps.cancel_io scsi: Unify request unref in scsi_req_cancel scsi-generic: Handle canceled request in scsi_command_complete scsi: Drop scsi_req_abort virtio-scsi: Process ".iothread" property virtio-scsi: Call bdrv_io_plug/bdrv_io_unplug in cmd request handling virtio-scsi: Batched prepare for cmd reqs virtio-scsi: Two stages processing of cmd request virtio-scsi: Add migration state notifier for dataplane code virtio-scsi: Hook up with dataplane virtio-scsi-dataplane: Code to run virtio-scsi on iothread virtio-scsi: Add VirtIOSCSIVring in VirtIOSCSIReq virtio-scsi: Add 'iothread' property to virtio-scsi virtio: add a wrapper for virtio-backend initialization virtio-9p: fix virtio-9p child refcount in transports ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-09-30Merge remote-tracking branch 'remotes/kraxel/tags/pull-audio-20140930-1' ↵Peter Maydell1-4/+4
into staging ac97: register reset via qom # gpg: Signature made Tue 30 Sep 2014 12:32:29 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-audio-20140930-1: ac97: register reset via qom Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-09-30Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell5-38/+34
pci, pc, virtio, misc bugfixes A bunch of bugfixes. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 29 Sep 2014 17:59:57 BST using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: vl: Adjust the place of calling mlockall to speedup VM's startup pc-dimm: Don't check dimm->node when there is non-NUMA config pci-hotplug-old: avoid losing error message Revert "virtio-pci: fix migration for pci bus master" loader: g_realloc(p, 0) frees and returns NULL, simplify Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-09-30block/iscsi: handle failure on malloc of the allocationmapPeter Lieven1-7/+12
Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30util: introduce bitmap_try_newPeter Lieven1-2/+11
regular bitmap_new simply aborts if the memory allocation fails. bitmap_try_new returns NULL on failure and allows for proper error handling. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-scsi: Handle TMF request cancellation asynchronouslyFam Zheng2-9/+64
For VIRTIO_SCSI_T_TMF_ABORT_TASK and VIRTIO_SCSI_T_TMF_ABORT_TASK_SET, use scsi_req_cancel_async to start the cancellation. Because each tmf command may cancel multiple requests, we need to use a counter to track the number of remaining requests we still need to wait for. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30scsi: Introduce scsi_req_cancel_asyncFam Zheng2-0/+29
Devices will call this function to start an asynchronous cancellation. The bus->info->cancel will be called after the request is canceled. Devices will probably need to track a separate TMF request that triggers this cancellation, and wait until the cancellation is done before completing it. So we store a notifier list in SCSIRequest and in scsi_req_cancel_complete we notify them. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30scsi: Introduce scsi_req_cancel_completeFam Zheng4-4/+20
Let the aio cb do the clean up and notification job after scsi_req_cancel, in preparation for asynchronous cancellation. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30scsi: Drop SCSIReqOps.cancel_ioFam Zheng4-30/+2
The only two implementations are identical to each other, with nothing specific to device: they only call bdrv_aio_cancel with the SCSIRequest.aiocb. Let's move it to scsi-bus. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30scsi: Unify request unref in scsi_req_cancelFam Zheng2-40/+10
Before, scsi_req_cancel will take ownership of the canceled request and unref it. We did this because we didn't know whether AIO CB will be called or not during the cancelling, so we set the io_canceled flag before calling it, and skip unref in the potentially called callbacks, which is not very nice. Now, bdrv_aio_cancel has a stricter contract that the completion callbacks are always called, so we can remove the checks of req->io_canceled and just unref it in callbacks. It will also make implementing asynchronous cancellation easier. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30scsi-generic: Handle canceled request in scsi_command_completeFam Zheng1-4/+6
Now that we always called the cb in bdrv_aio_cancel, let's make scsi-generic callbacks check io_canceled flag similarly to scsi-disk. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30scsi: Drop scsi_req_abortFam Zheng3-19/+10
The only user of this function is spapr_vscsi.c. We can convert to scsi_req_cancel plus adding a check in vscsi_request_cancelled. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> [Drop prototype. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30Merge remote-tracking branch 'remotes/rth/tags/tcg-next-201400729' into stagingPeter Maydell8-114/+225
tcg updates # gpg: Signature made Mon 29 Sep 2014 19:58:04 BST using RSA key ID 4DD0279B # gpg: Good signature from "Richard Henderson <rth7680@gmail.com>" # gpg: aka "Richard Henderson <rth@redhat.com>" # gpg: aka "Richard Henderson <rth@twiddle.net>" * remotes/rth/tags/tcg-next-201400729: tcg: Always enable TCGv type checking qemu/compiler: Define QEMU_ARTIFICIAL tcg-aarch64: Use 32-bit loads for qemu_ld_i32 tcg-sparc: Use UMULXHI instruction tcg-sparc: Rename ADDX/SUBX insns tcg-sparc: Use ADDXC in setcond_i64 tcg-sparc: Fix setcond_i32 uninitialized value tcg-sparc: Use ADDXC in addsub2_i64 tcg-sparc: Support addsub2_i64 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-09-30Merge remote-tracking branch ↵Peter Maydell16-145/+662
'remotes/pmaydell/tags/pull-target-arm-20140929' into staging target-arm: * more EL2/EL3 preparation work * don't handle c15_cpar changes via tb_flush() * fix some unused function warnings in ARM devices * build the GDB XML for 32 bit CPUs into qemu-*-aarch64 * implement guest breakpoint support # gpg: Signature made Mon 29 Sep 2014 19:25:37 BST using RSA key ID 14360CDE # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" * remotes/pmaydell/tags/pull-target-arm-20140929: target-arm: Add support for VIRQ and VFIQ target-arm: Add IRQ and FIQ routing to EL2 and 3 target-arm: A64: Emulate the SMC insn target-arm: Add a Hypervisor Trap exception type target-arm: A64: Emulate the HVC insn target-arm: A64: Correct updates to FAR and ESR on exceptions target-arm: Don't take interrupts targeting lower ELs target-arm: Break out exception masking to a separate func target-arm: A64: Refactor aarch64_cpu_do_interrupt target-arm: Add SCR_EL3 target-arm: Add HCR_EL2 target-arm: Don't handle c15_cpar changes via tb_flush() hw/input/tsc210x.c: Delete unused array tsc2101_rates hw/display/pxa2xx_lcd.c: Remove unused function pxa2xx_dma_rdst_set hw/intc/imx_avic.c: Remove unused function imx_avic_set_prio() hw/display/blizzard.c: Delete unused function blizzard_rgb2yuv configure: Build GDB XML for 32 bit ARM CPUs into qemu aarch64 binaries target-arm: Implement handling of breakpoint firing target-arm: Implement setting guest breakpoints Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-09-30virtio-scsi: Process ".iothread" propertyFam Zheng1-0/+4
We are ready, now let's effectively enable dataplane. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-scsi: Call bdrv_io_plug/bdrv_io_unplug in cmd request handlingFam Zheng1-0/+4
Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-scsi: Batched prepare for cmd reqsFam Zheng3-4/+18
Queue the popped requests while calling virtio_scsi_handle_cmd_req_prepare(), then submit them after all prepared. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-scsi: Two stages processing of cmd requestFam Zheng3-10/+17
Mechanical change, in preparation for bdrv_io_plug/bdrv_io_unplug. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-scsi: Add migration state notifier for dataplane codeFam Zheng2-3/+34
Similar to virtio-blk-dataplane, we stop the iothread while migration starts and restart it when migration finishes. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-scsi: Hook up with dataplaneFam Zheng1-4/+48
This enables the virtio-scsi-dataplane code by setting the iothread in virtio-scsi device, and makes any function that is called by back from dataplane to cooperate with the caller: they need to be vring/iothread aware when handling the requests and using scsi devices on the bus. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-scsi-dataplane: Code to run virtio-scsi on iothreadFam Zheng3-1/+242
This implements the core part of dataplane feature of virtio-scsi. A few fields are added in VirtIOSCSICommon to maintain the dataplane status. These fields are managed by a new source file: virtio-scsi-dataplane.c. Most code in this file will run on an iothread, unless otherwise commented as in a global mutex context, such as those functions to start, stop and setting the iothread property. Upon start, we set up guest/host event notifiers, in a same way as virtio-blk does. The handlers then pop request from vring and call into virtio-scsi.c functions to process it. So we need to make sure make all those called functions work with iothread, too. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-scsi: Add VirtIOSCSIVring in VirtIOSCSIReqFam Zheng1-1/+14
Move VirtIOSCSIReq to header and add one field "vring" as a wrapper structure of Vring, VirtIOSCSIVring. This is necessary for coming dataplane code that runs uses vring on iothread. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-scsi: Add 'iothread' property to virtio-scsiFam Zheng4-0/+16
Similar to this property in virtio-blk for dataplane, add it as a QOM link in virtio-scsi and an alias in virtio-scsi-pci and virtio-scsi-ccw, in order to assign an iothread to the device. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio: add a wrapper for virtio-backend initializationGonglei5-76/+71
For better code sharing, add a helper function that handles reference counting of the virtio backend for virtio proxy devices. Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-9p: fix virtio-9p child refcount in transportsGonglei1-0/+1
object_initialize() leaves the object with a refcount of 1. object_property_add_child() adds its own reference which is dropped again when the property is deleted. The upshot of this is that we always have a refcount >= 1. Upon unplug the virtio-9p child is not finalized! Drop our reference after the child property has been added to the parent. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-9p: use aliases instead of duplicate qdev propertiesGonglei1-1/+1
virtio-9p-pci all duplicate the qdev properties of their V9fsState child. This approach does not work well with string or pointer properties since we must be careful about leaking or double-freeing them. Use the QOM alias property to forward property accesses to the V9fsState child. This way no duplication is necessary. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-balloon: fix virtio-balloon child refcount in transportsGonglei2-2/+2
object_initialize() leaves the object with a refcount of 1. object_property_add_child() adds its own reference which is dropped again when the property is deleted. The upshot of this is that we always have a refcount >= 1. Upon hot unplug the virtio-balloon child is not finalized! Drop our reference after the child property has been added to the parent. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-rng: fix virtio-rng child refcount in transportsGonglei3-0/+3
object_initialize() leaves the object with a refcount of 1. object_property_add_child() adds its own reference which is dropped again when the property is deleted. The upshot of this is that we always have a refcount >= 1. Upon hot unplug the virtio-rng child is not finalized! Drop our reference after the child property has been added to the parent. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-rng: use aliases instead of duplicate qdev propertiesGonglei3-3/+3
virtio-rng-{pci, s390, ccw} all duplicate the qdev properties of their VirtIORNG child. This approach does not work well with string or pointer properties since we must be careful about leaking or double-freeing them. Use the QOM alias property to forward property accesses to the VirtIORNG child. This way no duplication is necessary. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-serial: fix virtio-serial child refcount in transportsGonglei3-0/+3
object_initialize() leaves the object with a refcount of 1. object_property_add_child() adds its own reference which is dropped again when the property is deleted. The upshot of this is that we always have a refcount >= 1. Upon hot unplug the virtio-serial child is not finalized! Drop our reference after the child property has been added to the parent. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio-serial: use aliases instead of duplicate qdev propertiesGonglei3-3/+3
virtio-serial-{pci, s390, ccw} all duplicate the qdev properties of their VirtIOSerial child. This approach does not work well with string or pointer properties since we must be careful about leaking or double-freeing them. Use the QOM alias property to forward property accesses to the VirtIOSerial child. This way no duplication is necessary. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-30virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in transportsGonglei3-0/+6
object_initialize() leaves the object with a refcount of 1. object_property_add_child() adds its own reference which is dropped again when the property is deleted. The upshot of this is that we always have a refcount >= 1. Upon hot unplug the virtio-scsi/vhost-scsi child is not finalized! Drop our reference after the child property has been added to the parent. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>