Re: [PATCH 11/15] qemu: domain: Add private data for NBD migration storage source definition

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

 




On 05/18/2018 07:29 AM, Peter Krempa wrote:
> Allow saving various aspects necessary to do NBD migration via blockdev
> by storing a 'virStorageSource' in the disk private data meant to store
> the NBD target of migration. Along with this add code to parse and
> format it into the status XML.
> 
> Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
> ---
>  src/qemu/qemu_domain.c | 162 ++++++++++++++++++++++++++++++++++++++++++++++---
>  src/qemu/qemu_domain.h |   1 +
>  2 files changed, 156 insertions(+), 7 deletions(-)
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index 94a9c5d1bc..632c025bef 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c

[...]


> 
> @@ -2092,6 +2155,7 @@ qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf,
>      virBuffer attrBuf = VIR_BUFFER_INITIALIZER;
>      virBuffer childBuf = VIR_BUFFER_INITIALIZER;
>      qemuDomainJob job = priv->job.active;
> +    int ret = -1;
> 
>      if (!qemuDomainTrackJob(job))
>          job = QEMU_JOB_NONE;
> @@ -2115,13 +2179,23 @@ qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf,
>      if (priv->job.asyncJob != QEMU_ASYNC_JOB_NONE)
>          virBufferAsprintf(&attrBuf, " flags='0x%lx'", priv->job.apiFlags);
> 
> -    if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_OUT)
> -        qemuDomainObjPrivateXMLFormatNBDMigration(&childBuf, vm);
> +    if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_OUT &&
> +        qemuDomainObjPrivateXMLFormatNBDMigration(&childBuf, vm) < 0)
> +        goto cleanup;
> 
>      if (priv->job.migParams)
>          qemuMigrationParamsFormat(&childBuf, priv->job.migParams);
> 
> -    return virXMLFormatElement(buf, "job", &attrBuf, &childBuf);
> +    if (virXMLFormatElement(buf, "job", &attrBuf, &childBuf) < 0)
> +        goto cleanup;
> +
> +    ret = 0;
> +
> + cleanup:
> +    virBufferFreeAndReset(&attrBuf);
> +    virBufferFreeAndReset(&childBuf);

So I assume the lack of FreeAndReset was existing prior to this patch
since d8be0f4bc?

> +
> +    return ret;
>  }
> 
> 
> @@ -2367,12 +2441,79 @@ qemuDomainObjPrivateXMLParsePR(xmlXPathContextPtr ctxt,
>  }
> 
> 

[...]

John

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

  Powered by Linux