From: Jens Freimann <jfreimann@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>,
Laurent Vivier <laurent@vivier.eu>,
Michael Tokarev <mjt@tls.msk.ru>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
qemu-trivial@nongnu.org, benh@kernel.crashing.org,
zhengxiang9@huawei.com, quintela@redhat.com,
alex.williamson@redhat.com
Subject: Re: [PATCH v3 3/4] failover: really display a warning when the primary device is not found
Date: Fri, 12 Feb 2021 15:40:24 +0100 [thread overview]
Message-ID: <YCaTWHb45o74cKUS@linux.fritz.box> (raw)
In-Reply-To: <20210212135250.2738750-4-lvivier@redhat.com>
On Fri, Feb 12, 2021 at 02:52:49PM +0100, Laurent Vivier wrote:
>In failover_add_primary(), we search the id of the failover device by
>scanning the list of the devices in the opts list to find a device with
>a failover_pair_id equals to the id of the virtio-net device.
>
>If the failover_pair_id is not found, QEMU ignores the primary
>device silently (which also means it will not be hidden and
>it will be enabled directly at boot).
>
>After that, we search the id in the opts list to do a qdev_device_add()
>with it. The device will be always found as otherwise we had exited
>before, and thus the warning is never displayed.
>
>Fix that by moving the error report to the first exit condition.
>Also add a g_assert() to be sure the compiler will not complain
>about a possibly NULL pointer.
>
>Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>---
> hw/net/virtio-net.c | 20 +++++++++-----------
> 1 file changed, 9 insertions(+), 11 deletions(-)
>
Thank you Laurent!
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
regards,
Jens
WARNING: multiple messages have this Message-ID (diff)
From: Jens Freimann <jfreimann@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: alex.williamson@redhat.com, "Michael S. Tsirkin" <mst@redhat.com>,
qemu-trivial@nongnu.org, Jason Wang <jasowang@redhat.com>,
quintela@redhat.com, Michael Tokarev <mjt@tls.msk.ru>,
Laurent Vivier <laurent@vivier.eu>,
qemu-devel@nongnu.org, zhengxiang9@huawei.com
Subject: Re: [PATCH v3 3/4] failover: really display a warning when the primary device is not found
Date: Fri, 12 Feb 2021 15:40:24 +0100 [thread overview]
Message-ID: <YCaTWHb45o74cKUS@linux.fritz.box> (raw)
In-Reply-To: <20210212135250.2738750-4-lvivier@redhat.com>
On Fri, Feb 12, 2021 at 02:52:49PM +0100, Laurent Vivier wrote:
>In failover_add_primary(), we search the id of the failover device by
>scanning the list of the devices in the opts list to find a device with
>a failover_pair_id equals to the id of the virtio-net device.
>
>If the failover_pair_id is not found, QEMU ignores the primary
>device silently (which also means it will not be hidden and
>it will be enabled directly at boot).
>
>After that, we search the id in the opts list to do a qdev_device_add()
>with it. The device will be always found as otherwise we had exited
>before, and thus the warning is never displayed.
>
>Fix that by moving the error report to the first exit condition.
>Also add a g_assert() to be sure the compiler will not complain
>about a possibly NULL pointer.
>
>Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>---
> hw/net/virtio-net.c | 20 +++++++++-----------
> 1 file changed, 9 insertions(+), 11 deletions(-)
>
Thank you Laurent!
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
regards,
Jens
next prev parent reply other threads:[~2021-02-12 14:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-12 13:52 [PATCH v3 0/4] failover: trivial cleanup and fix Laurent Vivier
2021-02-12 13:52 ` Laurent Vivier
2021-02-12 13:52 ` [PATCH v3 1/4] pci: cleanup failover sanity check Laurent Vivier
2021-02-12 13:52 ` Laurent Vivier
2021-02-12 14:18 ` Laurent Vivier
2021-02-12 14:18 ` Laurent Vivier
2021-02-12 13:52 ` [PATCH v3 2/4] virtio-net: add missing object_unref() Laurent Vivier
2021-02-12 13:52 ` Laurent Vivier
2021-02-12 14:18 ` Laurent Vivier
2021-02-12 14:18 ` Laurent Vivier
2021-02-12 13:52 ` [PATCH v3 3/4] failover: really display a warning when the primary device is not found Laurent Vivier
2021-02-12 13:52 ` Laurent Vivier
2021-02-12 14:40 ` Jens Freimann [this message]
2021-02-12 14:40 ` Jens Freimann
2021-02-12 13:52 ` [PATCH v3 4/4] pcie: don't set link state active if the slot is empty Laurent Vivier
2021-02-12 13:52 ` Laurent Vivier
2021-02-19 10:10 ` Laurent Vivier
2021-02-19 10:10 ` Laurent Vivier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YCaTWHb45o74cKUS@linux.fritz.box \
--to=jfreimann@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=benh@kernel.crashing.org \
--cc=jasowang@redhat.com \
--cc=laurent@vivier.eu \
--cc=lvivier@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mjt@tls.msk.ru \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=quintela@redhat.com \
--cc=zhengxiang9@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.