[PATCH v3 3/4] qemu: adopt to VIR_DRV_SUPPORTS_FEATURE return -1

Nikolay Shirokovskiy nshirokovskiy at virtuozzo.com
Wed Jan 6 15:49:56 UTC 2021


Sorry, looks like I'm compiling with debug options and missed this error.
It was a deliberate change but compiler don't like it.

The build fix is pushed.

Nikolay

On Wed, Jan 6, 2021 at 5:44 PM Daniel P. Berrangé <berrange at redhat.com>
wrote:

> On Fri, Dec 18, 2020 at 09:56:47AM +0300, Nikolay Shirokovskiy wrote:
> > Otherwise in some places we can mistakenly report 'unsupported' error
> instead
> > of root cause. So let's handle root cause explicitly from the macro.
> >
> > Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy at virtuozzo.com>
> > ---
> >  src/qemu/qemu_migration.c | 33 ++++++++++++++++++++++-----------
> >  1 file changed, 22 insertions(+), 11 deletions(-)
> >
> > diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> > index 90b0ec9..fca21be 100644
> > --- a/src/qemu/qemu_migration.c
> > +++ b/src/qemu/qemu_migration.c
> > @@ -4706,12 +4706,13 @@
> qemuMigrationSrcPerformPeer2Peer(virQEMUDriverPtr driver,
> >  {
> >      int ret = -1;
> >      g_autoptr(virConnect) dconn = NULL;
> > -    bool p2p;
> > +    int p2p;
> >      virErrorPtr orig_err = NULL;
> >      bool offline = !!(flags & VIR_MIGRATE_OFFLINE);
> > -    bool dstOffline = false;
> > +    int dstOffline;
>
> Loosing the initializer made the compiler unhappy it seems
>
> ../dist-unpack/libvirt-7.0.0/src/qemu/qemu_migration.c: In function
> ‘qemuMigrationSrcPerformJob’:
> ../dist-unpack/libvirt-7.0.0/src/qemu/qemu_migration.c:4814:20: error:
> ‘dstOffline’ may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
>  4814 |     if (offline && !dstOffline) {
>       |                    ^~~~~~~~~~~
> ../dist-unpack/libvirt-7.0.0/src/qemu/qemu_migration.c:4712:9: note:
> ‘dstOffline’ was declared here
>  4712 |     int dstOffline;
>       |         ^~~~~~~~~~
>
>
> Regards,
> Daniel
> --
> |: https://berrange.com      -o-
> https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-
> https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-
> https://www.instagram.com/dberrange :|
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210106/90a4b7bd/attachment-0001.htm>


More information about the libvir-list mailing list