]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
mini-os: Make utility function get_self_id() in fs-front.c public.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 16 Dec 2008 12:00:25 +0000 (12:00 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 16 Dec 2008 12:00:25 +0000 (12:00 +0000)
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
fs-front.c
include/xenbus.h
xenbus/xenbus.c

index 1cecab0a142166d637fd6694ebcb0328460f02eb..b72fadaacbf75fe02ad0e9f98df331d8b2fdfca4 100644 (file)
@@ -869,18 +869,6 @@ moretodo:
     in_irq = 0;
 }
 
-/* Small utility function to figure out our domain id */
-static domid_t get_self_id(void)
-{
-    char *dom_id;
-    domid_t ret; 
-
-    BUG_ON(xenbus_read(XBT_NIL, "domid", &dom_id));
-    sscanf(dom_id, "%d", &ret);
-
-    return ret;
-}
-
 static void alloc_request_table(struct fs_import *import)
 {
     struct fs_request *requests;
@@ -1066,7 +1054,7 @@ static int init_fs_import(struct fs_import *import)
     unmask_evtchn(import->local_port);
 
     
-    self_id = get_self_id(); 
+    self_id = xenbus_get_self_id(); 
     /* Write the frontend info to a node in our Xenbus */
     sprintf(nodename, "/local/domain/%d/device/vfs/%d", 
                         self_id, import->import_id);
index e8de09f282cd27023f3d9825778956613a5afbc2..30a1c081432c8c4f00ea142bfcf4c79f99469e45 100644 (file)
@@ -91,6 +91,9 @@ char* xenbus_printf(xenbus_transaction_t xbt,
                                   const char* fmt, ...)
                    __attribute__((__format__(printf, 4, 5)));
 
+/* Utility function to figure out our domain id */
+domid_t xenbus_get_self_id(void);
+
 /* Reset the XenBus system. */
 void fini_xenbus(void);
 
index 7b9c35a1dc45859d6a03a9c551dd5072827c4956..5ed42a3da75db4b308ed576c3c926e9e935bd84c 100644 (file)
@@ -666,6 +666,17 @@ char* xenbus_printf(xenbus_transaction_t xbt,
     return xenbus_write(xbt,fullpath,val);
 }
 
+domid_t xenbus_get_self_id(void)
+{
+    char *dom_id;
+    domid_t ret;
+
+    BUG_ON(xenbus_read(XBT_NIL, "domid", &dom_id));
+    sscanf(dom_id, "%d", &ret);
+
+    return ret;
+}
+
 static void do_ls_test(const char *pre)
 {
     char **dirs, *msg;