提交 bab45585 编写于 作者: M Michal Privoznik

virNodeDevCapPCIDevParseXML: Initialize numa_node variable

With one of my recent patches (1c702778) libvirt's capable of
reporting NUMA node locality for PCI devices. The node ID is
stored in pci_dev.numa_node variable. However, since zero is
valid NUMA node ID, the default is -1 as it is in kernel too.
So, if the PCI device is not tied to any specific NUMA node, the
default is then NOT printed into XML. Therefore, when parsing
node device XML, the <node/> element is optional. But currently,
if it's not there, we must set sane default, otherwise after
parsing in the memory representation doesn't match the XML. We
are already doing this in other place: udevProcessPCI().
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 519181d9
......@@ -1145,6 +1145,8 @@ virNodeDevCapPCIDevParseXML(xmlXPathContextPtr ctxt,
}
}
/* The default value is -1 since zero is valid NUMA node number */
data->pci_dev.numa_node = -1;
if (virNodeDevCapsDefParseIntOptional("number(./numa[1]/@node)", ctxt,
&data->pci_dev.numa_node, def,
_("invalid NUMA node ID supplied for '%s'")) < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册