From 64859d6d457917eeb8e2f2ce41333077ecf739d2 Mon Sep 17 00:00:00 2001
From: Dor Laor <dor@cloudius-systems.com>
Date: Sun, 17 Feb 2013 17:48:47 +0200
Subject: [PATCH] Add functions to retrieve the guest features from the host

---
 drivers/virtio-device.cc | 11 +++++++++++
 drivers/virtio-device.hh |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/drivers/virtio-device.cc b/drivers/virtio-device.cc
index c4b4916bd..ada6aa6ec 100644
--- a/drivers/virtio-device.cc
+++ b/drivers/virtio-device.cc
@@ -145,6 +145,17 @@ namespace virtio {
         set_virtio_config_bit(VIRTIO_PCI_GUEST_FEATURES, bit, on);
     }
 
+    u32 virtio_device::get_guest_features(void)
+    {
+        return (virtio_conf_readl(VIRTIO_PCI_GUEST_FEATURES));
+    }
+
+    bool virtio_device::get_guest_feature_bit(int bit)
+    {
+        return (get_virtio_config_bit(VIRTIO_PCI_GUEST_FEATURES, bit));
+    }
+
+
     u32 virtio_device::get_dev_status(void)
     {
         return (virtio_conf_readl(VIRTIO_PCI_STATUS));
diff --git a/drivers/virtio-device.hh b/drivers/virtio-device.hh
index 547c7a2bb..3a01d3e6b 100644
--- a/drivers/virtio-device.hh
+++ b/drivers/virtio-device.hh
@@ -119,6 +119,8 @@ namespace virtio {
         bool get_device_feature_bit(int bit);
         void set_guest_features(u32 features);
         void set_guest_feature_bit(int bit, bool on);
+        u32 get_guest_features(void);
+        bool get_guest_feature_bit(int bit);
 
         // device status
         u32 get_dev_status(void);
-- 
GitLab