提交 7587855c 编写于 作者: J Julia Suvorova via Qemu-devel 提交者: Jason Wang

net/vde: print error on vde_open() failure

Despite the fact that now when the initialization of vde fails, qemu
does not end silently, no informative error is printed. The patch
generates an error and pushes it through the calling function.

Related bug: https://bugs.launchpad.net/qemu/+bug/676029Signed-off-by: NJulia Suvorova <jusual@mail.ru>
Signed-off-by: NJason Wang <jasowang@redhat.com>
上级 94b52958
......@@ -30,6 +30,7 @@
#include "qemu-common.h"
#include "qemu/option.h"
#include "qemu/main-loop.h"
#include "qapi/error.h"
typedef struct VDEState {
NetClientState nc;
......@@ -76,7 +77,7 @@ static NetClientInfo net_vde_info = {
static int net_vde_init(NetClientState *peer, const char *model,
const char *name, const char *sock,
int port, const char *group, int mode)
int port, const char *group, int mode, Error **errp)
{
NetClientState *nc;
VDEState *s;
......@@ -92,6 +93,7 @@ static int net_vde_init(NetClientState *peer, const char *model,
vde = vde_open(init_sock, (char *)"QEMU", &args);
if (!vde){
error_setg_errno(errp, errno, "Could not open vde");
return -1;
}
......@@ -112,7 +114,6 @@ static int net_vde_init(NetClientState *peer, const char *model,
int net_init_vde(const Netdev *netdev, const char *name,
NetClientState *peer, Error **errp)
{
/* FIXME error_setg(errp, ...) on failure */
const NetdevVdeOptions *vde;
assert(netdev->type == NET_CLIENT_DRIVER_VDE);
......@@ -120,7 +121,7 @@ int net_init_vde(const Netdev *netdev, const char *name,
/* missing optional values have been initialized to "all bits zero" */
if (net_vde_init(peer, "vde", name, vde->sock, vde->port, vde->group,
vde->has_mode ? vde->mode : 0700) == -1) {
vde->has_mode ? vde->mode : 0700, errp) == -1) {
return -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册