From 62f06ffe8a10611c30971fd756d8ef7c7483cb6e Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Wed, 7 Apr 2021 13:48:39 +0200 Subject: [PATCH] conf: Use virTristateXXX in virStorageAdapterFCHost Note that the comment for virStorageAdapterFCHost::managed was wrong. Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/conf/storage_adapter_conf.c | 4 +++- src/conf/storage_adapter_conf.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/conf/storage_adapter_conf.c b/src/conf/storage_adapter_conf.c index 5b71c79d24..142489f6cd 100644 --- a/src/conf/storage_adapter_conf.c +++ b/src/conf/storage_adapter_conf.c @@ -68,13 +68,15 @@ virStorageAdapterParseXMLFCHost(xmlNodePtr node, fchost->parent = virXMLPropString(node, "parent"); if ((managed = virXMLPropString(node, "managed"))) { - if ((fchost->managed = virTristateBoolTypeFromString(managed)) < 0) { + int value; + if ((value = virTristateBoolTypeFromString(managed)) < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown fc_host managed setting '%s'"), managed); VIR_FREE(managed); return -1; } + fchost->managed = value; } fchost->parent_wwnn = virXMLPropString(node, "parent_wwnn"); diff --git a/src/conf/storage_adapter_conf.h b/src/conf/storage_adapter_conf.h index ec7e9cc98f..e6d9c864cd 100644 --- a/src/conf/storage_adapter_conf.h +++ b/src/conf/storage_adapter_conf.h @@ -49,7 +49,7 @@ struct _virStorageAdapterFCHost { char *parent_fabric_wwn; char *wwnn; char *wwpn; - int managed; /* enum virTristateSwitch */ + virTristateBool managed; }; typedef struct _virStorageAdapter virStorageAdapter;