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

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

 



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@xxxxxxxxxx> 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@xxxxxxxxxxxxx>
> ---
>  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 :|


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

  Powered by Linux