Re: [PATCH 2/2] vmx: handle shared folders parsing

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

 



2012/7/11 Jean-Baptiste Rouault <jean-baptiste.rouault@xxxxxxxxxxx>:
> This patch adds support for parsing vmx files with
> shared folders enabled.
>
> Update test suite accordingly.
> ---
>  src/vmx/vmx.c                              |  134 +++++++++++++++++++++++++++-
>  src/vmx/vmx.h                              |    2 +
>  tests/vmx2xmldata/vmx2xml-sharedfolder.vmx |    9 ++
>  tests/vmx2xmldata/vmx2xml-sharedfolder.xml |   22 +++++
>  tests/vmx2xmltest.c                        |    2 +
>  5 files changed, 168 insertions(+), 1 deletion(-)
>  create mode 100644 tests/vmx2xmldata/vmx2xml-sharedfolder.vmx
>  create mode 100644 tests/vmx2xmldata/vmx2xml-sharedfolder.xml
>

> +int virVMXParseFileSystem(virConfPtr conf, int index, virDomainFSDefPtr *def)

I'll replace index with number here again as it shadows a global.

> +    /* vmx:hostPath */
> +    if (virVMXGetConfigString(conf, hostPath_name, &hostPath, false) < 0) {
> +        goto cleanup;
> +    }
> +
> +    (*def)->src = strdup(hostPath);
> +
> +    /* vmx:guestName */
> +    if (virVMXGetConfigString(conf, guestName_name, &guestName, false) < 0) {
> +        goto cleanup;
> +    }
> +
> +    (*def)->dst = strdup(guestName);

The result of strdup must be check for NULL. But there is no need to
strdup it here as hostPath can just be stolen:

    (*def)->src = hostPath;
    hostPath = NULL;

ACK and pushed with the mentioned changes.

-- 
Matthias Bolte
http://photron.blogspot.com

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