From: "Daniel P. Berrange" <berrange(a)redhat.com>
Append privateData of the client only if there are any, otherwise the
previous value (socket data) will get there again.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/rpc/virnetserverclient.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index 34c199445401..0e3a71f9b271 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -536,13 +536,14 @@ virJSONValuePtr
virNetServerClientPreExecRestart(virNetServerClientPtr client)
goto error;
}
- if (client->privateData && client->privateDataPreExecRestart
&&
- !(child = client->privateDataPreExecRestart(client, client->privateData)))
- goto error;
+ if (client->privateData && client->privateDataPreExecRestart) {
+ if (!(child = client->privateDataPreExecRestart(client,
client->privateData)))
+ goto error;
- if (virJSONValueObjectAppend(object, "privateData", child) < 0) {
- virJSONValueFree(child);
- goto error;
+ if (virJSONValueObjectAppend(object, "privateData", child) < 0) {
+ virJSONValueFree(child);
+ goto error;
+ }
}
virObjectUnlock(client);
--
2.4.2