Re: [PATCH v3 5/5] blockcommit: turn on active commit

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

 



On 06/19/14 01:22, Eric Blake wrote:
> With this in place, I can (finally!) now do:
> 
> virsh blockcommit $dom vda --shallow --verbose --pivot
> 
> and watch qemu shorten the backing chain by one, followed by
> libvirt automatically updating the dumpxml output, effectively
> undoing the work of virsh snapshot-commit --no-metadata --disk-only.
> Commit is SOOOO much faster than blockpull, when I'm still fairly
> close in time to when the temporary qcow2 wrapper file was created
> via a snapshot operation!
> 
> Still not done: the persistent XML is not updated; which means
> stopping and restarting a persistent guest will use the wrong
> file and likely fail to boot.
> 
> * src/qemu/qemu_driver.c (qemuDomainBlockCommit): Implement live
> commit to regular files.
> 
> Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
> ---
>  src/qemu/qemu_driver.c | 40 +++++++++++++++++++++++++++++++++++-----
>  1 file changed, 35 insertions(+), 5 deletions(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index d19ca18..089668d 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c

> @@ -15607,6 +15615,21 @@ qemuDomainBlockCommit(virDomainPtr dom,
>                                                 VIR_DISK_CHAIN_READ_WRITE) < 0))
>          goto endjob;
> 
> +    /* For an active commit, clone enough of the base to act as the mirror */
> +    if (mirror) {
> +        /* XXX Support network commits */

This will be really easy with my deep-copy of the source struct.

> +        if (baseSource->type != VIR_STORAGE_TYPE_FILE &&
> +            baseSource->type != VIR_STORAGE_TYPE_BLOCK) {
> +            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                           _("active commit to non-file not supported yet"));
> +            goto endjob;
> +        }
> +        mirror->type = baseSource->type;
> +        if (VIR_STRDUP(mirror->path, baseSource->path) < 0)
> +            goto endjob;
> +        mirror->format = baseSource->format;
> +    }
> +
>      /* Start the commit operation.  Pass the user's original spelling,
>       * if any, through to qemu, since qemu may behave differently
>       * depending on whether the input was specified as relative or

ACK,

Peter

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]