From a243316ac6ecd76542d4baf9515f398433d9824c Mon Sep 17 00:00:00 2001 From: Bjoern Walk Date: Mon, 21 Mar 2016 15:49:29 +0100 Subject: [PATCH] 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 --- docs/schemas/nodedev.rng | 11 +++++++++++ src/conf/node_device_conf.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/schemas/nodedev.rng b/docs/schemas/nodedev.rng index 949811cacb..d937513048 100644 --- a/docs/schemas/nodedev.rng +++ b/docs/schemas/nodedev.rng @@ -40,6 +40,7 @@ + @@ -382,6 +383,16 @@ + + + scsi_target + + + + + + + scsi diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index 611045c679..f74b34de5c 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -822,7 +822,7 @@ virNodeDevCapSCSITargetParseXML(xmlXPathContextPtr ctxt, orignode = ctxt->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) { virReportError(VIR_ERR_INTERNAL_ERROR, _("no target name supplied for '%s'"),