mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
qemu: Forbid migration of machines with I/O errors
Such machine can't be successuflly migrated unles the I/O error has recovered and might lead to data corruption. Forbid this kind of migration.
This commit is contained in:
parent
caa467db62
commit
5f719f217e
@ -1423,6 +1423,7 @@ qemuMigrationIsAllowed(virQEMUDriverPtr driver, virDomainObjPtr vm,
|
|||||||
virDomainDefPtr def, bool remote)
|
virDomainDefPtr def, bool remote)
|
||||||
{
|
{
|
||||||
int nsnapshots;
|
int nsnapshots;
|
||||||
|
int pauseReason;
|
||||||
bool forbid;
|
bool forbid;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -1445,6 +1446,15 @@ qemuMigrationIsAllowed(virQEMUDriverPtr driver, virDomainObjPtr vm,
|
|||||||
nsnapshots);
|
nsnapshots);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* cancel migration if disk I/O error is emitted while migrating */
|
||||||
|
if (virDomainObjGetState(vm, &pauseReason) == VIR_DOMAIN_PAUSED &&
|
||||||
|
pauseReason == VIR_DOMAIN_PAUSED_IOERROR) {
|
||||||
|
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||||
|
_("cannot migrate domain with I/O error"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainHasDiskMirror(vm)) {
|
if (virDomainHasDiskMirror(vm)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user