• T
    tests: Introduce generic device hot-plug/hot-unplug functions · acd80015
    Thomas Huth 提交于
    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: NPeter Xu <peterx@redhat.com>
    Tested-by: NPeter Xu <peterx@redhat.com>
    Signed-off-by: NThomas Huth <thuth@redhat.com>
    acd80015
virtio-scsi-test.c 7.2 KB