• D
    Fix QEMU save/restore with block devices · 93e0b3c8
    Daniel P. Berrange 提交于
    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
    93e0b3c8
qemu_monitor.c 40.4 KB