[libvirt] [PATCH 1/2] qemu: Use the return value of virObjectRef directly

Michal Privoznik mprivozn at redhat.com
Mon Feb 5 09:35:32 UTC 2018


On 02/02/2018 01:13 PM, Marc Hartmayer wrote:
> Use the return value of virObjectRef directly. This way, it's easier
> for another reader to identify the reason why the additional reference
> is required.
> 
> Signed-off-by: Marc Hartmayer <mhartmay at linux.vnet.ibm.com>
> Reviewed-by: Boris Fiuczynski <fiuczy at linux.vnet.ibm.com>
> Reviewed-by: Bjoern Walk <bwalk at linux.vnet.ibm.com>
> ---
>  src/qemu/qemu_process.c | 19 +++++++------------
>  1 file changed, 7 insertions(+), 12 deletions(-)

Missed one:

diff --git i/src/qemu/qemu_process.c w/src/qemu/qemu_process.c
index c17a6e9ab..342339d5f 100644
--- i/src/qemu/qemu_process.c
+++ w/src/qemu/qemu_process.c
@@ -1033,11 +1033,10 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
         if (VIR_STRDUP(data, diskAlias) < 0)
             goto error;
         processEvent->data = data;
-        processEvent->vm = vm;
+        processEvent->vm = virObjectRef(vm);
         processEvent->action = type;
         processEvent->status = status;
 
-        virObjectRef(vm);
         if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
             ignore_value(virObjectUnref(vm));
             goto error;

ACK with this squashed in.

Michal




More information about the libvir-list mailing list