Re: [PATCH v1 2/6] conf: Parse and format shmem device XML

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

 



On 2014/8/22 18:47, Maxime Leroy wrote:
> This patch adds configuration support for the shmem device
> as described in the schema in the previous patch.
> 
> Signed-off-by: Maxime Leroy <maxime.leroy@xxxxxxxxx>
> ---

> +static virDomainShmemDefPtr
> +virDomainShmemDefParseXML(xmlNodePtr node,
> +                          xmlXPathContextPtr ctxt,
> +                          unsigned int flags)
> +{
> +    char *model = virXMLPropString(node, "model");
> +    virDomainShmemDefPtr def;
> +
> +    if (VIR_ALLOC(def) < 0)
> +        return NULL;
> +
> +    if (model) {
> +        if ((def->model == virDomainShmemModelTypeFromString(model)) < 0) {

I guess you intend 'def->modle = ...' not 'def->model == ...' .

> +            virReportError(VIR_ERR_XML_ERROR,
> +                           _("Unknown <shmem> model '%s'"), model);
> +            goto error;
> +        }
> +    } else
> +        def->model = VIR_DOMAIN_SHMEM_MODEL_IVSHMEM;
> +
> +    if (!(def->name = virXMLPropString(node, "name"))) {
> +        virReportError(VIR_ERR_XML_ERROR, "%s",
> +                       _("<shmem> must contain 'name' attribute"));
> +        goto error;
> +    }

As Martin mentioned, 'name' is not necessary.

> +static int virDomainShmemDefFormat(virBufferPtr buf,
> +                                   virDomainShmemDefPtr def,
> +                                   unsigned int flags)
> +{
> +    virBufferAsprintf(buf, "<shmem name='%s' model='%s'>\n",
> +                      def->name, virDomainShmemModelTypeToString(def->model));

Here too, 'name' is not necessary

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