]> git.proxmox.com Git - mirror_qemu.git/commit - tests/qtest/libqtest.c
tests: Introduce generic device hot-plug/hot-unplug functions
authorThomas Huth <thuth@redhat.com>
Tue, 15 Aug 2017 06:58:54 +0000 (08:58 +0200)
committerThomas Huth <thuth@redhat.com>
Fri, 15 Sep 2017 07:05:18 +0000 (09:05 +0200)
commitacd80015fbe28f4f513e036ad1db2a76738d1f53
treeeb1db46ee8961cffdda43c21958bb4540a65c2d8
parent3dabde1128b671f36ac6cb36b97b273139964420
tests: Introduce generic device hot-plug/hot-unplug functions

A lot of tests provide code for adding and removing a device via the
device_add and device_del QMP commands. Maintaining this code in so many
places is cumbersome and error-prone (some of the code parts check the
responses for device deletion in an incorrect way, for example, we've got
to deal with both, error code and DEVICE_DEL event here). So let's provide
some proper generic functions for adding and removing a device instead.

The code for correctly unplugging a device has been taken from a patch
from Peter Xu.

Reviewed-by: Peter Xu <peterx@redhat.com>
Tested-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/libqos/pci.c
tests/libqos/usb.c
tests/libqtest.c
tests/libqtest.h
tests/usb-hcd-uhci-test.c
tests/usb-hcd-xhci-test.c
tests/virtio-scsi-test.c
tests/virtio-serial-test.c