mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
conf: rename virDomainNetBackend* to virDomainNetDriver*
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@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
49ff47269b
commit
d3307a8fd2
@ -604,8 +604,8 @@ VIR_ENUM_IMPL(virDomainNetModel,
|
|||||||
"82543GC",
|
"82543GC",
|
||||||
);
|
);
|
||||||
|
|
||||||
VIR_ENUM_IMPL(virDomainNetBackend,
|
VIR_ENUM_IMPL(virDomainNetDriver,
|
||||||
VIR_DOMAIN_NET_BACKEND_TYPE_LAST,
|
VIR_DOMAIN_NET_DRIVER_TYPE_LAST,
|
||||||
"default",
|
"default",
|
||||||
"qemu",
|
"qemu",
|
||||||
"vhost",
|
"vhost",
|
||||||
@ -8880,7 +8880,7 @@ virDomainNetDefParseXMLDriver(virDomainNetDef *def,
|
|||||||
xmlNodePtr guestNode;
|
xmlNodePtr guestNode;
|
||||||
|
|
||||||
if (virXMLPropEnum(driver_node, "name",
|
if (virXMLPropEnum(driver_node, "name",
|
||||||
virDomainNetBackendTypeFromString,
|
virDomainNetDriverTypeFromString,
|
||||||
VIR_XML_PROP_NONZERO,
|
VIR_XML_PROP_NONZERO,
|
||||||
&def->driver.virtio.name) < 0)
|
&def->driver.virtio.name) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -23233,7 +23233,7 @@ virDomainVirtioNetDriverFormat(virBuffer *buf,
|
|||||||
{
|
{
|
||||||
if (def->driver.virtio.name) {
|
if (def->driver.virtio.name) {
|
||||||
virBufferAsprintf(buf, " name='%s'",
|
virBufferAsprintf(buf, " name='%s'",
|
||||||
virDomainNetBackendTypeToString(def->driver.virtio.name));
|
virDomainNetDriverTypeToString(def->driver.virtio.name));
|
||||||
}
|
}
|
||||||
if (def->driver.virtio.txmode) {
|
if (def->driver.virtio.txmode) {
|
||||||
virBufferAsprintf(buf, " txmode='%s'",
|
virBufferAsprintf(buf, " txmode='%s'",
|
||||||
|
@ -975,12 +975,12 @@ typedef enum {
|
|||||||
|
|
||||||
/* the backend driver used for virtio interfaces */
|
/* the backend driver used for virtio interfaces */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
VIR_DOMAIN_NET_BACKEND_TYPE_DEFAULT = 0, /* prefer kernel, fall back to user */
|
VIR_DOMAIN_NET_DRIVER_TYPE_DEFAULT = 0, /* prefer kernel, fall back to user */
|
||||||
VIR_DOMAIN_NET_BACKEND_TYPE_QEMU, /* userland */
|
VIR_DOMAIN_NET_DRIVER_TYPE_QEMU, /* userland */
|
||||||
VIR_DOMAIN_NET_BACKEND_TYPE_VHOST, /* kernel */
|
VIR_DOMAIN_NET_DRIVER_TYPE_VHOST, /* kernel */
|
||||||
|
|
||||||
VIR_DOMAIN_NET_BACKEND_TYPE_LAST
|
VIR_DOMAIN_NET_DRIVER_TYPE_LAST
|
||||||
} virDomainNetBackendType;
|
} virDomainNetDriverType;
|
||||||
|
|
||||||
/* the TX algorithm used for virtio interfaces */
|
/* the TX algorithm used for virtio interfaces */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -1062,7 +1062,7 @@ struct _virDomainNetDef {
|
|||||||
char *modelstr;
|
char *modelstr;
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
virDomainNetBackendType name; /* which driver backend to use */
|
virDomainNetDriverType name;
|
||||||
virDomainNetVirtioTxModeType txmode;
|
virDomainNetVirtioTxModeType txmode;
|
||||||
virTristateSwitch ioeventfd;
|
virTristateSwitch ioeventfd;
|
||||||
virTristateSwitch event_idx;
|
virTristateSwitch event_idx;
|
||||||
@ -4051,7 +4051,7 @@ VIR_ENUM_DECL(virDomainFSModel);
|
|||||||
VIR_ENUM_DECL(virDomainFSCacheMode);
|
VIR_ENUM_DECL(virDomainFSCacheMode);
|
||||||
VIR_ENUM_DECL(virDomainFSSandboxMode);
|
VIR_ENUM_DECL(virDomainFSSandboxMode);
|
||||||
VIR_ENUM_DECL(virDomainNet);
|
VIR_ENUM_DECL(virDomainNet);
|
||||||
VIR_ENUM_DECL(virDomainNetBackend);
|
VIR_ENUM_DECL(virDomainNetDriver);
|
||||||
VIR_ENUM_DECL(virDomainNetVirtioTxMode);
|
VIR_ENUM_DECL(virDomainNetVirtioTxMode);
|
||||||
VIR_ENUM_DECL(virDomainNetMacType);
|
VIR_ENUM_DECL(virDomainNetMacType);
|
||||||
VIR_ENUM_DECL(virDomainNetTeaming);
|
VIR_ENUM_DECL(virDomainNetTeaming);
|
||||||
|
@ -719,14 +719,14 @@ qemuInterfaceOpenVhostNet(virDomainObj *vm,
|
|||||||
/* If running a plain QEMU guest, or
|
/* If running a plain QEMU guest, or
|
||||||
* if the config says explicitly to not use vhost, return now */
|
* if the config says explicitly to not use vhost, return now */
|
||||||
if (vm->def->virtType != VIR_DOMAIN_VIRT_KVM ||
|
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;
|
return 0;
|
||||||
|
|
||||||
/* If qemu doesn't support vhost-net mode (including the -netdev and
|
/* If qemu doesn't support vhost-net mode (including the -netdev and
|
||||||
* -device command options), don't try to open the device.
|
* -device command options), don't try to open the device.
|
||||||
*/
|
*/
|
||||||
if (!qemuDomainSupportsNicdev(vm->def, net)) {
|
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",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("vhost-net is not supported with this QEMU binary"));
|
_("vhost-net is not supported with this QEMU binary"));
|
||||||
return -1;
|
return -1;
|
||||||
@ -736,7 +736,7 @@ qemuInterfaceOpenVhostNet(virDomainObj *vm,
|
|||||||
|
|
||||||
/* If the nic model isn't virtio, don't try to open. */
|
/* If the nic model isn't virtio, don't try to open. */
|
||||||
if (!virDomainNetIsVirtioModel(net)) {
|
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",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("vhost-net is only supported for virtio network interfaces"));
|
_("vhost-net is only supported for virtio network interfaces"));
|
||||||
return -1;
|
return -1;
|
||||||
@ -753,7 +753,7 @@ qemuInterfaceOpenVhostNet(virDomainObj *vm,
|
|||||||
*/
|
*/
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
virDomainAuditNetDevice(vm->def, net, vhostnet_path, false);
|
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",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("vhost-net was requested for an interface, but is unavailable"));
|
_("vhost-net was requested for an interface, but is unavailable"));
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -1283,7 +1283,7 @@ get_files(vahControl * ctl)
|
|||||||
for (i = 0; i < ctl->def->nnets; i++) {
|
for (i = 0; i < ctl->def->nnets; i++) {
|
||||||
virDomainNetDef *net = ctl->def->nets[i];
|
virDomainNetDef *net = ctl->def->nets[i];
|
||||||
if (net && virDomainNetGetModelString(net)) {
|
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;
|
continue;
|
||||||
if (!virDomainNetIsVirtioModel(net))
|
if (!virDomainNetIsVirtioModel(net))
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user