On 04/06/2012 10:04 AM, Federico Simoncelli wrote:
----- Original Message -----
From: "Eric Blake" <eblake@redhat.com> To: libvir-list@redhat.com Cc: pbonzini@redhat.com, fsimonce@redhat.com Sent: Friday, April 6, 2012 6:36:54 AM Subject: [PATCHv2 08/15] blockjob: expose qemu commands for mirrored storage migration
The new block copy storage migration sequence requires both the 'drive-mirror' action in 'transaction' (present if the 'drive-mirror' standalone monitor command also exists) and the 'drive-reopen' monitor command (it would be nice if that were also part of a 'transaction', but the initial qemu implementation has it standalone only).
+int +qemuMonitorDriveMirror(qemuMonitorPtr mon, virJSONValuePtr actions, + const char *device, const char *file, + const char *format, int mode) +{ + int ret; + + VIR_DEBUG("mon=%p, actions=%p, device=%s, file=%s, format=%s, mode=%o", + mon, actions, device, file, format, mode); + + if (!mon) { + qemuReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); + return -1; + } + + if (mon->json) + ret = qemuMonitorJSONDriveMirror(mon, actions, device, file, format, + mode); + else + qemuReportError(VIR_ERR_INVALID_ARG, "%s", + _("drive-mirror requires JSON monitor"));
You should set ret to -1 here (or return -1).
Yep. Fixed in my tree for v3. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org