Re: [PATCH v3 05/12] qemu: Store pr runtime data in status XML

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

 



On Wed, Mar 14, 2018 at 17:05:34 +0100, Michal Privoznik wrote:
> Now that we generate pr-manager alias and socket path store them
> in status XML so that they are preserved across daemon restarts.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/qemu/qemu_domain.c | 108 +++++++++++++++++++++++++++++++++++++++----------
>  1 file changed, 86 insertions(+), 22 deletions(-)
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index c17e40dc8..d673ddbb2 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c

[...]

> +static int
> +qemuStorageSourcePrivateDataFormatPR(virStorageSourcePtr src,
> +                                     virBufferPtr buf)
> +{
> +    qemuDomainStorageSourcePrivatePtr srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src);
> +    qemuDomainDiskPRDPtr prd;
> +
> +    if (!srcPriv || !srcPriv->prd)
> +        return 0;
> +
> +    prd = srcPriv->prd;
> +
> +    virBufferAddLit(buf, "<prd>\n");
> +    virBufferAdjustIndent(buf, 2);
> +    virBufferAsprintf(buf, "<alias>%s</alias>\n", prd->alias);
> +    virBufferAsprintf(buf, "<path>%s</path>\n", prd->path);

'path' is user-controlled, so you need to use the 'virBufferEscape'
function.

> +    virBufferAdjustIndent(buf, -2);
> +    virBufferAddLit(buf, "</prd>\n");
> +    return 0;
> +}
> +

Attachment: signature.asc
Description: PGP 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]

  Powered by Linux