qemu-devel
[Top][All Lists]
Advanced

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

[PATCH v1 8/8] virtio-balloon: Add tracking of the virtio guest feature


From: Maxim Davydov
Subject: [PATCH v1 8/8] virtio-balloon: Add tracking of the virtio guest feature bits
Date: Wed, 1 Sep 2021 12:08:04 +0300

Add tracking of the bits acknowledged by the guest

Signed-off-by: Maxim Davydov <maxim.davydov@virtuozzo.com>
---
 hw/virtio/virtio-balloon.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 4b5d9e5..61575b7 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -1029,14 +1029,18 @@ static const VMStateDescription vmstate_virtio_balloon 
= {
 };
 
 static Property virtio_balloon_properties[] = {
-    DEFINE_PROP_BIT("deflate-on-oom", VirtIOBalloon, host_features,
-                    VIRTIO_BALLOON_F_DEFLATE_ON_OOM, false),
-    DEFINE_PROP_BIT("free-page-hint", VirtIOBalloon, host_features,
-                    VIRTIO_BALLOON_F_FREE_PAGE_HINT, false),
-    DEFINE_PROP_BIT("page-poison", VirtIOBalloon, host_features,
-                    VIRTIO_BALLOON_F_PAGE_POISON, true),
-    DEFINE_PROP_BIT("free-page-reporting", VirtIOBalloon, host_features,
-                    VIRTIO_BALLOON_F_REPORTING, false),
+    DEFINE_VIRTIO_FEATURE_BIT("deflate-on-oom", VirtIOBalloon, host_features,
+                              parent_obj.guest_features,
+                              VIRTIO_BALLOON_F_DEFLATE_ON_OOM, false),
+    DEFINE_VIRTIO_FEATURE_BIT("free-page-hint", VirtIOBalloon, host_features,
+                              parent_obj.guest_features,
+                              VIRTIO_BALLOON_F_FREE_PAGE_HINT, false),
+    DEFINE_VIRTIO_FEATURE_BIT("page-poison", VirtIOBalloon, host_features,
+                              parent_obj.guest_features,
+                              VIRTIO_BALLOON_F_PAGE_POISON, true),
+    DEFINE_VIRTIO_FEATURE_BIT("free-page-reporting", VirtIOBalloon,
+                              host_features, parent_obj.guest_features,
+                              VIRTIO_BALLOON_F_REPORTING, false),
     /* QEMU 4.0 accidentally changed the config size even when free-page-hint
      * is disabled, resulting in QEMU 3.1 migration incompatibility.  This
      * property retains this quirk for QEMU 4.1 machine types.
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]