On 06/24/2010 01:47 PM, Daniel P. Berrange wrote:
The patches for shared storage migration were not correctly written
for json mode. Thus the 'blk' and 'inc' parameters were never being
set. In addition they didn't set the QEMU_MONITOR_MIGRATE_BACKGROUND
so migration was synchronous. Due to multiple bugs in QEMU's JSON
impl this wasn't noticed because it treated the sync migration requst
as asynchronous anyway. Finally 'background' parameter was converted
to take arbitrary flags but not renamed, and not all uses were changed
to unsigned int.
* src/qemu/qemu_driver.c: Set QEMU_MONITOR_MIGRATE_BACKGROUND in
doNativeMigrate
* src/qemu/qemu_monitor_json.c: Process QEMU_MONITOR_MIGRATE_NON_SHARED_DISK
and QEMU_MONITOR_MIGRATE_NON_SHARED_INC flags
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.h, src/qemu/qemu_monitor_text.c,
src/qemu/qemu_monitor_text.h: change 'int background' to
'unsigned int flags' in migration APIs. Add logging of flags
parameter
---
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_monitor.c | 40 ++++++++++++++++++++--------------------
src/qemu/qemu_monitor.h | 8 ++++----
src/qemu/qemu_monitor_json.c | 29 ++++++++++++++++-------------
src/qemu/qemu_monitor_json.h | 8 ++++----
src/qemu/qemu_monitor_text.c | 24 ++++++++++++------------
src/qemu/qemu_monitor_text.h | 8 ++++----
7 files changed, 61 insertions(+), 58 deletions(-)
static int qemuMonitorJSONMigrate(qemuMonitorPtr mon,
- int background,
+ unsigned int flags,
const char *uri)
{
int ret;
- virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("migrate",
- "i:detach", background ?
1 : 0,
- "s:uri", uri,
- NULL);
+ virJSONValuePtr cmd =
+ qemuMonitorJSONMakeCommand("migrate",
+ "i:detach", flags & QEMU_MONITOR_MIGRATE_BACKGROUND ? 1 : 0,
+ "i:blk", flags & QEMU_MONITOR_MIGRATE_NON_SHARED_DISK ? 1 : 0,
+ "i:inc", flags & QEMU_MONITOR_MIGRATE_NON_SHARED_INC ? 1 : 0,
+ "s:uri", uri,
+ NULL);
ACK.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org