/* set default value */
seclabel->type = VIR_DOMAIN_SECLABEL_DYNAMIC;
- p = virXMLPropString(ctxt->node, "type");
- if (p) {
- seclabel->type = virDomainSeclabelTypeFromString(p);
- if (seclabel->type <= 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("invalid security type '%s'"), p);
- goto error;
- }
- }
+ if (virXMLPropEnum(ctxt->node, "type",
+ virDomainSeclabelTypeFromString,
+ VIR_XML_PROP_NONZERO,
+ &seclabel->type) < 0)
+ goto error;
if (seclabel->type == VIR_DOMAIN_SECLABEL_STATIC ||
seclabel->type == VIR_DOMAIN_SECLABEL_NONE)
mcs = g_strdup(sens);
break;
-
+ case VIR_DOMAIN_SECLABEL_DEFAULT:
+ case VIR_DOMAIN_SECLABEL_LAST:
default:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected security label type '%s'"),
char *label; /* security label string */
char *imagelabel; /* security image label string */
char *baselabel; /* base name of label string */
- int type; /* virDomainSeclabelType */
+ virDomainSeclabelType type; /* virDomainSeclabelType */
bool relabel; /* true (default) for allowing relabels */
bool implicit; /* true if seclabel is auto-added */
};