}
-static void
+void
qemuDomainObjPrivateXMLFormatAllowReboot(virBufferPtr buf,
virTristateBool allowReboot)
{
}
-static int
+int
qemuDomainObjPrivateXMLParseAllowReboot(xmlXPathContextPtr ctxt,
virTristateBool *allowReboot)
{
char *
qemuDomainGetMachineName(virDomainObjPtr vm);
+void
+qemuDomainObjPrivateXMLFormatAllowReboot(virBufferPtr buf,
+ virTristateBool allowReboot);
+
+int
+qemuDomainObjPrivateXMLParseAllowReboot(xmlXPathContextPtr ctxt,
+ virTristateBool *allowReboot);
+
#endif /* __QEMU_DOMAIN_H__ */
if (priv->origCPU)
cookieFlags |= QEMU_MIGRATION_COOKIE_CPU;
+ cookieFlags |= QEMU_MIGRATION_COOKIE_ALLOW_REBOOT;
+
if (!(mig = qemuMigrationEatCookie(driver, vm, NULL, 0, 0)))
goto cleanup;
QEMU_MIGRATION_COOKIE_NBD |
QEMU_MIGRATION_COOKIE_MEMORY_HOTPLUG |
QEMU_MIGRATION_COOKIE_CPU_HOTPLUG |
- QEMU_MIGRATION_COOKIE_CPU)))
+ QEMU_MIGRATION_COOKIE_CPU |
+ QEMU_MIGRATION_COOKIE_ALLOW_REBOOT)))
goto cleanup;
if (STREQ_NULLABLE(protocol, "rdma") &&
goto stopjob;
stopProcess = true;
+ priv->allowReboot = mig->allowReboot;
+
if (!(incoming = qemuMigrationPrepareIncoming(vm, tunnel, protocol,
listenAddress, port,
dataFD[0])))
"statistics",
"memory-hotplug",
"cpu-hotplug",
- "cpu");
+ "cpu",
+ "allowReboot");
static void
}
+static void
+qemuMigrationCookieAddAllowReboot(qemuMigrationCookiePtr mig,
+ virDomainObjPtr vm)
+{
+ qemuDomainObjPrivatePtr priv = vm->privateData;
+
+ mig->allowReboot = priv->allowReboot;
+
+ mig->flags |= QEMU_MIGRATION_COOKIE_ALLOW_REBOOT;
+}
+
+
static void
qemuMigrationCookieGraphicsXMLFormat(virBufferPtr buf,
qemuMigrationCookieGraphicsPtr grap)
if (mig->flags & QEMU_MIGRATION_COOKIE_CPU && mig->cpu)
virCPUDefFormatBufFull(buf, mig->cpu, NULL);
+ if (mig->flags & QEMU_MIGRATION_COOKIE_ALLOW_REBOOT)
+ qemuDomainObjPrivateXMLFormatAllowReboot(buf, mig->allowReboot);
+
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</qemu-migration>\n");
return 0;
virCPUDefParseXML(ctxt, "./cpu[1]", VIR_CPU_TYPE_GUEST, &mig->cpu) < 0)
goto error;
+ if (flags & QEMU_MIGRATION_COOKIE_ALLOW_REBOOT &&
+ qemuDomainObjPrivateXMLParseAllowReboot(ctxt, &mig->allowReboot) < 0)
+ goto error;
+
virObjectUnref(caps);
return 0;
qemuMigrationCookieAddCPU(mig, dom) < 0)
return -1;
+ if (flags & QEMU_MIGRATION_COOKIE_ALLOW_REBOOT)
+ qemuMigrationCookieAddAllowReboot(mig, dom);
+
if (!(*cookieout = qemuMigrationCookieXMLFormatStr(driver, mig)))
return -1;
QEMU_MIGRATION_COOKIE_FLAG_MEMORY_HOTPLUG,
QEMU_MIGRATION_COOKIE_FLAG_CPU_HOTPLUG,
QEMU_MIGRATION_COOKIE_FLAG_CPU,
+ QEMU_MIGRATION_COOKIE_FLAG_ALLOW_REBOOT,
QEMU_MIGRATION_COOKIE_FLAG_LAST
} qemuMigrationCookieFlags;
QEMU_MIGRATION_COOKIE_MEMORY_HOTPLUG = (1 << QEMU_MIGRATION_COOKIE_FLAG_MEMORY_HOTPLUG),
QEMU_MIGRATION_COOKIE_CPU_HOTPLUG = (1 << QEMU_MIGRATION_COOKIE_FLAG_CPU_HOTPLUG),
QEMU_MIGRATION_COOKIE_CPU = (1 << QEMU_MIGRATION_COOKIE_FLAG_CPU),
+ QEMU_MIGRATION_COOKIE_ALLOW_REBOOT = (1 << QEMU_MIGRATION_COOKIE_FLAG_ALLOW_REBOOT),
} qemuMigrationCookieFeatures;
typedef struct _qemuMigrationCookieGraphics qemuMigrationCookieGraphics;
/* If flags & QEMU_MIGRATION_COOKIE_CPU */
virCPUDefPtr cpu;
+
+ /* If flags & QEMU_MIGRATION_COOKIE_ALLOW_REBOOT */
+ virTristateBool allowReboot;
};