ia64/xen-unstable

changeset 18934:86db039882ea

mini-os: Make utility function get_self_id() in fs-front.c public.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Dec 16 12:00:25 2008 +0000 (2008-12-16)
parents ea0ad7b3ae41
children fd720db48675
files extras/mini-os/fs-front.c extras/mini-os/include/xenbus.h extras/mini-os/xenbus/xenbus.c
line diff
     1.1 --- a/extras/mini-os/fs-front.c	Tue Dec 16 11:59:22 2008 +0000
     1.2 +++ b/extras/mini-os/fs-front.c	Tue Dec 16 12:00:25 2008 +0000
     1.3 @@ -869,18 +869,6 @@ moretodo:
     1.4      in_irq = 0;
     1.5  }
     1.6  
     1.7 -/* Small utility function to figure out our domain id */
     1.8 -static domid_t get_self_id(void)
     1.9 -{
    1.10 -    char *dom_id;
    1.11 -    domid_t ret; 
    1.12 -
    1.13 -    BUG_ON(xenbus_read(XBT_NIL, "domid", &dom_id));
    1.14 -    sscanf(dom_id, "%d", &ret);
    1.15 -
    1.16 -    return ret;
    1.17 -}
    1.18 -
    1.19  static void alloc_request_table(struct fs_import *import)
    1.20  {
    1.21      struct fs_request *requests;
    1.22 @@ -1066,7 +1054,7 @@ static int init_fs_import(struct fs_impo
    1.23      unmask_evtchn(import->local_port);
    1.24  
    1.25      
    1.26 -    self_id = get_self_id(); 
    1.27 +    self_id = xenbus_get_self_id(); 
    1.28      /* Write the frontend info to a node in our Xenbus */
    1.29      sprintf(nodename, "/local/domain/%d/device/vfs/%d", 
    1.30                          self_id, import->import_id);
     2.1 --- a/extras/mini-os/include/xenbus.h	Tue Dec 16 11:59:22 2008 +0000
     2.2 +++ b/extras/mini-os/include/xenbus.h	Tue Dec 16 12:00:25 2008 +0000
     2.3 @@ -91,6 +91,9 @@ char* xenbus_printf(xenbus_transaction_t
     2.4                                    const char* fmt, ...)
     2.5                     __attribute__((__format__(printf, 4, 5)));
     2.6  
     2.7 +/* Utility function to figure out our domain id */
     2.8 +domid_t xenbus_get_self_id(void);
     2.9 +
    2.10  /* Reset the XenBus system. */
    2.11  void fini_xenbus(void);
    2.12  
     3.1 --- a/extras/mini-os/xenbus/xenbus.c	Tue Dec 16 11:59:22 2008 +0000
     3.2 +++ b/extras/mini-os/xenbus/xenbus.c	Tue Dec 16 12:00:25 2008 +0000
     3.3 @@ -666,6 +666,17 @@ char* xenbus_printf(xenbus_transaction_t
     3.4      return xenbus_write(xbt,fullpath,val);
     3.5  }
     3.6  
     3.7 +domid_t xenbus_get_self_id(void)
     3.8 +{
     3.9 +    char *dom_id;
    3.10 +    domid_t ret;
    3.11 +
    3.12 +    BUG_ON(xenbus_read(XBT_NIL, "domid", &dom_id));
    3.13 +    sscanf(dom_id, "%d", &ret);
    3.14 +
    3.15 +    return ret;
    3.16 +}
    3.17 +
    3.18  static void do_ls_test(const char *pre)
    3.19  {
    3.20      char **dirs, *msg;