Re: [PATCH] qemu: fix text block info parsing

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

 



On 10/13/2011 03:15 AM, Daniel Veillard wrote:
On Wed, Oct 12, 2011 at 06:30:08PM -0600, Eric Blake wrote:
Detected by Coverity.  p (the pointer to the string) is always true;
when in reality, we wanted to know whether the integer value of the
just-parsed string is '0' or '1'.  Logic bug since commit b1b5b51.

* src/qemu/qemu_monitor_text.c (qemuMonitorTextGetBlockInfo): Set
results to proper value.
---


-                        info->removable = p != NULL;
+                        info->removable = tmp != 0;

   I would be tempted to put braces
                            info->removable = (tmp != 0);
to make it obvious that the second part is computation, not cascaded
affectations

Done,


   But it's cosmetic, ACK

and pushed.

--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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