9119d9
From 7f3f658cf0370f13c8197e2889113196415e32de Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <7f3f658cf0370f13c8197e2889113196415e32de@dist-git>
9119d9
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
9119d9
Date: Mon, 19 Jan 2015 10:48:28 +0100
9119d9
Subject: [PATCH] Mark the domain as active in qemuhotplugtest
9119d9
MIME-Version: 1.0
9119d9
Content-Type: text/plain; charset=UTF-8
9119d9
Content-Transfer-Encoding: 8bit
9119d9
9119d9
https://bugzilla.redhat.com/show_bug.cgi?id=1161024
9119d9
9119d9
This will allow us to call qemuDomainObjIsActive() in
9119d9
the tested functions to check if the domain has crashed.
9119d9
9119d9
(cherry picked from commit a5e5996b91129130863be8b5608d47d0ef01e326)
9119d9
Signed-off-by: Ján Tomko <jtomko@redhat.com>
9119d9
9119d9
Conflicts:
9119d9
  tests/qemuhotplugtest.c - 0ecd685 not backported
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 tests/qemuhotplugtest.c | 6 ++++++
9119d9
 1 file changed, 6 insertions(+)
9119d9
9119d9
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
9119d9
index 1077013..ae8a8a9 100644
9119d9
--- a/tests/qemuhotplugtest.c
9119d9
+++ b/tests/qemuhotplugtest.c
9119d9
@@ -40,6 +40,8 @@ enum {
9119d9
     UPDATE
9119d9
 };
9119d9
 
9119d9
+#define QEMU_HOTPLUG_TEST_DOMAIN_ID 7
9119d9
+
9119d9
 struct qemuHotplugTestData {
9119d9
     const char *domain_filename;
9119d9
     const char *device_filename;
9119d9
@@ -90,6 +92,8 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
9119d9
     if (qemuAssignDeviceAliases((*vm)->def, priv->qemuCaps) < 0)
9119d9
         goto cleanup;
9119d9
 
9119d9
+    (*vm)->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID;
9119d9
+
9119d9
     ret = 0;
9119d9
  cleanup:
9119d9
     return ret;
9119d9
@@ -177,9 +181,11 @@ testQemuHotplugCheckResult(virDomainObjPtr vm,
9119d9
     char *actual;
9119d9
     int ret;
9119d9
 
9119d9
+    vm->def->id = -1;
9119d9
     actual = virDomainDefFormat(vm->def, VIR_DOMAIN_XML_SECURE);
9119d9
     if (!actual)
9119d9
         return -1;
9119d9
+    vm->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID;
9119d9
 
9119d9
     if (STREQ(expected, actual)) {
9119d9
         if (fail && virTestGetVerbose())
9119d9
-- 
9119d9
2.2.1
9119d9