From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Viresh Kumar" <viresh.kumar@linaro.org>,
"Mathieu Poirier" <mathieu.poirier@linaro.org>,
virtio-fs@redhat.com
Subject: [PATCH RFC 2/3] gpio: use virtio_device_running
Date: Sat, 5 Nov 2022 14:16:18 -0400 [thread overview]
Message-ID: <20221105172453.445049-3-mst@redhat.com> (raw)
In-Reply-To: <20221105172453.445049-1-mst@redhat.com>
Same as other vhost-user devices, vhost-user-gpio cares whether
device is running not whether frontend is started.
Switch to that.
Fixes: 27ba7b027f ("hw/virtio: add boilerplate for vhost-user-gpio device")
Cc: "Viresh Kumar" <viresh.kumar@linaro.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/virtio/vhost-user-gpio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/virtio/vhost-user-gpio.c b/hw/virtio/vhost-user-gpio.c
index 8b40fe450c..f34ee59b6e 100644
--- a/hw/virtio/vhost-user-gpio.c
+++ b/hw/virtio/vhost-user-gpio.c
@@ -152,7 +152,7 @@ static void vu_gpio_stop(VirtIODevice *vdev)
static void vu_gpio_set_status(VirtIODevice *vdev, uint8_t status)
{
VHostUserGPIO *gpio = VHOST_USER_GPIO(vdev);
- bool should_start = virtio_device_started(vdev, status);
+ bool should_start = virtio_device_running(vdev, status);
trace_virtio_gpio_set_status(status);
@@ -228,7 +228,7 @@ static int vu_gpio_connect(DeviceState *dev, Error **errp)
}
/* restore vhost state */
- if (virtio_device_started(vdev, vdev->status)) {
+ if (virtio_device_running(vdev, vdev->status)) {
vu_gpio_start(vdev);
}
--
MST
next prev parent reply other threads:[~2022-11-05 18:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-05 18:16 [PATCH RFC 0/3] virtio fix up started checks Michael S. Tsirkin
2022-11-05 18:16 ` [PATCH RFC 1/3] virtio: distinguish between started and running Michael S. Tsirkin
2022-11-05 18:16 ` Michael S. Tsirkin [this message]
2022-11-05 18:16 ` [PATCH RFC 3/3] virtio: revert changes to virtio_device_started Michael S. Tsirkin
2022-11-05 21:59 ` [PATCH RFC 0/3] virtio fix up started checks Michael S. Tsirkin
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=20221105172453.445049-3-mst@redhat.com \
--to=mst@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=dgilbert@redhat.com \
--cc=mathieu.poirier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=viresh.kumar@linaro.org \
--cc=virtio-fs@redhat.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 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).