]> xenbits.xensource.com Git - libvirt.git/commitdiff
virStorageAdapterFCHost: Change type of "type" to virStorageAdapterType
authorTim Wiederhake <twiederh@redhat.com>
Wed, 19 May 2021 14:10:10 +0000 (16:10 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 20 May 2021 09:52:41 +0000 (11:52 +0200)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/storage_adapter_conf.c
src/conf/storage_adapter_conf.h

index 717d00dc4aea37950394341b144c449c8bae3019..a834eee81f8ed2b8d7d7d36979546ffdb5769efc 100644 (file)
@@ -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)
index e6d9c864cdd1eac6eac2c067284df5413dcb699b..1f0e74631ef9c31a4c45de70ab23ce5a0ef75657 100644 (file)
@@ -54,7 +54,7 @@ struct _virStorageAdapterFCHost {
 
 typedef struct _virStorageAdapter virStorageAdapter;
 struct _virStorageAdapter {
-    int type; /* virStorageAdapterType */
+    virStorageAdapterType type;
 
     union {
         virStorageAdapterSCSIHost scsi_host;