diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 4a16b8ef1d..307f9ca945 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -5663,10 +5663,7 @@ remoteDomainMigratePrepareTunnel3(virConnectPtr dconn, false))) return -1; - if (virNetClientAddStream(priv->client, netst) < 0) { - virObjectUnref(netst); - return -1; - } + virNetClientAddStream(priv->client, netst); st->driver = &remoteStreamDrv; st->privateData = netst; @@ -6432,10 +6429,7 @@ remoteDomainMigratePrepareTunnel3Params(virConnectPtr dconn, false))) goto cleanup; - if (virNetClientAddStream(priv->client, netst) < 0) { - virObjectUnref(netst); - goto cleanup; - } + virNetClientAddStream(priv->client, netst); st->driver = &remoteStreamDrv; st->privateData = netst; diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index c5842dc796..724a6aed6e 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -1822,10 +1822,7 @@ elsif ($mode eq "client") { print " if (!(netst = virNetClientStreamNew(priv->remoteProgram, $call->{constname}, priv->counter, sparse)))\n"; print " goto cleanup;\n"; print "\n"; - print " if (virNetClientAddStream(priv->client, netst) < 0) {\n"; - print " virObjectUnref(netst);\n"; - print " goto cleanup;\n"; - print " }"; + print " virNetClientAddStream(priv->client, netst);\n"; print "\n"; print " st->driver = &remoteStreamDrv;\n"; print " st->privateData = netst;\n"; diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 62d2368c9a..92933220e2 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -1065,8 +1065,8 @@ void virNetClientAddProgram(virNetClient *client, } -int virNetClientAddStream(virNetClient *client, - virNetClientStream *st) +void virNetClientAddStream(virNetClient *client, + virNetClientStream *st) { virObjectLock(client); @@ -1074,7 +1074,6 @@ int virNetClientAddStream(virNetClient *client, client->streams[client->nstreams-1] = virObjectRef(st); virObjectUnlock(client); - return 0; } diff --git a/src/rpc/virnetclient.h b/src/rpc/virnetclient.h index ade3f8babe..d21dd089d8 100644 --- a/src/rpc/virnetclient.h +++ b/src/rpc/virnetclient.h @@ -120,8 +120,8 @@ bool virNetClientHasPassFD(virNetClient *client); void virNetClientAddProgram(virNetClient *client, virNetClientProgram *prog); -int virNetClientAddStream(virNetClient *client, - virNetClientStream *st); +void virNetClientAddStream(virNetClient *client, + virNetClientStream *st); void virNetClientRemoveStream(virNetClient *client, virNetClientStream *st);