提交 5098f671 编写于 作者: P Pavel Hrdina

qemu_domain: fix startup policy for disks

https://bugzilla.redhat.com/show_bug.cgi?id=1086121

We now support startupPolicy='optional' for disks, but this
should work only for cold boot, not for restore or migrate.
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 636d66e6
...@@ -2230,11 +2230,19 @@ qemuDomainCheckDiskStartupPolicy(virQEMUDriverPtr driver, ...@@ -2230,11 +2230,19 @@ qemuDomainCheckDiskStartupPolicy(virQEMUDriverPtr driver,
{ {
char uuid[VIR_UUID_STRING_BUFLEN]; char uuid[VIR_UUID_STRING_BUFLEN];
int startupPolicy = vm->def->disks[diskIndex]->startupPolicy; int startupPolicy = vm->def->disks[diskIndex]->startupPolicy;
int device = vm->def->disks[diskIndex]->device;
virUUIDFormat(vm->def->uuid, uuid); virUUIDFormat(vm->def->uuid, uuid);
switch ((virDomainStartupPolicy) startupPolicy) { switch ((virDomainStartupPolicy) startupPolicy) {
case VIR_DOMAIN_STARTUP_POLICY_OPTIONAL: case VIR_DOMAIN_STARTUP_POLICY_OPTIONAL:
/* Once started with an optional disk, qemu saves its section
* in the migration stream, so later, when restoring from it
* we must make sure the sections match. */
if (!cold_boot &&
device != VIR_DOMAIN_DISK_DEVICE_FLOPPY &&
device != VIR_DOMAIN_DISK_DEVICE_CDROM)
goto error;
break; break;
case VIR_DOMAIN_STARTUP_POLICY_MANDATORY: case VIR_DOMAIN_STARTUP_POLICY_MANDATORY:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册