[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCHv2 11/15] blockjob: implement block copy for qemu



On 04/05/2012 10:36 PM, Eric Blake wrote:
> Minimal patch to wire up all the pieces in the previous patches
> to actually enable a block copy job.  By minimal, I mean that
> qemu creates the file, SELinux must be disabled, a lock manager
> is not informed, and the audit logs aren't updated.  But those
> will be added as improvements in future patches.
> 
> * src/qemu/qemu_driver.c (qemuDomainBlockCopy): New function.
> (qemuDomainBlockRebase): Call it when appropriate.
> ---
>  src/qemu/qemu_driver.c |  129 +++++++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 128 insertions(+), 1 deletions(-)

Squash this in to simplify things based on Paolo's suggestion for 8/15.

diff --git i/src/qemu/qemu_driver.c w/src/qemu/qemu_driver.c
index f8f2210..1b1c921 100644
--- i/src/qemu/qemu_driver.c
+++ w/src/qemu/qemu_driver.c
@@ -11880,7 +11880,6 @@ qemuDomainBlockCopy(virDomainPtr dom, const char
*path,
     virDomainDiskDefPtr disk;
     int ret = -1;
     int idx;
-    virJSONValuePtr actions = NULL;
     int mode;

     /* Preliminaries: find the disk we are editing, sanity checks */
@@ -11947,21 +11946,12 @@ qemuDomainBlockCopy(virDomainPtr dom, const
char *path,
         mode = QEMU_MONITOR_DRIVE_MIRROR_NO_BACKING;

     /* Actually start the mirroring */
-    actions = virJSONValueNewArray();
-    if (!actions) {
-        virReportOOMError();
-        goto endjob;
-    }
     qemuDomainObjEnterMonitorWithDriver(driver, vm);
-    ret = qemuMonitorDriveMirror(priv->mon, actions, device, dest,
-                                 format, mode);
-    if (ret == 0)
-        ret = qemuMonitorTransaction(priv->mon, actions);
+    ret = qemuMonitorDriveMirror(priv->mon, NULL, device, dest, format,
mode);
     if (ret == 0 && bandwidth != 0)
         ret = qemuMonitorBlockJob(priv->mon, device, NULL, bandwidth, NULL,
                                   BLOCK_JOB_SPEED_INTERNAL);
     qemuDomainObjExitMonitorWithDriver(driver, vm);
-    virJSONValueFree(actions);

 endjob:
     if (ret < 0) {

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]