From: Tim Wiederhake Date: Wed, 19 May 2021 14:10:10 +0000 (+0200) Subject: virStorageAdapterFCHost: Change type of "type" to virStorageAdapterType X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=058d4ed47e45e29a461be899b8e80b38262872d3;p=libvirt.git virStorageAdapterFCHost: Change type of "type" to virStorageAdapterType Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- diff --git a/src/conf/storage_adapter_conf.c b/src/conf/storage_adapter_conf.c index 717d00dc4a..a834eee81f 100644 --- a/src/conf/storage_adapter_conf.c +++ b/src/conf/storage_adapter_conf.c @@ -168,19 +168,20 @@ virStorageAdapterParseXML(virStorageAdapter *adapter, xmlNodePtr node, xmlXPathContextPtr ctxt) { + int type; VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree char *adapter_type = NULL; ctxt->node = node; if ((adapter_type = virXMLPropString(node, "type"))) { - if ((adapter->type = - virStorageAdapterTypeFromString(adapter_type)) <= 0) { + if ((type = virStorageAdapterTypeFromString(adapter_type)) <= 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unknown pool adapter type '%s'"), adapter_type); return -1; } + adapter->type = type; if ((adapter->type == VIR_STORAGE_ADAPTER_TYPE_FC_HOST) && (virStorageAdapterParseXMLFCHost(node, &adapter->data.fchost)) < 0) diff --git a/src/conf/storage_adapter_conf.h b/src/conf/storage_adapter_conf.h index e6d9c864cd..1f0e74631e 100644 --- a/src/conf/storage_adapter_conf.h +++ b/src/conf/storage_adapter_conf.h @@ -54,7 +54,7 @@ struct _virStorageAdapterFCHost { typedef struct _virStorageAdapter virStorageAdapter; struct _virStorageAdapter { - int type; /* virStorageAdapterType */ + virStorageAdapterType type; union { virStorageAdapterSCSIHost scsi_host;