mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Fix bridge/tap system error reporting
* src/qemu_conf.c, src/uml_conf.c: use virReportSystemError() to report system errors
This commit is contained in:
parent
2b1f67d418
commit
3ec80d0112
@ -1060,11 +1060,9 @@ qemudNetworkIfaceConnect(virConnectPtr conn,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char ebuf[1024];
|
|
||||||
if (!driver->brctl && (err = brInit(&driver->brctl))) {
|
if (!driver->brctl && (err = brInit(&driver->brctl))) {
|
||||||
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
virReportSystemError(conn, err, "%s",
|
||||||
_("cannot initialize bridge support: %s"),
|
_("cannot initialize bridge support"));
|
||||||
virStrerror(err, ebuf, sizeof ebuf));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1092,14 +1090,13 @@ qemudNetworkIfaceConnect(virConnectPtr conn,
|
|||||||
_("Failed to add tap interface to bridge. "
|
_("Failed to add tap interface to bridge. "
|
||||||
"%s is not a bridge device"), brname);
|
"%s is not a bridge device"), brname);
|
||||||
} else if (template_ifname) {
|
} else if (template_ifname) {
|
||||||
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
virReportSystemError(conn, err,
|
||||||
_("Failed to add tap interface to bridge '%s' : %s"),
|
_("Failed to add tap interface to bridge '%s'"),
|
||||||
brname, virStrerror(err, ebuf, sizeof ebuf));
|
brname);
|
||||||
} else {
|
} else {
|
||||||
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
virReportSystemError(conn, err,
|
||||||
_("Failed to add tap interface '%s' "
|
_("Failed to add tap interface '%s' to bridge '%s'"),
|
||||||
"to bridge '%s' : %s"),
|
net->ifname, brname);
|
||||||
net->ifname, brname, virStrerror(err, ebuf, sizeof ebuf));
|
|
||||||
}
|
}
|
||||||
if (template_ifname)
|
if (template_ifname)
|
||||||
VIR_FREE(net->ifname);
|
VIR_FREE(net->ifname);
|
||||||
|
@ -110,10 +110,8 @@ umlConnectTapDevice(virConnectPtr conn,
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
if ((err = brInit(&brctl))) {
|
if ((err = brInit(&brctl))) {
|
||||||
char ebuf[1024];
|
virReportSystemError(conn, err, "%s",
|
||||||
umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
_("cannot initialize bridge support"));
|
||||||
_("cannot initialize bridge support: %s"),
|
|
||||||
virStrerror(err, ebuf, sizeof ebuf));
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,16 +133,13 @@ umlConnectTapDevice(virConnectPtr conn,
|
|||||||
_("Failed to add tap interface to bridge. "
|
_("Failed to add tap interface to bridge. "
|
||||||
"%s is not a bridge device"), bridge);
|
"%s is not a bridge device"), bridge);
|
||||||
} else if (template_ifname) {
|
} else if (template_ifname) {
|
||||||
char ebuf[1024];
|
virReportSystemError(conn, err,
|
||||||
umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
_("Failed to add tap interface to bridge '%s'"),
|
||||||
_("Failed to add tap interface to bridge '%s' : %s"),
|
bridge);
|
||||||
bridge, virStrerror(err, ebuf, sizeof ebuf));
|
|
||||||
} else {
|
} else {
|
||||||
char ebuf[1024];
|
virReportSystemError(conn, err,
|
||||||
umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
_("Failed to add tap interface '%s' to bridge '%s'"),
|
||||||
_("Failed to add tap interface '%s' "
|
net->ifname, bridge);
|
||||||
"to bridge '%s' : %s"),
|
|
||||||
net->ifname, bridge, virStrerror(err, ebuf, sizeof ebuf));
|
|
||||||
}
|
}
|
||||||
if (template_ifname)
|
if (template_ifname)
|
||||||
VIR_FREE(net->ifname);
|
VIR_FREE(net->ifname);
|
||||||
|
Loading…
Reference in New Issue
Block a user