mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: Check flags incompatible with offline migration earlier
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
2b137aba20
commit
3c1f37848d
@ -2512,6 +2512,25 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (flags & VIR_MIGRATE_OFFLINE) {
|
||||
if (flags & (VIR_MIGRATE_NON_SHARED_DISK |
|
||||
VIR_MIGRATE_NON_SHARED_INC)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("offline migration cannot handle non-shared storage"));
|
||||
return NULL;
|
||||
}
|
||||
if (!(flags & VIR_MIGRATE_PERSIST_DEST)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("offline migration must be specified with the persistent flag set"));
|
||||
return NULL;
|
||||
}
|
||||
if (flags & VIR_MIGRATE_TUNNELLED) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("tunnelled offline migration does not make sense"));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC)) {
|
||||
if (flags & VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES &&
|
||||
!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
||||
@ -2591,28 +2610,6 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
cookieFlags) < 0)
|
||||
return NULL;
|
||||
|
||||
if (flags & VIR_MIGRATE_OFFLINE) {
|
||||
if (flags & (VIR_MIGRATE_NON_SHARED_DISK |
|
||||
VIR_MIGRATE_NON_SHARED_INC)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("offline migration cannot handle "
|
||||
"non-shared storage"));
|
||||
return NULL;
|
||||
}
|
||||
if (!(flags & VIR_MIGRATE_PERSIST_DEST)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("offline migration must be specified with "
|
||||
"the persistent flag set"));
|
||||
return NULL;
|
||||
}
|
||||
if (flags & VIR_MIGRATE_TUNNELLED) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("tunnelled offline migration does not "
|
||||
"make sense"));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (xmlin) {
|
||||
if (!(def = virDomainDefParseString(xmlin, driver->xmlopt, priv->qemuCaps,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
|
Loading…
x
Reference in New Issue
Block a user