1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

virDomainHostdevDef: Change type of startupPolicy to virDomainStartupPolicy

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-05-18 17:04:42 +02:00 committed by Laine Stump
parent bdbd902722
commit e9c1e68d1f
2 changed files with 13 additions and 14 deletions

View File

@ -6704,14 +6704,14 @@ virDomainHostdevSubsysUSBDefParseXML(xmlNodePtr node,
ctxt->node = node;
if ((startupPolicy = virXMLPropString(node, "startupPolicy"))) {
def->startupPolicy =
virDomainStartupPolicyTypeFromString(startupPolicy);
if (def->startupPolicy <= 0) {
int value = virDomainStartupPolicyTypeFromString(startupPolicy);
if (value <= 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unknown startup policy '%s'"),
startupPolicy);
return -1;
}
def->startupPolicy = value;
}
if ((autoAddress = virXMLPropString(node, "autoAddress")))

View File

@ -332,6 +332,15 @@ struct _virDomainHostdevCaps {
};
typedef enum {
VIR_DOMAIN_STARTUP_POLICY_DEFAULT = 0,
VIR_DOMAIN_STARTUP_POLICY_MANDATORY,
VIR_DOMAIN_STARTUP_POLICY_REQUISITE,
VIR_DOMAIN_STARTUP_POLICY_OPTIONAL,
VIR_DOMAIN_STARTUP_POLICY_LAST
} virDomainStartupPolicy;
/* basic device for direct passthrough */
struct _virDomainHostdevDef {
/* If 'parentnet' is non-NULL it means this host dev was
@ -343,7 +352,7 @@ struct _virDomainHostdevDef {
virDomainNetDef *parentnet;
int mode; /* enum virDomainHostdevMode */
int startupPolicy; /* enum virDomainStartupPolicy */
virDomainStartupPolicy startupPolicy;
bool managed;
bool missing;
bool readonly;
@ -432,16 +441,6 @@ typedef enum {
VIR_DOMAIN_DISK_IO_LAST
} virDomainDiskIo;
typedef enum {
VIR_DOMAIN_STARTUP_POLICY_DEFAULT = 0,
VIR_DOMAIN_STARTUP_POLICY_MANDATORY,
VIR_DOMAIN_STARTUP_POLICY_REQUISITE,
VIR_DOMAIN_STARTUP_POLICY_OPTIONAL,
VIR_DOMAIN_STARTUP_POLICY_LAST
} virDomainStartupPolicy;
typedef enum {
VIR_DOMAIN_DEVICE_SGIO_DEFAULT = 0,
VIR_DOMAIN_DEVICE_SGIO_FILTERED,