mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
Make umlConnectTapDevice ask brAddTap for a persistent tap device.
This patch does two things: * It makes umlConnectTapDevice ask brAddTap for a persistent tap by passing it a NULL tapfd argument. * Stops umlConnectTapDevice from immediately dismantling the bridge it just set up. Signed-off-by: Soren Hansen <soren@linux2go.dk>
This commit is contained in:
parent
4358f76aa4
commit
b9e1f11a2d
@ -112,7 +112,6 @@ umlConnectTapDevice(virDomainNetDefPtr net,
|
|||||||
const char *bridge)
|
const char *bridge)
|
||||||
{
|
{
|
||||||
brControl *brctl = NULL;
|
brControl *brctl = NULL;
|
||||||
int tapfd = -1;
|
|
||||||
int template_ifname = 0;
|
int template_ifname = 0;
|
||||||
int err;
|
int err;
|
||||||
unsigned char tapmac[VIR_MAC_BUFLEN];
|
unsigned char tapmac[VIR_MAC_BUFLEN];
|
||||||
@ -140,7 +139,7 @@ umlConnectTapDevice(virDomainNetDefPtr net,
|
|||||||
&net->ifname,
|
&net->ifname,
|
||||||
tapmac,
|
tapmac,
|
||||||
0,
|
0,
|
||||||
&tapfd))) {
|
NULL))) {
|
||||||
if (err == ENOTSUP) {
|
if (err == ENOTSUP) {
|
||||||
/* In this particular case, give a better diagnostic. */
|
/* In this particular case, give a better diagnostic. */
|
||||||
umlReportError(VIR_ERR_INTERNAL_ERROR,
|
umlReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
@ -164,7 +163,6 @@ umlConnectTapDevice(virDomainNetDefPtr net,
|
|||||||
VIR_FREE(net->ifname);
|
VIR_FREE(net->ifname);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
close(tapfd);
|
|
||||||
|
|
||||||
brShutdown(brctl);
|
brShutdown(brctl);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user