summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-10-16Merge remote-tracking branch 'remotes/kraxel/tags/pull-bootindex-20141015-1' ↵Peter Maydell36-166/+690
into staging allow changing bootorder via monitor at runtime, by making bootindex a writable qom property. * remotes/kraxel/tags/pull-bootindex-20141015-1: (34 commits) bootindex: change fprintf to error_report bootindex: delete bootindex when device is removed bootindex: move calling add_boot_device_patch to bootindex setter function ide: add calling add_boot_device_patch in bootindex setter function nvma: ide: add bootindex to qom property usb-storage: add bootindex to qom property virtio-blk: alias bootindex property explicitly for virt-blk-pci/ccw/s390 block: remove bootindex property from qdev to qom virtio-blk: add bootindex to qom property ide: add bootindex to qom property scsi: add bootindex to qom property isa-fdc: remove bootindexA/B property from qdev to qom redirect: remove bootindex property from qdev to qom vfio: remove bootindex property from qdev to qom pci-assign: remove bootindex property from qdev to qom host-libusb: remove bootindex property from qdev to qom virtio-net: alias bootindex property explicitly for virt-net-pci/ccw/s390 net: remove bootindex property from qdev to qom usb-net: add bootindex to qom property vmxnet3: add bootindex to qom property ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-10-15glib: add compatibility interface for g_get_monotonic_time()Stefan Hajnoczi3-22/+21
This patch fixes compilation errors when building against glib <2.28.0 due to the missing g_get_monotonic_time() function. The compilation error in tests/libqos/virtio.c was introduced in commit 70556264a89a268efba1d7e8e341adcdd7881eb4 ("libqos: use microseconds instead of iterations for virtio timeout"). Add a simple g_get_monotonic_time() implementation to glib-compat.h based on code from vhost-user-test.c. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> [Igor: add G_TIME_SPAN_SECOND, include glib-compat.h in libqtest.h] Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-10-15Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20141015' ↵Peter Maydell14-450/+1029
into staging migration/next for 20141015 # gpg: Signature made Wed 15 Oct 2014 09:21:54 BST using RSA key ID 5872D723 # gpg: Can't check signature: public key not found * remotes/juanquintela/tags/migration/20141015: migration: catch unknown flag combinations in ram_load qemu-file: Move stdio implementation to qemu-file-stdio.c qemu-file: Move unix and socket implementations to qemu-file-unix.c qemu-file: Use qemu_file_is_writable() on stdio_fclose() qemu-file: Make qemu_file_is_writable() non-static qemu-file: Add copyright header to qemu-file.c vmstate: Allow dynamic allocation for VBUFFER during migration block/migration: Disable cache invalidate for incoming migration Tests: QEMUSizedBuffer/QEMUBuffer QEMUSizedBuffer based QEMUFile Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-10-15bootindex: change fprintf to error_reportGonglei1-1/+2
The function may be called by qmp command, we should report error message to the caller. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootindex: delete bootindex when device is removedGonglei1-0/+2
Device should be removed from global boot list when it is hot-unplugged. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootindex: move calling add_boot_device_patch to bootindex setter functionGonglei18-32/+2
On this way, we can assure the new bootindex take effect during vm rebooting. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15ide: add calling add_boot_device_patch in bootindex setter functionGonglei1-0/+5
On this way, we can assure the new bootindex take effect during vm rebooting. Meanwhile set the initial value of bootindex to -1. Because ide devcies's unit property maybe do not initialize when set_bootindex function is called, so that we don't know its suffix. So we have to save the call add_boot_device_path() on ide realize/init function. When we want to change bootindex during vm rebooting, we can call it in setter function. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15nvma: ide: add bootindex to qom propertyGonglei1-0/+44
At present, nvma cannot boot. However, it provides already a bootindex property, so change bootindex to qom for nvma device, but not call add_boot_device_path. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15usb-storage: add bootindex to qom propertyGonglei1-0/+52
Add a qom property with the same name 'bootindex', when we remove it form qdev property, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Because usb-storage rely on scsi-disk which is created in usb_msg_realize_storage(), so we should store the SCSIDevice pointer in MSDState struct. Only in this way, we can change the global boot_order_list when we want to change the bootindex during vm rebooting by calling object_property_set_int(Object(SCSIDevice),). Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15virtio-blk: alias bootindex property explicitly for virt-blk-pci/ccw/s390Gonglei3-0/+6
Since the "bootindex" property is a QOM property and not a qdev property now, we must alias it explicitly for virtio-blk-pci, as well as CCW and s390-virtio. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15block: remove bootindex property from qdev to qomGonglei4-4/+2
Remove bootindex form qdev property to qom, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15virtio-blk: add bootindex to qom propertyGonglei1-0/+3
Add a qom property with the same name 'bootindex', when we remove it form qdev property, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15ide: add bootindex to qom propertyGonglei1-0/+42
Add a qom property with the same name 'bootindex', when we remove it form qdev property, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15scsi: add bootindex to qom propertyGonglei1-0/+11
Add a qom property with the same name 'bootindex', when we remove it form qdev property, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15isa-fdc: remove bootindexA/B property from qdev to qomGonglei1-2/+13
Remove bootindexA/B form qdev property to qom, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15redirect: remove bootindex property from qdev to qomGonglei1-1/+11
Remove bootindex form qdev property to qom, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15vfio: remove bootindex property from qdev to qomGonglei1-1/+11
Remove bootindex form qdev property to qom, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15pci-assign: remove bootindex property from qdev to qomGonglei1-1/+11
Remove bootindex form qdev property to qom, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15host-libusb: remove bootindex property from qdev to qomGonglei1-1/+11
Remove bootindex form qdev property to qom, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15virtio-net: alias bootindex property explicitly for virt-net-pci/ccw/s390Gonglei3-0/+6
Since the "bootindex" property is a QOM property and not a qdev property now, we must alias it explicitly for virtio-net-pci, as well as CCW and s390-virtio. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15net: remove bootindex property from qdev to qomGonglei1-2/+1
Remove bootindex form qdev property to qom, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15usb-net: add bootindex to qom propertyGonglei1-0/+11
Add a qom property with the same name 'bootindex', when we remove it form qdev property, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15vmxnet3: add bootindex to qom propertyGonglei1-0/+8
Add a qom property with the same name 'bootindex', when we remove it form qdev property, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15spapr_lian: add bootindex to qom propertyGonglei1-0/+10
Add a qom property with the same name 'bootindex', when we remove it form qdev property, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15rtl8139: add bootindex to qom propertyGonglei1-0/+10
Add a qom property with the same name 'bootindex', when we remove it form qdev property, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15pcnet: add bootindex to qom propertyGonglei3-1/+24
Add a qom property with the same name 'bootindex', when we remove it form qdev property, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15ne2000: add bootindex to qom propertyGonglei2-0/+56
Add a qom property with the same name 'bootindex', when we remove it form qdev property, things will continue to work just fine, and we can use qom features which are not supported by qdev property. At present, isa_ne2000 device does not support to boot os, so we register two seprate qom getter/setter functions. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15eepro100: add bootindex to qom propertyGonglei1-1/+10
Add a qom property with the same name 'bootindex', when we remove it form qdev property, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15e1000: add bootindex to qom propertyGonglei1-0/+10
Add a qom property with the same name 'bootindex', when we remove it form qdev property, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15virtio-net: add bootindex to qom propertyGonglei1-0/+3
Add a qom property with the same name 'bootindex', when we remove it form qdev property, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootindex: add a setter/getter functions wrapper for bootindex propertyGonglei2-0/+76
when we remove bootindex form qdev.property to qom.property, we can use those functions set/get bootindex property for all correlative devices. Meanwhile set the initial value of bootindex to -1. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootindex: support to set a existent device's bootindex to -1Gonglei1-0/+1
When set a device's bootindex to -1, we remove it from global fw_boot_order list. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootindex: rework add_boot_device_path functionGonglei1-0/+2
Add the function of updating bootindex about fw_boot_order list in add_boot_device_path(). We should delete the old one if a device has existed in global fw_boot_order list. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15fw_cfg: add fw_cfg_machine_reset functionGonglei2-3/+54
We must assure that the changed bootindex can take effect when guest is rebooted. So we introduce fw_cfg_machine_reset(), which change the fw_cfg file's bootindex data using the new global fw_boot_order list. Signed-off-by: Chenliang <chenliang88@huawei.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootindex: add del_boot_device_path functionGonglei2-0/+21
Introduce del_boot_device_path() to clean up fw_cfg content when hot-unplugging a device that refers to a bootindex or update a existent devcie's bootindex. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Chenliang <chenliang88@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootindex: add check bootindex functionGonglei2-0/+16
Determine whether a given bootindex exists or not. If exists, we report an error. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootdevice: move bootdevice related code to new file bootdevice.cGonglei4-118/+145
Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' ↵Peter Maydell50-225/+744
into staging QOM infrastructure fixes and device conversions * GPIO conversion to QOM, continued * Device property description support * QTest cases for hotplug * Hotplug handler conversion # gpg: Signature made Wed 15 Oct 2014 04:05:17 BST using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/qom-devices-for-peter: (47 commits) qdev: Drop legacy_name from qdev properties qmp: Print descriptions of object properties qdev: Set the object property's description to the qdev property's. qom: Add description field in ObjectProperty struct qdev: Add description field in PropertyInfo struct qdev: device_del: Search for to be unplugged device in 'peripheral' container qdev: HotplugHandler: Add support for unplugging BUS-less devices qdev: Drop legacy hotplug fields/methods usb: Convert usb devices to hotplug handler API usb: Convert usb-ccid to hotplug handler API usb-storage: Drop not needed "allow_hotplug = 0" usb-bot: Drop not needed "allow_hotplug = 0" usb-bot: Mark device as non hotpluggable scsi: Cleanup not used anymore SCSIBusInfo{hotplug, hot_unplug} fields scsi: Convert virtio-scsi HBA to hotplug handler API scsi: Convert pvscsi HBA to hotplug handler API scsi: Set SCSI BUS itself as default HotplugHandler s390x: Convert virtio-ccw to hotplug handler API s390x: Convert s390-virtio to hotplug handler API s390x: Drop not used allow_hotplug in event-facility ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-10-15qdev: Drop legacy_name from qdev propertiesGonglei4-12/+0
The legacy_name is useless now, better help information is provided by description field of property. Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-10-15qmp: Print descriptions of object propertiesGonglei3-5/+19
Add a new "description" field to DevicePropertyInfo. The descriptions can serve as documentation in the code, and they can be used to provide better help. For example: $./qemu-system-x86_64 -device virtio-blk-pci,? Before this patch: virtio-blk-pci.iothread=link<iothread> virtio-blk-pci.x-data-plane=bool virtio-blk-pci.scsi=bool virtio-blk-pci.config-wce=bool virtio-blk-pci.serial=str virtio-blk-pci.secs=uint32 virtio-blk-pci.heads=uint32 virtio-blk-pci.cyls=uint32 virtio-blk-pci.discard_granularity=uint32 virtio-blk-pci.bootindex=int32 virtio-blk-pci.opt_io_size=uint32 virtio-blk-pci.min_io_size=uint16 virtio-blk-pci.physical_block_size=uint16 virtio-blk-pci.logical_block_size=uint16 virtio-blk-pci.drive=str virtio-blk-pci.virtio-backend=child<virtio-blk-device> virtio-blk-pci.command_serr_enable=on/off virtio-blk-pci.multifunction=on/off virtio-blk-pci.rombar=uint32 virtio-blk-pci.romfile=str virtio-blk-pci.addr=pci-devfn virtio-blk-pci.event_idx=on/off virtio-blk-pci.indirect_desc=on/off virtio-blk-pci.vectors=uint32 virtio-blk-pci.ioeventfd=on/off virtio-blk-pci.class=uint32 After: virtio-blk-pci.iothread=link<iothread> virtio-blk-pci.x-data-plane=bool (on/off) virtio-blk-pci.scsi=bool (on/off) virtio-blk-pci.config-wce=bool (on/off) virtio-blk-pci.serial=str virtio-blk-pci.secs=uint32 virtio-blk-pci.heads=uint32 virtio-blk-pci.cyls=uint32 virtio-blk-pci.discard_granularity=uint32 virtio-blk-pci.bootindex=int32 virtio-blk-pci.opt_io_size=uint32 virtio-blk-pci.min_io_size=uint16 virtio-blk-pci.physical_block_size=uint16 (A power of two between 512 and 32768) virtio-blk-pci.logical_block_size=uint16 (A power of two between 512 and 32768) virtio-blk-pci.drive=str (ID of a drive to use as a backend) virtio-blk-pci.virtio-backend=child<virtio-blk-device> virtio-blk-pci.command_serr_enable=bool (on/off) virtio-blk-pci.multifunction=bool (on/off) virtio-blk-pci.rombar=uint32 virtio-blk-pci.romfile=str virtio-blk-pci.addr=int32 (Slot and optional function number, example: 06.0 or 06) virtio-blk-pci.event_idx=bool (on/off) virtio-blk-pci.indirect_desc=bool (on/off) virtio-blk-pci.vectors=uint32 virtio-blk-pci.ioeventfd=bool (on/off) virtio-blk-pci.class=uint32 Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-10-15qdev: Set the object property's description to the qdev property's.Gonglei1-0/+5
Set all static qdev properties' descriptions to object property's description. Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-10-15qom: Add description field in ObjectProperty structGonglei2-0/+34
The descriptions can serve as documentation in the code, and they can be used to provide better help. Copy property descriptions when copying alias properties. Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-10-15qdev: Add description field in PropertyInfo structGonglei4-0/+14
The descriptions can serve as documentation in the code, and they can be used to provide better help. Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-10-15qdev: device_del: Search for to be unplugged device in 'peripheral' containerIgor Mammedov1-4/+9
device_add puts every device with 'id' inside of 'peripheral' container using id's value as the last component name. Use it by replacing recursive search on sysbus with path lookup in 'peripheral' container, which could handle both BUS and BUS-less device cases. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-10-15qdev: HotplugHandler: Add support for unplugging BUS-less devicesIgor Mammedov1-27/+34
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-10-15qdev: Drop legacy hotplug fields/methodsIgor Mammedov2-17/+4
It removes not needed anymore BusState::allow_hotplug field and DeviceClass::unplug callback. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-10-15usb: Convert usb devices to hotplug handler APIIgor Mammedov1-2/+7
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-10-15usb: Convert usb-ccid to hotplug handler APIIgor Mammedov1-1/+7
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-10-15usb-storage: Drop not needed "allow_hotplug = 0"Igor Mammedov1-1/+0
Drop useless hack that disables hotplug on bus, after backend storage was added to it, by setting "allow_hotplug = 0". Even if bus is hotpluggable, it won't be possible to add another SCSI device to bus since its realize will fail early with error "no free target" in scsi_qdev_realize() method. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-10-15usb-bot: Drop not needed "allow_hotplug = 0"Igor Mammedov1-1/+0
Drop useless hack that disables hotplug on bus by setting "allow_hotplug = 0". Even if bus is hotpluggable, It won't be possible to add another SCSI device to bus since its realization will fail early with error "no free target" in scsi_qdev_realize() method. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>