]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
Fix QEMU save/restore with block devices
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 21 Apr 2010 13:06:37 +0000 (14:06 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 28 Apr 2010 12:51:48 +0000 (13:51 +0100)
commit93e0b3c8d665a7cc1ea3267a1e60868f633f51c2
tree51ea86d03aa9867f40ed7252ba5af4514cd59a9b
parentae42979a74a2a137e179709754f4642edb114a92
Fix QEMU save/restore with block devices

The save process was relying on use of the shell >> append
operator to ensure the save data was placed after the libvirt
header + XML. This doesn't work for block devices though.
Replace this code with use of 'dd' and its 'seek' parameter.
This means that we need to pad the header + XML out to a
multiple of dd block size (in this case we choose 512).

The qemuMonitorMigateToCommand() monitor API is used for both
save/coredump, and migration via UNIX socket. We can't simply
switch this to use 'dd' since this causes problems with the
migration usage. Thus, create a dedicated qemuMonitorMigateToFile
which can accept an filename + offset, and remove the filename
from the current qemuMonitorMigateToCommand() API

* src/qemu/qemu_driver.c: Switch to qemuMonitorMigateToFile
  for save and core dump
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Create
  a new qemuMonitorMigateToFile, separate from the existing
  qemuMonitorMigateToCommand to allow handling file offsets
src/qemu/qemu_driver.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_json.h
src/qemu/qemu_monitor_text.c
src/qemu/qemu_monitor_text.h