diff mbox

[13/19] xen: Distinguish between frontend and backend devops

Message ID 1468151270-12984-14-git-send-email-emilcondrea@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Emil Condrea July 10, 2016, 11:47 a.m. UTC
xen_be_check_state should not be called for frontends
Use DEVOPS_FLAG_FE flag to distinguish a frontend.

Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Signed-off-by: Quan Xu <quan.xu@intel.com>

---
Changes in v9:
 * Removed not needed strstr from xenstore_update_be
It was left over from first patch series when domu was included in xenstore
schema: "%s/backend/%s/%d/%d"
---
 hw/xen/xen_backend.c       | 4 +++-
 include/hw/xen/xen_pvdev.h | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index d0e3f50..3931128 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -488,7 +488,9 @@  void xenstore_update_be(char *watch, char *type, int dom,
         } else {
             free(bepath);
             xen_be_backend_changed(xendev, path);
-            xen_be_check_state(xendev);
+            if (!(ops->flags & DEVOPS_FLAG_FE)) {
+                xen_be_check_state(xendev);
+            }
         }
     }
 }
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index c19e1df..c985a9d 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -14,6 +14,8 @@  struct XenDevice;
 #define DEVOPS_FLAG_NEED_GNTDEV   1
 /* don't expect frontend doing correct state transitions (aka console quirk) */
 #define DEVOPS_FLAG_IGNORE_STATE  2
+/*dev is frontend device*/
+#define DEVOPS_FLAG_FE            4
 
 struct XenDevOps {
     size_t    size;