mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
conf: Add VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING
This requires drivers to opt in to handle the raw modelstr network model, all others will error if a passed in XML value is not in the model enum. Enable this feature for libxl/xen/xm and qemu drivers Acked-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
17a1bd7eb9
commit
84a5e89b31
@ -5365,6 +5365,15 @@ virDomainDeviceDefPostParseCheckFeatures(virDomainDeviceDefPtr dev,
|
||||
virDomainDeviceDefCheckUnsupportedMemoryDevice(dev) < 0)
|
||||
return -1;
|
||||
|
||||
if (UNSUPPORTED(VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING) &&
|
||||
dev->type == VIR_DOMAIN_DEVICE_NET &&
|
||||
dev->data.net->modelstr) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("driver does not support net model '%s'"),
|
||||
dev->data.net->modelstr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#undef UNSUPPORTED
|
||||
|
@ -2580,6 +2580,7 @@ typedef enum {
|
||||
VIR_DOMAIN_DEF_FEATURE_USER_ALIAS = (1 << 5),
|
||||
VIR_DOMAIN_DEF_FEATURE_NO_BOOT_ORDER = (1 << 6),
|
||||
VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT = (1 << 7),
|
||||
VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING = (1 << 8),
|
||||
} virDomainDefFeatures;
|
||||
|
||||
|
||||
|
@ -431,6 +431,7 @@ virDomainDefParserConfig libxlDomainDefParserConfig = {
|
||||
.macPrefix = { 0x00, 0x16, 0x3e },
|
||||
.devicesPostParseCallback = libxlDomainDeviceDefPostParse,
|
||||
.domainPostParseCallback = libxlDomainDefPostParse,
|
||||
.features = VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING,
|
||||
};
|
||||
|
||||
|
||||
|
@ -6962,7 +6962,8 @@ virDomainDefParserConfig virQEMUDriverDomainDefParserConfig = {
|
||||
VIR_DOMAIN_DEF_FEATURE_OFFLINE_VCPUPIN |
|
||||
VIR_DOMAIN_DEF_FEATURE_INDIVIDUAL_VCPUS |
|
||||
VIR_DOMAIN_DEF_FEATURE_USER_ALIAS |
|
||||
VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT,
|
||||
VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT |
|
||||
VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING,
|
||||
};
|
||||
|
||||
|
||||
|
@ -645,7 +645,8 @@ caps_mockup(vahControl * ctl, const char *xmlStr)
|
||||
virDomainDefParserConfig virAAHelperDomainDefParserConfig = {
|
||||
.features = VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG |
|
||||
VIR_DOMAIN_DEF_FEATURE_OFFLINE_VCPUPIN |
|
||||
VIR_DOMAIN_DEF_FEATURE_INDIVIDUAL_VCPUS,
|
||||
VIR_DOMAIN_DEF_FEATURE_INDIVIDUAL_VCPUS |
|
||||
VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING,
|
||||
};
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user