提交 a5e5996b 编写于 作者: J Ján Tomko

Mark the domain as active in qemuhotplugtest

This will allow us to call qemuDomainObjIsActive() in
the tested functions to check if the domain has crashed.
上级 dc2fd51f
...@@ -40,6 +40,8 @@ enum { ...@@ -40,6 +40,8 @@ enum {
UPDATE UPDATE
}; };
#define QEMU_HOTPLUG_TEST_DOMAIN_ID 7
struct qemuHotplugTestData { struct qemuHotplugTestData {
const char *domain_filename; const char *domain_filename;
const char *device_filename; const char *device_filename;
...@@ -90,6 +92,8 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt, ...@@ -90,6 +92,8 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
if (qemuAssignDeviceAliases((*vm)->def, priv->qemuCaps) < 0) if (qemuAssignDeviceAliases((*vm)->def, priv->qemuCaps) < 0)
goto cleanup; goto cleanup;
(*vm)->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID;
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
...@@ -177,9 +181,11 @@ testQemuHotplugCheckResult(virDomainObjPtr vm, ...@@ -177,9 +181,11 @@ testQemuHotplugCheckResult(virDomainObjPtr vm,
char *actual; char *actual;
int ret; int ret;
vm->def->id = -1;
actual = virDomainDefFormat(vm->def, VIR_DOMAIN_DEF_FORMAT_SECURE); actual = virDomainDefFormat(vm->def, VIR_DOMAIN_DEF_FORMAT_SECURE);
if (!actual) if (!actual)
return -1; return -1;
vm->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID;
if (STREQ(expected, actual)) { if (STREQ(expected, actual)) {
if (fail && virTestGetVerbose()) if (fail && virTestGetVerbose())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册