[libvirt] [PATCH] qemu: don't use initialized ret in qemuRemoveSharedDevice

This fixes CC qemu/libvirt_driver_qemu_impl_la-qemu_conf.lo qemu/qemu_conf.c: In function 'qemuRemoveSharedDevice': qemu/qemu_conf.c:1384:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] --- This is only catched by Debian Wheezy's gcc 4.7.2, Jessies gcc 4.9.2 doesn't trap on it. src/qemu/qemu_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 2ab5494..38d4a86 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1381,7 +1381,7 @@ qemuRemoveSharedHostdev(virQEMUDriverPtr driver, { char *dev_path = NULL; char *key = NULL; - int ret; + int ret = -1; if (!qemuIsSharedHostdev(hostdev)) return 0; -- 2.1.4

On Thu, Jul 09, 2015 at 19:22:30 +0200, Guido Günther wrote:
This fixes
CC qemu/libvirt_driver_qemu_impl_la-qemu_conf.lo qemu/qemu_conf.c: In function 'qemuRemoveSharedDevice': qemu/qemu_conf.c:1384:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] --- This is only catched by Debian Wheezy's gcc 4.7.2, Jessies gcc 4.9.2 doesn't trap on it.
src/qemu/qemu_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Oops. I've missed that in my review. ACK if you didn't push this already. Peter

Hi, On Thu, Jul 09, 2015 at 07:28:34PM +0200, Peter Krempa wrote:
On Thu, Jul 09, 2015 at 19:22:30 +0200, Guido Günther wrote:
This fixes
CC qemu/libvirt_driver_qemu_impl_la-qemu_conf.lo qemu/qemu_conf.c: In function 'qemuRemoveSharedDevice': qemu/qemu_conf.c:1384:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] --- This is only catched by Debian Wheezy's gcc 4.7.2, Jessies gcc 4.9.2 doesn't trap on it.
src/qemu/qemu_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Oops. I've missed that in my review. ACK if you didn't push this already.
Thanks for the quick response! I would have pushed this under the build breaker rule but since I'm a bit disconnected with the ML at the moment I thought I'd rather post a patch first. Pushed now. Thanks! -- Guido

On 07/09/2015 01:28 PM, Peter Krempa wrote:
On Thu, Jul 09, 2015 at 19:22:30 +0200, Guido Günther wrote:
This fixes
CC qemu/libvirt_driver_qemu_impl_la-qemu_conf.lo qemu/qemu_conf.c: In function 'qemuRemoveSharedDevice': qemu/qemu_conf.c:1384:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] --- This is only catched by Debian Wheezy's gcc 4.7.2, Jessies gcc 4.9.2 doesn't trap on it.
src/qemu/qemu_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Oops. I've missed that in my review. ACK if you didn't push this already.
Well it was there in the patch that got removed <sigh> http://www.redhat.com/archives/libvir-list/2015-July/msg00209.html Sorry about that John
participants (3)
-
Guido Günther
-
John Ferlan
-
Peter Krempa