migration: Make erroring out on I/O error controllable by flag

Paolo Bonzini pointed out that it's actually possible to migrate a qemu
instance that was paused due to I/O error and it will be able to work on
the destination if the storage is accessible.

This patch introduces flag VIR_MIGRATE_ABORT_ON_ERROR that cancels the
migration in case an I/O error happens while it's being performed and
allows migration without this flag. This flag can be possibly used for
other error reasons that may be introduced in the future.
This commit is contained in:
Peter Krempa
2013-06-12 16:11:21 +02:00
committed by Jiri Denemark
parent ddf8ad82eb
commit cf6d56ac43
6 changed files with 32 additions and 15 deletions

View File

@@ -8306,6 +8306,10 @@ static const vshCmdOptDef opts_migrate[] = {
.type = VSH_OT_BOOL,
.help = N_("compress repeated pages during live migration")
},
{.name = "abort-on-error",
.type = VSH_OT_BOOL,
.help = N_("abort on soft errors during migration")
},
{.name = "domain",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
@@ -8399,6 +8403,9 @@ doMigrate(void *opaque)
flags |= VIR_MIGRATE_OFFLINE;
}
if (vshCommandOptBool(cmd, "abort-on-error"))
flags |= VIR_MIGRATE_ABORT_ON_ERROR;
if (xmlfile &&
virFileReadAll(xmlfile, 8192, &xml) < 0) {
vshError(ctl, _("file '%s' doesn't exist"), xmlfile);

View File

@@ -1043,7 +1043,8 @@ stats.
=item B<migrate> [I<--live>] [I<--offline>] [I<--direct>] [I<--p2p> [I<--tunnelled>]]
[I<--persistent>] [I<--undefinesource>] [I<--suspend>] [I<--copy-storage-all>]
[I<--copy-storage-inc>] [I<--change-protection>] [I<--unsafe>] [I<--verbose>]
[I<--compressed>] I<domain> I<desturi> [I<migrateuri>] [I<dname>]
[I<--compressed>] [I<--abort-on-error>]
I<domain> I<desturi> [I<migrateuri>] [I<dname>]
[I<--timeout> B<seconds>] [I<--xml> B<file>]
Migrate domain to another host. Add I<--live> for live migration; <--p2p>
@@ -1066,7 +1067,8 @@ is implicitly enabled when supported by the hypervisor, but can be explicitly
used to reject the migration if the hypervisor lacks change protection
support. I<--verbose> displays the progress of migration. I<--compressed>
activates compression of memory pages that have to be transferred repeatedly
during live migration.
during live migration. I<--abort-on-error> cancels the migration if a soft
error (for example I/O error) happens during the migration.
B<Note>: Individual hypervisors usually do not support all possible types of
migration. For example, QEMU does not support direct migration.