conf: Use virTristateXXX in virStorageAdapterFCHost

Note that the comment for virStorageAdapterFCHost::managed was wrong.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-04-07 13:48:39 +02:00 committed by Peter Krempa
parent cc6557ae04
commit 62f06ffe8a
2 changed files with 4 additions and 2 deletions

View File

@ -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");

View File

@ -49,7 +49,7 @@ struct _virStorageAdapterFCHost {
char *parent_fabric_wwn;
char *wwnn;
char *wwpn;
int managed; /* enum virTristateSwitch */
virTristateBool managed;
};
typedef struct _virStorageAdapter virStorageAdapter;