3 Commits

Author SHA1 Message Date
Mark McLoughlin
3fd24ba528 libvirt: force config related migration flags
The Nova libvirt driver relies on libvirt deleting the configuration
from the source host at the end of the migration, otherwise the
VM remains on the source host in a "shut off" state ... except in
the case of block migration, where the cleanup code path does actually
delete the VM's libvirt config.

If the Nova code assume's that VIR_MIGRATE_UNDEFINE_SOURCE is set,
there's really no sense in allowing users to configure without it.

Similarly, the driver explicitly saves the VM configuration on the
destination host, so it makes no sense to allow users to configure
the VIR_MIGRATE_PERSIST_DEST flag.

Change-Id: Ibeb35590fd83f2190c9c9cb16128e9e2628b38cd
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2016-01-14 17:24:27 +01:00
Mark McLoughlin
53eedc2df4 libvirt: force use of direct vs p2p migration
If live_migration_flag or block_migration_flag does not include the
VIR_MIGRATE_PEER2PEER libvirt migration flag, then migrations will
fail with a warning like:

  Live Migration failure: Requested operation is not valid:
  direct migration is not supported by the connection driver

We should avoid invalid configurations like this, and warn users about
it.

However, there is a caveat - with the xen virt type, the reverse is
actually true. Peer-to-peer migrations are not supported in libvirt's
xen driver, so we must remove the VIR_MIGRATE_PEER2PEER for migrations
to work with that driver.

Change-Id: I7fa43bd2025d067181a86b27952f2cad428aa823
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2016-01-14 17:24:27 +01:00
Mark McLoughlin
3b63f8e32f libvirt: force use/non-use of NON_SHARED_INC flag
Rather than simply warning if users have incorrectly set the migration
flag configs with or without VIR_MIGRATE_SHARED_INC, let's actually
fix up the values to what we know is correct and safe.

Related-Bug: #1499041

Change-Id: I85b8016952cb02db206a3474af33bcfe661f748d
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2016-01-14 17:24:27 +01:00