mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
conf: node_device: fix up SCSI target
When reading in an XML definition for a SCSI target device, the name property of struct scsi_target refers to the @target element. Let's fix this obvious typo and also extend the XML schema to provide validation. Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
This commit is contained in:
parent
6ce9b85dee
commit
a243316ac6
@ -40,6 +40,7 @@
|
|||||||
<ref name="capusbinterface"/>
|
<ref name="capusbinterface"/>
|
||||||
<ref name="capnet"/>
|
<ref name="capnet"/>
|
||||||
<ref name="capscsihost"/>
|
<ref name="capscsihost"/>
|
||||||
|
<ref name="capscsitarget"/>
|
||||||
<ref name="capscsi"/>
|
<ref name="capscsi"/>
|
||||||
<ref name="capstorage"/>
|
<ref name="capstorage"/>
|
||||||
</choice>
|
</choice>
|
||||||
@ -382,6 +383,16 @@
|
|||||||
</optional>
|
</optional>
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
|
<define name='capscsitarget'>
|
||||||
|
<attribute name='type'>
|
||||||
|
<value>scsi_target</value>
|
||||||
|
</attribute>
|
||||||
|
|
||||||
|
<element name='target'>
|
||||||
|
<text/>
|
||||||
|
</element>
|
||||||
|
</define>
|
||||||
|
|
||||||
<define name='capscsi'>
|
<define name='capscsi'>
|
||||||
<attribute name='type'>
|
<attribute name='type'>
|
||||||
<value>scsi</value>
|
<value>scsi</value>
|
||||||
|
@ -822,7 +822,7 @@ virNodeDevCapSCSITargetParseXML(xmlXPathContextPtr ctxt,
|
|||||||
orignode = ctxt->node;
|
orignode = ctxt->node;
|
||||||
ctxt->node = node;
|
ctxt->node = node;
|
||||||
|
|
||||||
data->scsi_target.name = virXPathString("string(./name[1])", ctxt);
|
data->scsi_target.name = virXPathString("string(./target[1])", ctxt);
|
||||||
if (!data->scsi_target.name) {
|
if (!data->scsi_target.name) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("no target name supplied for '%s'"),
|
_("no target name supplied for '%s'"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user