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

[Xen-devel] [PATCH v3 6/7] vTPM: Parse envent string from QEMU frontend



Signed-off-by: Quan Xu <quan.xu@xxxxxxxxx>
---
 extras/mini-os/tpmback.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 8a0a983..b8f4c8f 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -732,11 +732,22 @@ static int parse_eventstr(const char* evstr, domid_t* 
domid, unsigned int* handl
         return EV_NONE;
       }
       return EV_NEWFE;
-   } else if((ret = sscanf(evstr, "/local/domain/%u/device/vtpm/%u/%40s", 
&udomid, handle, cmd)) == 3) {
-      *domid = udomid;
-      if (!strcmp(cmd, "state"))
-        return EV_STCHNG;
-   }
+
+    /* vtpm and PV virtual machines */
+    } else if((ret = sscanf(evstr, "/local/domain/%u/device/vtpm/%u/%40s",
+                            &udomid, handle, cmd)) == 3) {
+        *domid = udomid;
+        if (!strcmp(cmd, "state"))
+            return EV_STCHNG;
+
+    /* HVM virtual machines */
+    } else if((ret = sscanf(evstr, "/local/domain/0/frontend/vtpm/%u/%u/%40s",
+                            &udomid, handle, cmd)) == 3) {
+        *domid = 0;
+        if (!strcmp(cmd, "state"))
+            return EV_STCHNG;
+    }
+
    return EV_NONE;
 }
 
-- 
1.8.3.2


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.