From: Paul Durrant <xadimgnik@gmail.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Anthony Perard <anthony.perard@citrix.com>,
"open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v1 5/7] xen-bus: Set offline if backend's state is XenbusStateClosed
Date: Sun, 12 Nov 2023 15:37:25 -0500 [thread overview]
Message-ID: <4886e994-6f4b-4d9f-97fc-9f6d7a8b3641@xen.org> (raw)
In-Reply-To: <20231110204207.2927514-6-volodymyr_babchuk@epam.com>
On 10/11/2023 15:42, Volodymyr Babchuk wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>
> Both state (XenbusStateClosed) and online (0) are expected by
> toolstack/xl devd to completely destroy the device. But "offline"
> is never being set by the backend resulting in timeout during
> domain destruction, garbage in Xestore and still running Qemu
> instance.
>
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> ---
> hw/xen/xen-bus.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c
> index 75474d4b43..6e7ec3af64 100644
> --- a/hw/xen/xen-bus.c
> +++ b/hw/xen/xen-bus.c
> @@ -519,6 +519,10 @@ static void xen_device_backend_changed(void *opaque, const char *path)
> xen_device_backend_set_state(xendev, XenbusStateClosed);
> }
>
> + if (xen_device_backend_get_state(xendev) == XenbusStateClosed) {
> + xen_device_backend_set_online(xendev, false);
> + }
> +
> /*
> * If a backend is still 'online' then we should leave it alone but,
> * if a backend is not 'online', then the device is a candidate
I don't understand what you're trying to do here. Just a few lines up
from this hunk there is:
506 if (xen_device_backend_scanf(xendev, "online", "%u", &online)
!= 1) {
507 online = 0;
508 }
509
510 xen_device_backend_set_online(xendev, !!online);
Why is this not sufficient? What happens if the frontend decides to stop
and start (e.g. for a driver update)? I'm guessing the backend will be
destroyed... which is not very friendly.
Paul
next prev parent reply other threads:[~2023-11-12 20:38 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-10 20:42 [PATCH v1 0/7] xen-arm: add support for virtio-pci Volodymyr Babchuk
2023-11-10 20:42 ` [PATCH v1 1/7] xen-block: Do not write frontend nodes Volodymyr Babchuk
2023-11-11 10:55 ` David Woodhouse
2023-11-11 13:43 ` Andrew Cooper
2023-11-11 20:18 ` David Woodhouse
2023-11-11 21:51 ` Andrew Cooper
2023-11-11 22:22 ` David Woodhouse
2023-11-14 21:32 ` Volodymyr Babchuk
2023-11-14 21:54 ` David Woodhouse
2023-11-12 20:29 ` Paul Durrant
2023-11-10 20:42 ` [PATCH v1 3/7] xen: xenstore: add possibility to preserve owner Volodymyr Babchuk
2023-11-11 11:01 ` David Woodhouse
2023-11-12 21:18 ` David Woodhouse
2023-11-13 13:02 ` Volodymyr Babchuk
2023-11-13 13:00 ` Volodymyr Babchuk
2023-11-12 20:43 ` Paul Durrant
2023-11-10 20:42 ` [PATCH v1 2/7] xen-bus: Do not destroy frontend/backend directories Volodymyr Babchuk
2023-11-12 21:57 ` David Woodhouse
2023-11-10 20:42 ` [PATCH v1 6/7] xen_arm: Set mc->max_cpus to GUEST_MAX_VCPUS in xen_arm_init() Volodymyr Babchuk
2023-11-10 20:42 ` [PATCH v1 4/7] xen_pvdev: Do not assume Dom0 when creating a directrory Volodymyr Babchuk
2023-11-12 21:12 ` David Woodhouse
2023-11-15 0:22 ` Volodymyr Babchuk
2023-11-10 20:42 ` [PATCH v1 5/7] xen-bus: Set offline if backend's state is XenbusStateClosed Volodymyr Babchuk
2023-11-11 11:42 ` David Woodhouse
2023-11-12 20:37 ` Paul Durrant [this message]
2023-11-10 20:42 ` [PATCH v1 7/7] xen_arm: Add basic virtio-pci support Volodymyr Babchuk
2023-11-12 22:11 ` David Woodhouse
2023-11-13 12:01 ` Volodymyr Babchuk
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=4886e994-6f4b-4d9f-97fc-9f6d7a8b3641@xen.org \
--to=xadimgnik@gmail.com \
--cc=Oleksandr_Tyshchenko@epam.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=anthony.perard@citrix.com \
--cc=paul@xen.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).