mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-29 20:11:16 +00:00
virNetClientStreamNew: Track origin stream
Add a virStreamPtr pointer to the _virNetClientStream in order to reverse track the parent stream. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
84b5079232
commit
8b6ffe4077
@ -6170,7 +6170,8 @@ remoteDomainMigratePrepareTunnel3(virConnectPtr dconn,
|
||||
memset(&args, 0, sizeof(args));
|
||||
memset(&ret, 0, sizeof(ret));
|
||||
|
||||
if (!(netst = virNetClientStreamNew(priv->remoteProgram,
|
||||
if (!(netst = virNetClientStreamNew(st,
|
||||
priv->remoteProgram,
|
||||
REMOTE_PROC_DOMAIN_MIGRATE_PREPARE_TUNNEL3,
|
||||
priv->counter)))
|
||||
goto done;
|
||||
@ -7094,7 +7095,8 @@ remoteDomainMigratePrepareTunnel3Params(virConnectPtr dconn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(netst = virNetClientStreamNew(priv->remoteProgram,
|
||||
if (!(netst = virNetClientStreamNew(st,
|
||||
priv->remoteProgram,
|
||||
REMOTE_PROC_DOMAIN_MIGRATE_PREPARE_TUNNEL3_PARAMS,
|
||||
priv->counter)))
|
||||
goto cleanup;
|
||||
|
@ -1738,7 +1738,7 @@ elsif ($mode eq "client") {
|
||||
|
||||
if ($call->{streamflag} ne "none") {
|
||||
print "\n";
|
||||
print " if (!(netst = virNetClientStreamNew(priv->remoteProgram, $call->{constname}, priv->counter)))\n";
|
||||
print " if (!(netst = virNetClientStreamNew(st, priv->remoteProgram, $call->{constname}, priv->counter)))\n";
|
||||
print " goto done;\n";
|
||||
print "\n";
|
||||
print " if (virNetClientAddStream(priv->client, netst) < 0) {\n";
|
||||
|
@ -36,6 +36,8 @@ VIR_LOG_INIT("rpc.netclientstream");
|
||||
struct _virNetClientStream {
|
||||
virObjectLockable parent;
|
||||
|
||||
virStreamPtr stream; /* Reverse pointer to parent stream */
|
||||
|
||||
virNetClientProgramPtr prog;
|
||||
int proc;
|
||||
unsigned serial;
|
||||
@ -133,7 +135,8 @@ virNetClientStreamEventTimer(int timer ATTRIBUTE_UNUSED, void *opaque)
|
||||
}
|
||||
|
||||
|
||||
virNetClientStreamPtr virNetClientStreamNew(virNetClientProgramPtr prog,
|
||||
virNetClientStreamPtr virNetClientStreamNew(virStreamPtr stream,
|
||||
virNetClientProgramPtr prog,
|
||||
int proc,
|
||||
unsigned serial)
|
||||
{
|
||||
@ -145,6 +148,7 @@ virNetClientStreamPtr virNetClientStreamNew(virNetClientProgramPtr prog,
|
||||
if (!(st = virObjectLockableNew(virNetClientStreamClass)))
|
||||
return NULL;
|
||||
|
||||
st->stream = virObjectRef(stream);
|
||||
st->prog = virObjectRef(prog);
|
||||
st->proc = proc;
|
||||
st->serial = serial;
|
||||
@ -163,6 +167,7 @@ void virNetClientStreamDispose(void *obj)
|
||||
virNetMessageFree(msg);
|
||||
}
|
||||
virObjectUnref(st->prog);
|
||||
virObjectUnref(st->stream);
|
||||
}
|
||||
|
||||
bool virNetClientStreamMatches(virNetClientStreamPtr st,
|
||||
|
@ -32,7 +32,8 @@ typedef virNetClientStream *virNetClientStreamPtr;
|
||||
typedef void (*virNetClientStreamEventCallback)(virNetClientStreamPtr stream,
|
||||
int events, void *opaque);
|
||||
|
||||
virNetClientStreamPtr virNetClientStreamNew(virNetClientProgramPtr prog,
|
||||
virNetClientStreamPtr virNetClientStreamNew(virStreamPtr stream,
|
||||
virNetClientProgramPtr prog,
|
||||
int proc,
|
||||
unsigned serial);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user