[PATCH] Ensure to zero out the virDomainBlockJobInfo arg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 src/libvirt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/libvirt.c b/src/libvirt.c
index eff44eb..a2df53d 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -20850,6 +20850,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.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]