[libvirt] [PATCH v3 1/3] docs, conf, schema: add support for shmem device
Martin Kletzander
mkletzan at redhat.com
Fri Oct 3 20:45:09 UTC 2014
On Thu, Oct 02, 2014 at 09:42:36AM +0200, Michal Privoznik wrote:
>On 26.09.2014 12:43, Martin Kletzander wrote:
>> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
>> index b114737..51bdd31 100644
>> --- a/src/conf/domain_conf.c
>> +++ b/src/conf/domain_conf.c
>
>> @@ -9702,6 +9730,84 @@ virDomainNVRAMDefParseXML(xmlNodePtr node,
>> return NULL;
>> }
>>
>> +static virDomainShmemDefPtr
>> +virDomainShmemDefParseXML(xmlNodePtr node,
>> + xmlXPathContextPtr ctxt,
>> + unsigned int flags)
>> +{
>> + char *tmp = NULL;
>> + virDomainShmemDefPtr def = NULL;
>> + virDomainShmemDefPtr ret = NULL;
>> + xmlNodePtr msi = NULL;
>> + xmlNodePtr save = ctxt->node;
>> + xmlNodePtr server = NULL;
>> +
>> +
>> + if (VIR_ALLOC(def) < 0)
>> + return NULL;
>> +
>> + ctxt->node = node;
>> +
>> + if (!(def->name = virXMLPropString(node, "name"))) {
>> + virReportError(VIR_ERR_XML_ERROR, "%s",
>> + _("shmem element must contain 'name' attribute"));
>> + goto cleanup;
>> + }
>> +
>> + if (virDomainParseScaledValue("./size[1]", ctxt, &def->size,
>> + 1, ULLONG_MAX, false) < 0)
>> + goto cleanup;
>> +
>> + if ((server = virXPathNode("./server", ctxt))) {
>
>s,./server,./server[1] to make sure we parse only the first <server/> in
>case user supplies two or more in the XML.
>
>> + def->server.enabled = true;
>> +
>> + if ((tmp = virXMLPropString(server, "path")))
>> + def->server.path = virFileSanitizePath(tmp);
>> + VIR_FREE(tmp);
>> + }
>> +
>> + if ((msi = virXPathNode("./msi", ctxt))) {
>
>Same here.
>
Nice catch.
Since we are past the release anyway, I'm going to push this in a
while and whoever wants (e.g. Maxime) have the whole release cycle to
test this.
Thank you,
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141003/c699b530/attachment-0001.sig>
More information about the libvir-list
mailing list