Patchwork [v3,1/7] virtio: add two functions to VirtioDeviceClass.

login
register
mail settings
Submitter fred.konrad@greensocs.com
Date April 11, 2013, 2:29 p.m.
Message ID <1365690602-22729-2-git-send-email-fred.konrad@greensocs.com>
Download mbox | patch
Permalink /patch/235753/
State New
Headers show

Comments

fred.konrad@greensocs.com - April 11, 2013, 2:29 p.m.
From: KONRAD Frederic <fred.konrad@greensocs.com>

Recent changes need two functions to VirtioDevice. This just add them
into VirtioDeviceClass.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
---
 include/hw/virtio/virtio.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Patch

diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 7e24b2b..b21e5c2 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -171,6 +171,18 @@  typedef struct VirtioDeviceClass {
     void (*set_config)(VirtIODevice *vdev, const uint8_t *config);
     void (*reset)(VirtIODevice *vdev);
     void (*set_status)(VirtIODevice *vdev, uint8_t val);
+    /* Test and clear event pending status.
+     * Should be called after unmask to avoid losing events.
+     * If backend does not support masking,
+     * must check in frontend instead.
+     */
+    bool (*guest_notifier_pending)(VirtIODevice *vdev, int n);
+    /* Mask/unmask events from this vq. Any events reported
+     * while masked will become pending.
+     * If backend does not support masking,
+     * must mask in frontend instead.
+     */
+    void (*guest_notifier_mask)(VirtIODevice *vdev, int n, bool mask);
 } VirtioDeviceClass;
 
 void virtio_init(VirtIODevice *vdev, const char *name,