render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
c401cc
From 220c719f328e9092c9e0eaf1cc4cd60322acddf6 Mon Sep 17 00:00:00 2001
c401cc
Message-Id: <220c719f328e9092c9e0eaf1cc4cd60322acddf6.1386348946.git.jdenemar@redhat.com>
c401cc
From: "Daniel P. Berrange" <berrange@redhat.com>
c401cc
Date: Mon, 2 Dec 2013 17:36:34 +0000
c401cc
Subject: [PATCH] Ensure to zero out the virDomainBlockJobInfo arg
c401cc
c401cc
For
c401cc
c401cc
  https://bugzilla.redhat.com/show_bug.cgi?id=1028846
c401cc
c401cc
The virDomainGetBlockJobInfo method did not zero out the
c401cc
virDomainBlockJobInfo pointer arg, so when block jobs were
c401cc
not active it would return garbage for the bandwidth/cur/end
c401cc
fields.
c401cc
c401cc
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
c401cc
(cherry picked from commit 4cac241a7b120c95221237a3961fc758f9b7a72e)
c401cc
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c401cc
---
c401cc
 src/libvirt.c | 2 ++
c401cc
 1 file changed, 2 insertions(+)
c401cc
c401cc
diff --git a/src/libvirt.c b/src/libvirt.c
c401cc
index e008368..31600e8 100644
c401cc
--- a/src/libvirt.c
c401cc
+++ b/src/libvirt.c
c401cc
@@ -20780,6 +20780,8 @@ int virDomainGetBlockJobInfo(virDomainPtr dom, const char *disk,
c401cc
     virCheckNonNullArgGoto(disk, error);
c401cc
     virCheckNonNullArgGoto(info, error);
c401cc
 
c401cc
+    memset(info, 0, sizeof(*info));
c401cc
+
c401cc
     if (conn->driver->domainGetBlockJobInfo) {
c401cc
         int ret;
c401cc
         ret = conn->driver->domainGetBlockJobInfo(dom, disk, info, flags);
c401cc
-- 
c401cc
1.8.4.5
c401cc