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

Re: [libvirt] [PATCHv9 6/9] blockjob: implement block copy for qemu



On 10/26/2012 07:21 AM, Peter Krempa wrote:
> On 10/23/12 04:10, 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 (that is, no REUSE_EXT flag support yet),
>> 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.
>>
>> This patch is designed so that if we ever add a future API
>> virDomainBlockCopy with more bells and whistles (such as letting
>> the user specify a destination image format different than the
>> source), where virDomainBlockRebase is a wrapper around the
>> simpler portions of the new functionality, then the new API can
>> just reuse the new qemuDomainBlockCopy function and already
>> support _SHALLOW and _REUSE_EXT flags.  Also note that libvirt.c
>> already filtered the new flags if _COPY is not present, so that
>> we are not impacting the case of BlockRebase being a wrapper
>> around BlockPull.
>>
>> * src/qemu/qemu_driver.c (qemuDomainBlockCopy): New function.
>> (qemuDomainBlockRebase): Call it when appropriate.
>> ---
>>
>> v9: fix bug with driver locking
>>
> 
> ACK as-is, but some parts will need to be dropped without the RHEL support.

Yep.  Here's what I squashed in:

diff --git i/src/qemu/qemu_driver.c w/src/qemu/qemu_driver.c
index 111922d..bd52631 100644
--- i/src/qemu/qemu_driver.c
+++ w/src/qemu/qemu_driver.c
@@ -12860,7 +12860,6 @@ qemuDomainBlockCopy(virDomainPtr dom, const char
*path,
     virDomainDiskDefPtr disk;
     int ret = -1;
     int idx;
-    bool reopen;

     /* Preliminaries: find the disk we are editing, sanity checks */
     virCheckFlags(VIR_DOMAIN_BLOCK_REBASE_SHALLOW, -1);
@@ -12887,7 +12886,6 @@ qemuDomainBlockCopy(virDomainPtr dom, const char
*path,
         goto cleanup;
     }

-    reopen = qemuCapsGet(priv->caps, QEMU_CAPS_DRIVE_REOPEN);
     if (!(qemuCapsGet(priv->caps, QEMU_CAPS_DRIVE_MIRROR) &&
           qemuCapsGet(priv->caps, QEMU_CAPS_BLOCKJOB_ASYNC))) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@@ -12950,7 +12948,7 @@ qemuDomainBlockCopy(virDomainPtr dom, const char
*path,
     /* Actually start the mirroring */
     qemuDomainObjEnterMonitor(driver, vm);
     ret = qemuMonitorDriveMirror(priv->mon, device, dest, format,
bandwidth,
-                                 reopen, flags);
+                                 flags);
     qemuDomainObjExitMonitor(driver, vm);

 endjob:

-- 
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]