render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
Blob Blame History Raw
From 220c719f328e9092c9e0eaf1cc4cd60322acddf6 Mon Sep 17 00:00:00 2001
Message-Id: <220c719f328e9092c9e0eaf1cc4cd60322acddf6.1386348946.git.jdenemar@redhat.com>
From: "Daniel P. Berrange" <berrange@redhat.com>
Date: Mon, 2 Dec 2013 17:36:34 +0000
Subject: [PATCH] Ensure to zero out the virDomainBlockJobInfo arg

For

  https://bugzilla.redhat.com/show_bug.cgi?id=1028846

The virDomainGetBlockJobInfo method did not zero out the
virDomainBlockJobInfo pointer arg, so when block jobs were
not active it would return garbage for the bandwidth/cur/end
fields.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit 4cac241a7b120c95221237a3961fc758f9b7a72e)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/libvirt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/libvirt.c b/src/libvirt.c
index e008368..31600e8 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -20780,6 +20780,8 @@ int virDomainGetBlockJobInfo(virDomainPtr dom, const char *disk,
     virCheckNonNullArgGoto(disk, error);
     virCheckNonNullArgGoto(info, error);
 
+    memset(info, 0, sizeof(*info));
+
     if (conn->driver->domainGetBlockJobInfo) {
         int ret;
         ret = conn->driver->domainGetBlockJobInfo(dom, disk, info, flags);
-- 
1.8.4.5