mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
conf: remove <backend upstream='xxx'/> attribute
This attribute was added to support setting the --interface option for passt, but in a post-push/pre-9.0-release review, danpb pointed out that it would be better to use the existing <source dev='xxx'/> attribute to set --interface rather than creating a new attribute (in the wrong place). So we remove backend/upstream, and change the passt commandline creation to grab the name for --interface from source/dev. Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
8ff8fe3f8a
commit
3592b81c4c
@ -4821,9 +4821,9 @@ destined for the host toward the guest instead.
|
|||||||
|
|
||||||
When the passt backend is used, the ``<backend>`` attribute
|
When the passt backend is used, the ``<backend>`` attribute
|
||||||
``logFile`` can be used to tell the passt process for this interface
|
``logFile`` can be used to tell the passt process for this interface
|
||||||
where to write its message log, and the ``<backend>`` attribute
|
where to write its message log, and the ``<source>`` attribute ``dev``
|
||||||
``upstream`` can tell it to restrict upstream traffic to a particular
|
can tell it to use a particular host interface to derive the routes
|
||||||
host interface.
|
given to the guest for forwarding traffic upstream.
|
||||||
|
|
||||||
Additionally, when passt is used, multiple ``<portForward>`` elements
|
Additionally, when passt is used, multiple ``<portForward>`` elements
|
||||||
can be added to forward incoming network traffic for the host to this
|
can be added to forward incoming network traffic for the host to this
|
||||||
@ -4855,8 +4855,9 @@ ports **with the exception of some subset**.
|
|||||||
<devices>
|
<devices>
|
||||||
...
|
...
|
||||||
<interface type='user'>
|
<interface type='user'>
|
||||||
<backend type='passt' logFile='/var/log/passt.log' upstream='eth0'/>
|
<backend type='passt' logFile='/var/log/passt.log'/>
|
||||||
<mac address="00:11:22:33:44:55"/>
|
<mac address="00:11:22:33:44:55"/>
|
||||||
|
<source dev='eth0'/>
|
||||||
<ip family='ipv4' address='172.17.2.0' prefix='24'/>
|
<ip family='ipv4' address='172.17.2.0' prefix='24'/>
|
||||||
<ip family='ipv6' address='2001:db8:ac10:fd01::' prefix='64'/>
|
<ip family='ipv6' address='2001:db8:ac10:fd01::' prefix='64'/>
|
||||||
<portForward proto='tcp' address='2001:db8:ac10:fd01::1:10' start='2022'>
|
<portForward proto='tcp' address='2001:db8:ac10:fd01::1:10' start='2022'>
|
||||||
|
@ -2715,6 +2715,7 @@ virDomainNetDefFree(virDomainNetDef *def)
|
|||||||
g_free(def->ifname_guest_actual);
|
g_free(def->ifname_guest_actual);
|
||||||
g_free(def->virtio);
|
g_free(def->virtio);
|
||||||
g_free(def->coalesce);
|
g_free(def->coalesce);
|
||||||
|
g_free(def->sourceDev);
|
||||||
|
|
||||||
virNetDevIPInfoClear(&def->guestIP);
|
virNetDevIPInfoClear(&def->guestIP);
|
||||||
virNetDevIPInfoClear(&def->hostIP);
|
virNetDevIPInfoClear(&def->hostIP);
|
||||||
@ -9038,7 +9039,6 @@ virDomainNetBackendParseXML(xmlNodePtr node,
|
|||||||
}
|
}
|
||||||
|
|
||||||
def->backend.logFile = virXMLPropString(node, "logFile");
|
def->backend.logFile = virXMLPropString(node, "logFile");
|
||||||
def->backend.upstream = virXMLPropString(node, "upstream");
|
|
||||||
|
|
||||||
if (tap)
|
if (tap)
|
||||||
def->backend.tap = virFileSanitizePath(tap);
|
def->backend.tap = virFileSanitizePath(tap);
|
||||||
@ -9464,6 +9464,9 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_NET_TYPE_USER:
|
case VIR_DOMAIN_NET_TYPE_USER:
|
||||||
|
def->sourceDev = virXMLPropString(source_node, "dev");
|
||||||
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_NET_TYPE_NULL:
|
case VIR_DOMAIN_NET_TYPE_NULL:
|
||||||
case VIR_DOMAIN_NET_TYPE_LAST:
|
case VIR_DOMAIN_NET_TYPE_LAST:
|
||||||
break;
|
break;
|
||||||
@ -23277,6 +23280,8 @@ virDomainActualNetDefContentsFormat(virBuffer *buf,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
virBufferAsprintf(buf, " mode='%s'", mode);
|
virBufferAsprintf(buf, " mode='%s'", mode);
|
||||||
|
} else if (actualType == VIR_DOMAIN_NET_TYPE_USER) {
|
||||||
|
virBufferEscapeString(buf, " dev='%s'", def->sourceDev);
|
||||||
}
|
}
|
||||||
|
|
||||||
virBufferAddLit(buf, "/>\n");
|
virBufferAddLit(buf, "/>\n");
|
||||||
@ -23487,7 +23492,6 @@ virDomainNetBackendFormat(virBuffer *buf,
|
|||||||
virBufferEscapeString(&attrBuf, " tap='%s'", backend->tap);
|
virBufferEscapeString(&attrBuf, " tap='%s'", backend->tap);
|
||||||
virBufferEscapeString(&attrBuf, " vhost='%s'", backend->vhost);
|
virBufferEscapeString(&attrBuf, " vhost='%s'", backend->vhost);
|
||||||
virBufferEscapeString(&attrBuf, " logFile='%s'", backend->logFile);
|
virBufferEscapeString(&attrBuf, " logFile='%s'", backend->logFile);
|
||||||
virBufferEscapeString(&attrBuf, " upstream='%s'", backend->upstream);
|
|
||||||
virXMLFormatElement(buf, "backend", &attrBuf, NULL);
|
virXMLFormatElement(buf, "backend", &attrBuf, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23752,6 +23756,13 @@ virDomainNetDefFormat(virBuffer *buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
case VIR_DOMAIN_NET_TYPE_USER:
|
case VIR_DOMAIN_NET_TYPE_USER:
|
||||||
|
if (def->backend.type == VIR_DOMAIN_NET_BACKEND_PASST &&
|
||||||
|
def->sourceDev) {
|
||||||
|
virBufferEscapeString(buf, "<source dev='%s'", def->sourceDev);
|
||||||
|
sourceLines++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_NET_TYPE_NULL:
|
case VIR_DOMAIN_NET_TYPE_NULL:
|
||||||
case VIR_DOMAIN_NET_TYPE_LAST:
|
case VIR_DOMAIN_NET_TYPE_LAST:
|
||||||
break;
|
break;
|
||||||
|
@ -1192,6 +1192,7 @@ struct _virDomainNetDef {
|
|||||||
virNetDevIPInfo hostIP;
|
virNetDevIPInfo hostIP;
|
||||||
char *ifname_guest_actual;
|
char *ifname_guest_actual;
|
||||||
char *ifname_guest;
|
char *ifname_guest;
|
||||||
|
char *sourceDev;
|
||||||
virNetDevIPInfo guestIP;
|
virNetDevIPInfo guestIP;
|
||||||
size_t nPortForwards;
|
size_t nPortForwards;
|
||||||
virDomainNetPortForward **portForwards;
|
virDomainNetPortForward **portForwards;
|
||||||
|
@ -3318,6 +3318,14 @@
|
|||||||
<value>user</value>
|
<value>user</value>
|
||||||
</attribute>
|
</attribute>
|
||||||
<interleave>
|
<interleave>
|
||||||
|
<optional>
|
||||||
|
<element name="source">
|
||||||
|
<attribute name="dev">
|
||||||
|
<ref name="deviceName"/>
|
||||||
|
</attribute>
|
||||||
|
<empty/>
|
||||||
|
</element>
|
||||||
|
</optional>
|
||||||
<ref name="interface-options"/>
|
<ref name="interface-options"/>
|
||||||
</interleave>
|
</interleave>
|
||||||
</group>
|
</group>
|
||||||
@ -3643,11 +3651,6 @@
|
|||||||
<ref name="absFilePath"/>
|
<ref name="absFilePath"/>
|
||||||
</attribute>
|
</attribute>
|
||||||
</optional>
|
</optional>
|
||||||
<optional>
|
|
||||||
<attribute name="upstream">
|
|
||||||
<ref name="deviceName"/>
|
|
||||||
</attribute>
|
|
||||||
</optional>
|
|
||||||
</element>
|
</element>
|
||||||
</optional>
|
</optional>
|
||||||
<optional>
|
<optional>
|
||||||
|
@ -167,8 +167,8 @@ qemuPasstStart(virDomainObj *vm,
|
|||||||
virCommandAddArgFormat(cmd, "%u", net->mtu);
|
virCommandAddArgFormat(cmd, "%u", net->mtu);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (net->backend.upstream)
|
if (net->sourceDev)
|
||||||
virCommandAddArgList(cmd, "--interface", net->backend.upstream, NULL);
|
virCommandAddArgList(cmd, "--interface", net->sourceDev, NULL);
|
||||||
|
|
||||||
if (net->backend.logFile)
|
if (net->backend.logFile)
|
||||||
virCommandAddArgList(cmd, "--log-file", net->backend.logFile, NULL);
|
virCommandAddArgList(cmd, "--log-file", net->backend.logFile, NULL);
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
<controller type='pci' index='0' model='pci-root'/>
|
<controller type='pci' index='0' model='pci-root'/>
|
||||||
<interface type='user'>
|
<interface type='user'>
|
||||||
<mac address='00:11:22:33:44:55'/>
|
<mac address='00:11:22:33:44:55'/>
|
||||||
|
<source dev='eth42'/>
|
||||||
<ip address='172.17.2.0' family='ipv4' prefix='24'/>
|
<ip address='172.17.2.0' family='ipv4' prefix='24'/>
|
||||||
<ip address='2001:db8:ac10:fd01::feed' family='ipv6'/>
|
<ip address='2001:db8:ac10:fd01::feed' family='ipv6'/>
|
||||||
<portForward proto='tcp' address='2001:db8:ac10:fd01::1:10'>
|
<portForward proto='tcp' address='2001:db8:ac10:fd01::1:10'>
|
||||||
@ -46,7 +47,7 @@
|
|||||||
<range start='443' to='344'/>
|
<range start='443' to='344'/>
|
||||||
</portForward>
|
</portForward>
|
||||||
<model type='rtl8139'/>
|
<model type='rtl8139'/>
|
||||||
<backend type='passt' logFile='/var/log/loglaw.blog' upstream='eth42'/>
|
<backend type='passt' logFile='/var/log/loglaw.blog'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
||||||
</interface>
|
</interface>
|
||||||
<input type='mouse' bus='ps2'/>
|
<input type='mouse' bus='ps2'/>
|
||||||
|
Loading…
Reference in New Issue
Block a user