Move sending 'device_del' command to separate function.
Function can be used in case of addition action is needed to start
actual removing device after sending command.
Signed-off-by: Michael Labiuk <michael.labiuk@virtuozzo.com>
---
tests/qtest/device-plug-test.c | 15 ++-------------
tests/qtest/drive_del-test.c | 6 +-----
tests/qtest/libqos/pci-pc.c | 8 +-------
tests/qtest/libqtest.c | 16 ++++++++++------
tests/qtest/libqtest.h | 10 ++++++++++
5 files changed, 24 insertions(+), 31 deletions(-)
diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h
index 3abc75964d..29ea9c697d 100644
--- a/tests/qtest/libqtest.h
+++ b/tests/qtest/libqtest.h
@@ -761,12 +761,22 @@ void qtest_qmp_device_add(QTestState *qts, const char
*driver, const char *id,
void qtest_qmp_add_client(QTestState *qts, const char *protocol, int fd);
#endif /* _WIN32 */
+/**
+ * qtest_qmp_device_del_send:
+ * @qts: QTestState instance to operate on
+ * @id: Identification string
+ *
+ * Generic hot-unplugging test via the device_del QMP command.
+ */
+void qtest_qmp_device_del_send(QTestState *qts, const char *id);
+
/**
* qtest_qmp_device_del:
* @qts: QTestState instance to operate on
* @id: Identification string
*
* Generic hot-unplugging test via the device_del QMP command.
+ * Waiting for command comlition event.