mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-21 21:25:25 +00:00
rpc: Change return type of virNetClientAddStream to void
This function return value is invariant since VIR_EXPAND_N check
removal in 7d2fd6e
, so change its type and remove all dependent checks.
Found by Linux Verification Center (linuxtesting.org) with Svace.
Reported-by: Pavel Nekrasov <p.nekrasov@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
b0da352c58
commit
f3179d5abe
@ -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;
|
||||
|
@ -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";
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user