Re: [PATCH] Ensure to zero out the virDomainBlockJobInfo arg

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

 



On 12/02/2013 09:57 AM, Daniel P. Berrange wrote:
> 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(+)

ACK.

> 
> 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);
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]