This fits better with the element containing the value (<driver>), and allows us to use virDomainNetBackend* for things in the <backend> element. Signed-off-by: Laine Stump <laine(a)redhat.com> --- src/conf/domain_conf.c | 8 ++++---- src/conf/domain_conf.h | 14 +++++++------- src/qemu/qemu_interface.c | 8 ++++---- src/security/virt-aa-helper.c | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a180398b14..30b0cef131 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -604,8 +604,8 @@ VIR_ENUM_IMPL(virDomainNetModel, "82543GC", ); -VIR_ENUM_IMPL(virDomainNetBackend, - VIR_DOMAIN_NET_BACKEND_TYPE_LAST, +VIR_ENUM_IMPL(virDomainNetDriver, + VIR_DOMAIN_NET_DRIVER_TYPE_LAST, "default", "qemu", "vhost", @@ -8862,7 +8862,7 @@ virDomainNetDefParseXMLDriver(virDomainNetDef *def, xmlNodePtr guestNode; if (virXMLPropEnum(driver_node, "name", - virDomainNetBackendTypeFromString, + virDomainNetDriverTypeFromString, VIR_XML_PROP_NONZERO, &def->driver.virtio.name) < 0) return -1; @@ -23190,7 +23190,7 @@ virDomainVirtioNetDriverFormat(virBuffer *buf, { if (def->driver.virtio.name) { virBufferAsprintf(buf, " name='%s'", - virDomainNetBackendTypeToString(def->driver.virtio.name)); + virDomainNetDriverTypeToString(def->driver.virtio.name)); } if (def->driver.virtio.txmode) { virBufferAsprintf(buf, " txmode='%s'", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c19dfc5470..61d2ee819b 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -975,12 +975,12 @@ typedef enum { /* the backend driver used for virtio interfaces */ typedef enum { - VIR_DOMAIN_NET_BACKEND_TYPE_DEFAULT = 0, /* prefer kernel, fall back to user */ - VIR_DOMAIN_NET_BACKEND_TYPE_QEMU, /* userland */ - VIR_DOMAIN_NET_BACKEND_TYPE_VHOST, /* kernel */ + VIR_DOMAIN_NET_DRIVER_TYPE_DEFAULT = 0, /* prefer kernel, fall back to user */ + VIR_DOMAIN_NET_DRIVER_TYPE_QEMU, /* userland */ + VIR_DOMAIN_NET_DRIVER_TYPE_VHOST, /* kernel */ - VIR_DOMAIN_NET_BACKEND_TYPE_LAST -} virDomainNetBackendType; + VIR_DOMAIN_NET_DRIVER_TYPE_LAST +} virDomainNetDriverType; /* the TX algorithm used for virtio interfaces */ typedef enum { @@ -1062,7 +1062,7 @@ struct _virDomainNetDef { char *modelstr; union { struct { - virDomainNetBackendType name; /* which driver backend to use */ + virDomainNetDriverType name; /* which driver backend to use */ virDomainNetVirtioTxModeType txmode; virTristateSwitch ioeventfd; virTristateSwitch event_idx; @@ -4020,7 +4020,7 @@ VIR_ENUM_DECL(virDomainFSModel); VIR_ENUM_DECL(virDomainFSCacheMode); VIR_ENUM_DECL(virDomainFSSandboxMode); VIR_ENUM_DECL(virDomainNet); -VIR_ENUM_DECL(virDomainNetBackend); +VIR_ENUM_DECL(virDomainNetDriver); VIR_ENUM_DECL(virDomainNetVirtioTxMode); VIR_ENUM_DECL(virDomainNetMacType); VIR_ENUM_DECL(virDomainNetTeaming); diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c index 264d5e060c..b6895cedde 100644 --- a/src/qemu/qemu_interface.c +++ b/src/qemu/qemu_interface.c @@ -719,14 +719,14 @@ qemuInterfaceOpenVhostNet(virDomainObj *vm, /* If running a plain QEMU guest, or * if the config says explicitly to not use vhost, return now */ if (vm->def->virtType != VIR_DOMAIN_VIRT_KVM || - net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_QEMU) + net->driver.virtio.name == VIR_DOMAIN_NET_DRIVER_TYPE_QEMU) return 0; /* If qemu doesn't support vhost-net mode (including the -netdev and * -device command options), don't try to open the device. */ if (!qemuDomainSupportsNicdev(vm->def, net)) { - if (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_VHOST) { + if (net->driver.virtio.name == VIR_DOMAIN_NET_DRIVER_TYPE_VHOST) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("vhost-net is not supported with this QEMU binary")); return -1; @@ -736,7 +736,7 @@ qemuInterfaceOpenVhostNet(virDomainObj *vm, /* If the nic model isn't virtio, don't try to open. */ if (!virDomainNetIsVirtioModel(net)) { - if (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_VHOST) { + if (net->driver.virtio.name == VIR_DOMAIN_NET_DRIVER_TYPE_VHOST) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("vhost-net is only supported for virtio network interfaces")); return -1; @@ -753,7 +753,7 @@ qemuInterfaceOpenVhostNet(virDomainObj *vm, */ if (fd < 0) { virDomainAuditNetDevice(vm->def, net, vhostnet_path, false); - if (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_VHOST) { + if (net->driver.virtio.name == VIR_DOMAIN_NET_DRIVER_TYPE_VHOST) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("vhost-net was requested for an interface, but is unavailable")); return -1; diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 53a1cd1048..62a20ba0e8 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -1282,7 +1282,7 @@ get_files(vahControl * ctl) for (i = 0; i < ctl->def->nnets; i++) { virDomainNetDef *net = ctl->def->nets[i]; if (net && virDomainNetGetModelString(net)) { - if (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_QEMU) + if (net->driver.virtio.name == VIR_DOMAIN_NET_DRIVER_TYPE_QEMU) continue; if (!virDomainNetIsVirtioModel(net)) continue; -- 2.38.1