[libvirt] [PATCH] qemu: Properly check return value of VIR_STRDUP in qemuDomainGetBlockIoTune

Peter Krempa pkrempa at redhat.com
Tue May 23 15:40:13 UTC 2017

Setting the 'group_name' for a disk would falsely trigger a error path
as in commit 4b57f76502 we did not properly check the return value of
I must have forgotten to commit this change, as I'm sure I've tested it prior
to sending the patch mentioned above.

 src/qemu/qemu_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 6c79d4fe3..cd513ff9f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17748,7 +17748,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,

         /* Group name needs to be copied since qemuMonitorGetBlockIoThrottle
          * allocates it as well */
-        if (VIR_STRDUP(reply.group_name, disk->blkdeviotune.group_name))
+        if (VIR_STRDUP(reply.group_name, disk->blkdeviotune.group_name) < 0)
             goto endjob;


More information about the libvir-list mailing list