* [PATCH 1/4] mini-os: Make utility function get_self_id() public
@ 2008-12-16 9:23 Yosuke Iwamatsu
2008-12-16 10:03 ` Samuel Thibault
0 siblings, 1 reply; 2+ messages in thread
From: Yosuke Iwamatsu @ 2008-12-16 9:23 UTC (permalink / raw)
To: xen-devel; +Cc: samuel.thibault, Keir Fraser
[-- Attachment #1: Type: text/plain, Size: 133 bytes --]
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
Thanks,
-----------------------
Yosuke Iwamatsu
NEC Corporation
[-- Attachment #2: minios_get_self_id.patch --]
[-- Type: all/allfiles, Size: 2117 bytes --]
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/4] mini-os: Make utility function get_self_id() public
2008-12-16 9:23 [PATCH 1/4] mini-os: Make utility function get_self_id() public Yosuke Iwamatsu
@ 2008-12-16 10:03 ` Samuel Thibault
0 siblings, 0 replies; 2+ messages in thread
From: Samuel Thibault @ 2008-12-16 10:03 UTC (permalink / raw)
To: Yosuke Iwamatsu; +Cc: xen-devel, Keir Fraser
[-- Attachment #1: Type: text/plain, Size: 2157 bytes --]
This however can be useful by itself.
mini-os: Make utility function get_self_id() in fs-front.c public.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
diff -r 6595393a3d28 extras/mini-os/fs-front.c
--- a/extras/mini-os/fs-front.c Tue Dec 09 16:28:02 2008 +0000
+++ b/extras/mini-os/fs-front.c Tue Dec 16 14:38:33 2008 +0900
@@ -867,18 +867,6 @@ moretodo:
if(more) goto 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)
@@ -1066,7 +1054,7 @@ static int init_fs_import(struct fs_impo
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);
diff -r 6595393a3d28 extras/mini-os/include/xenbus.h
--- a/extras/mini-os/include/xenbus.h Tue Dec 09 16:28:02 2008 +0000
+++ b/extras/mini-os/include/xenbus.h Tue Dec 16 14:38:33 2008 +0900
@@ -91,6 +91,9 @@ char* xenbus_printf(xenbus_transaction_t
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);
diff -r 6595393a3d28 extras/mini-os/xenbus/xenbus.c
--- a/extras/mini-os/xenbus/xenbus.c Tue Dec 09 16:28:02 2008 +0000
+++ b/extras/mini-os/xenbus/xenbus.c Tue Dec 16 14:38:33 2008 +0900
@@ -666,6 +666,17 @@ char* xenbus_printf(xenbus_transaction_t
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;
[-- Attachment #2: minios_get_self_id.patch --]
[-- Type: all/allfiles, Size: 2117 bytes --]
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-12-16 10:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-16 9:23 [PATCH 1/4] mini-os: Make utility function get_self_id() public Yosuke Iwamatsu
2008-12-16 10:03 ` Samuel Thibault
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.