Since qemu-2.10 it is required to unplug emulated devices again after
a live migration. If this is not done, qemu's block-backend driver
will be unable to open the backing disk image because it is still busy
by qemu's IDE driver. As a result the domUs block-frontend driver will
be unable to access the disks, and the domU has to be destroyed.
libxl is unable to detect the situation.
Apply the same workaround for this qemu bug that was done already
years ago in linux.git with commit
512b109ec962 ("xen: unplug the
emulated devices at resume time") to make sure xenlinux based domUs
can be migrated to unfixed hosts.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Jan Beulich <jbeulich@suse.com>
#define UNPLUG_AUX_IDE_DISKS 4
#define UNPLUG_ALL 7
+static short unplug_value;
+static void unplug_devices(void)
+{
+ outw(unplug_value, XEN_IOPORT_UNPLUG);
+}
+
static int check_platform_magic(struct device *dev, long ioaddr, long iolen)
{
short magic, unplug = 0;
dev_warn(dev, "unrecognised option '%s' "
"in module parameter 'dev_unplug'\n", p);
}
+ unplug_value = unplug;
if (iolen < 0x16) {
err = "backend too old";
}
/* Fall through */
case 0:
- outw(unplug, XEN_IOPORT_UNPLUG);
+ unplug_devices();
break;
default:
err = "unknown I/O protocol version";
if (set_callback_via(callback_via))
printk("platform_pci_resume failure!\n");
+
+ unplug_devices();
}
static int __init platform_pci_module_init(void)