Hi Vladimir,

On 18/8/25 16:06, Vladimir Sementsov-Ogievskiy wrote:
To avoid error propagation, let's follow common recommendation to
use return value together with errp.

(looking at commit e3fe3988d78 "error: Document Error API usage rules"
again). While not return a boolean?


Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@yandex-team.ru>
---
  net/tap.c | 55 +++++++++++++++++++++++++------------------------------
  1 file changed, 25 insertions(+), 30 deletions(-)

diff --git a/net/tap.c b/net/tap.c
index f7df702f97..531ef75e91 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -680,11 +680,11 @@ static int net_tap_init(const NetdevTapOptions *tap, int 
*vnet_hdr,
#define MAX_TAP_QUEUES 1024 -static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
-                             const char *model, const char *name,
-                             const char *ifname, const char *script,
-                             const char *downscript, const char *vhostfdname,
-                             int vnet_hdr, int fd, Error **errp)
+static int net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
+                            const char *model, const char *name,
+                            const char *ifname, const char *script,
+                            const char *downscript, const char *vhostfdname,
+                            int vnet_hdr, int fd, Error **errp)
  {
      Error *err = NULL;
      TAPState *s = net_tap_fd_init(peer, model, name, fd, vnet_hdr);
@@ -765,10 +765,11 @@ static void net_init_tap_one(const NetdevTapOptions *tap, 
NetClientState *peer,
          goto failed;
      }
- return;
+    return 0;
failed:
      qemu_del_net_client(&s->nc);
+    return -1;
  }


Reply via email to