[PATCHv2 02/14] Mark the domain as active in qemuhotplugtest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This will allow us to call qemuDomainObjIsActive() in
the tested functions to check if the domain has crashed.
---
 tests/qemuhotplugtest.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 9d39968..f0517a1 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -40,6 +40,8 @@ enum {
     UPDATE
 };
 
+#define QEMU_HOTPLUG_TEST_DOMAIN_ID 7
+
 struct qemuHotplugTestData {
     const char *domain_filename;
     const char *device_filename;
@@ -90,6 +92,8 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
     if (qemuAssignDeviceAliases((*vm)->def, priv->qemuCaps) < 0)
         goto cleanup;
 
+    (*vm)->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID;
+
     ret = 0;
  cleanup:
     return ret;
@@ -177,9 +181,11 @@ testQemuHotplugCheckResult(virDomainObjPtr vm,
     char *actual;
     int ret;
 
+    vm->def->id = -1;
     actual = virDomainDefFormat(vm->def, VIR_DOMAIN_XML_SECURE);
     if (!actual)
         return -1;
+    vm->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID;
 
     if (STREQ(expected, actual)) {
         if (fail && virTestGetVerbose())
-- 
2.0.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]