Bug 715184

Summary: when compiling libvirt src rpmball, it generates warning: 'ret' may be used uninitialized in 'qemuMonitorJSONAddDrive'
Product: Red Hat Enterprise Linux 6 Reporter: Gunannan Ren <gren>
Component: libvirtAssignee: Eric Blake <eblake>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: dallan, eblake, rwu, veillard
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.9.3-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 11:15:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
proposed patch none

Description Gunannan Ren 2011-06-22 06:31:50 UTC
Description of problem:
When compiling libvirt-0.9.2-1.el6.src.rpm on x86_64 machine, it produced the following error informations

...
  CC     libvirt_driver_qemu_la-qemu_monitor_json.lo
  CC     libvirt_driver_qemu_la-qemu_driver.lo
qemu/qemu_monitor_json.c: In function 'qemuMonitorJSONAddDrive':
qemu/qemu_monitor_json.c:2468: warning: 'ret' may be used uninitialized in this function [-Wuninitialized]
  CC     libvirt_driver_qemu_la-qemu_bridge_filter.lo
  CC     libvirt_driver_lxc_la-lxc_conf.lo
...


Version-Release number of selected component (if applicable):
libvirt-0.9.2-1.el6.src.rpm

How reproducible:
always

Steps to Reproduce:
1.install the libvirt-0.9.2-1.el6.src.rpm
2. cd /root/rpmbuild/SPECS
3. rpmbuild -bb libvirt.spec

  
Actual results:
it showed warning info.

Expected results:
no warning info.

Additional info:

Comment 1 Gunannan Ren 2011-06-22 06:33:46 UTC
Created attachment 505917 [details]
proposed patch

I tried to initialize the ret variable to -1, it works.

Comment 3 Eric Blake 2011-06-22 13:27:03 UTC
Confirmed; the bug is RHEL-specific, due to a flaw in the libvirt-Support-virtio-disk-hotplug-in-JSON-mode.patch

Comment 4 Eric Blake 2011-06-22 14:26:06 UTC
I've incorporated Gunannan's patch into this respin:
http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-June/msg00349.html

Comment 5 Daniel Veillard 2011-06-23 03:44:03 UTC
I missed this when doing the rebase for libvirt-0.9.2-1.el6, it will be
in the next build,

Daniel

Comment 7 Gunannan Ren 2011-07-06 09:25:41 UTC
This bug has been verified on libvirt-0.9.3-1.el6.

Comment 8 errata-xmlrpc 2011-12-06 11:15:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1513.html