From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Ladi Prosek <lprosek@redhat.com>
Subject: [Qemu-devel] [PATCH] virtio-balloon: stats vq migration spec compliance
Date: Tue, 16 Aug 2016 00:32:55 +0300 [thread overview]
Message-ID: <1471296770-7984-1-git-send-email-mst@redhat.com> (raw)
virtio spec says that devices must not touch VQs
before DRIVER_OK is set.
Additionally, balloon must not touch stats VQ
unless the stats feature bit has been negotiated.
Cc: Ladi Prosek <lprosek@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/virtio/virtio-balloon.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 65457e9..7189260 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -427,6 +427,7 @@ static void virtio_balloon_vmstate_cb(void *opaque, int running,
RunState state)
{
VirtIOBalloon *s = opaque;
+ VirtIODevice *vdev = VIRTIO_DEVICE(s);
if (!running) {
/* put the stats element back if the VM is not running */
@@ -436,7 +437,8 @@ static void virtio_balloon_vmstate_cb(void *opaque, int running,
s->stats_vq_elem = NULL;
}
- } else {
+ } else if (balloon_stats_supported(s) &&
+ (vdev->status & VIRTIO_CONFIG_S_DRIVER_OK)) {
/* poll stats queue for the element we may have discarded
* when the VM was stopped */
virtio_balloon_receive_stats(VIRTIO_DEVICE(s), s->svq);
--
MST
next reply other threads:[~2016-08-15 23:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-15 21:32 Michael S. Tsirkin [this message]
2016-08-16 7:31 ` [Qemu-devel] [PATCH] virtio-balloon: stats vq migration spec compliance Ladi Prosek
2016-08-16 10:30 ` Stefan Hajnoczi
2016-08-23 19:12 ` 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=1471296770-7984-1-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=lprosek@redhat.com \
--cc=qemu-devel@nongnu.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).