libxc and xenstored for Solaris
PATCH 1/1 libxc and xenstored for Solaris
# HG changeset patch
# User [email protected]
# Date 1161090875 25200
# Node ID b43f62e980487a064202b9a000bba185ad9e1a89
# Parent e97e0c33499b7e75b927db600dcd728a2ccadb35
Create an Solaris kernel-interface implementations for libxc and xenstored. Additionally, on Solaris, tell the kernel when xenstored is running.
Signed-off-by John Levon <[email protected]>
tools/libxc/Makefile +1 -0
@@ -17,6 +17,7 @@ CTRL_SRCS-y += xc_tbuf.c CTRL_SRCS-y += xc_tbuf.c CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c xc_ptrace.c xc_ptrace_core.c +CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c GUEST_SRCS-y := GUEST_SRCS-y += xc_load_bin.c
tools/libxc/xc_solaris.c new file +235 -0
235 lines not on this page · raw message
tools/xenstore/Makefile +3 -2
@@ -28,9 +28,10 @@ CLIENTS_OBJS := $(patsubst xenstore-%,xe XENSTORED_OBJS = xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o tdb.o hashtable.o -XENSTORED_Linux = xenstored_linux.o +XENSTORED_OBJS_$(CONFIG_Linux) = xenstored_linux.o +XENSTORED_OBJS_$(CONFIG_SunOS) = xenstored_solaris.o -XENSTORED_OBJS += $(XENSTORED_$(XEN_OS)) +XENSTORED_OBJS += $(XENSTORED_OBJS_y) .PHONY: all all: libxenstore.so libxenstore.a xenstored $(CLIENTS) xs_tdb_dump xenstore-control xenstore-ls
tools/xenstore/xenstored_core.c +3 -0
@@ -1924,6 +1924,9 @@ int main(int argc, char *argv[])/* Get ready to listen to the tools. */ max =initialize_set (&inset, &outset, *sock, *ro_sock); +/* Tell the kernel we're up and running. */ +xenbus_notify_running (); +/* Main loop. */ /* FIXME: Rewrite so noone can starve. */ for (;;) {
tools/xenstore/xenstored_core.h +3 -0
@@ -172,6 +172,9 @@ void *xenbus_map(void);/* Return the event channel used by xenbus. */ evtchn_port_t xenbus_evtchn (void ); +/* Tell the kernel xenstored is running. */ +void xenbus_notify_running (void ); +#endif /* _XENSTORED_CORE_H */ /*
tools/xenstore/xenstored_linux.c +4 -0
@@ -67,3 +67,7 @@ void *xenbus_map(void)return addr; } + +void xenbus_notify_running (void ) +{ +}
tools/xenstore/xenstored_solaris.c new file +66 -0
66 lines not on this page · raw message
tools/xenstore/xs_lib.c +8 -1
@@ -76,7 +76,14 @@ const char *xs_domain_dev(void)const char *xs_domain_dev (void ) {char *s =getenv ("XENSTORED_PATH" ); -return (s ? s :"/proc/xen/xenbus" ); +if (s) +return s; + +#ifdef __linux__ +return "/proc/xen/xenbus" ; +#else +return "/dev/xen/xenbus" ; +#endif }/* Simple routines for writing to sockets, etc. */