[libvirt] [PATCHv2 11/15] blockjob: implement block copy for qemu
Eric Blake
eblake at redhat.com
Fri Apr 6 15:36:45 UTC 2012
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 at redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120406/5c51cea5/attachment-0001.sig>
More information about the libvir-list
mailing list