conf: Use virTristateXXX in virStorageSourceNVMeDef

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:29 +02:00 committed by Peter Krempa
parent c33c482df4
commit e949edeec8
2 changed files with 4 additions and 2 deletions

View File

@ -8492,12 +8492,14 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node,
}
if ((managed = virXMLPropString(node, "managed"))) {
if ((nvme->managed = virTristateBoolTypeFromString(managed)) <= 0) {
int value;
if ((value = virTristateBoolTypeFromString(managed)) <= 0) {
virReportError(VIR_ERR_XML_ERROR,
_("malformed managed value '%s'"),
managed);
return -1;
}
nvme->managed = value;
}
if (!(address = virXPathNode("./address", ctxt))) {

View File

@ -242,7 +242,7 @@ struct _virStorageSourceInitiatorDef {
typedef struct _virStorageSourceNVMeDef virStorageSourceNVMeDef;
struct _virStorageSourceNVMeDef {
unsigned long long namespc;
int managed; /* enum virTristateBool */
virTristateBool managed;
virPCIDeviceAddress pciAddr;
/* Don't forget to update virStorageSourceNVMeDefCopy */