xenbackendd: remove xenbackendd
PATCH 1/1 xenbackendd: remove xenbackendd
The functionality provided by xenbackendd has been integrated into the xl toolstack under the devd command on all platforms, because of that it no longer makes sense to maintain xenbackendd.
Init scripts have also been provided for all platforms in order to launch xl devd in the background, mimicking the functionality provided by xenbackendd. Furthermore, xenbackendd is not started by default on NetBSD since a couple of releases ago (4.2 was the first release to disable the automatic startup of xenbackendd in xencommons).
--- tools/Makefile | 1 - tools/hotplug/Linux/init.d/sysconfig.xencommons.in | 6 - tools/hotplug/NetBSD/block | 2 +- tools/hotplug/NetBSD/rc.d/xencommons.in | 2 - tools/hotplug/NetBSD/vif-bridge | 2 +- tools/hotplug/NetBSD/vif-ip | 2 +- tools/xenbackendd/Makefile | 41 --- tools/xenbackendd/xenbackendd.c | 325 --------------------- 8 files changed, 3 insertions(+), 378 deletions(-) delete mode 100644 tools/xenbackendd/Makefile delete mode 100644 tools/xenbackendd/xenbackendd.c
tools/Makefile +0 -1
@@ -17,7 +17,6 @@ SUBDIRS-y += xenmon SUBDIRS-y += xenstat SUBDIRS-$(CONFIG_Linux) += memshr SUBDIRS-$(CONFIG_BLKTAP2) += blktap2 -SUBDIRS-$(CONFIG_NetBSD) += xenbackendd SUBDIRS-y += libfsimage SUBDIRS-$(CONFIG_Linux) += libvchan
tools/hotplug/Linux/init.d/sysconfig.xencommons.in +0 -6
@@ -40,11 +40,5 @@ XENSTORED_ARGS= # Running xenstored on XENSTORED_ROOTDIR #XENSTORED_ROOTDIR=@XEN_LIB_STORED@ -## Type: string -## Default: Not defined, xenbackendd debug mode off -# -# Running xenbackendd in debug mode -#XENBACKENDD_DEBUG=[yes|on|1] - # qemu path #QEMU_XEN=@LIBEXEC_BIN@/qemu-system-i386
tools/hotplug/NetBSD/block +1 -1
@@ -1,7 +1,7 @@ #!/bin/sh -e # $NetBSD: block-nbsd,v 1.1.1.1 2008/08/07 20:26:57 cegger Exp $ -# Called by xenbackendd +# # Usage: block xsdir_backend_path state DIR=$(dirname "$0")
tools/hotplug/NetBSD/rc.d/xencommons.in +0 -2
@@ -22,8 +22,6 @@ required_files="/kern/xen/privcmd" XENSTORED_PIDFILE="/var/run/xenstored.pid" XENCONSOLED_PIDFILE="/var/run/xenconsoled.pid" -XENBACKENDD_PIDFILE="/var/run/xenbackendd.pid" -#XENBACKENDD_DEBUG=1 #XENCONSOLED_TRACE="/var/log/xen/xenconsole-trace.log" #XENSTORED_TRACE="/var/log/xen/xenstore-trace.log"
tools/hotplug/NetBSD/vif-bridge +1 -1
@@ -1,7 +1,7 @@ #!/bin/sh -e # $NetBSD: vif-bridge-nbsd,v 1.1.1.1 2008/08/07 20:26:57 cegger Exp $ -# Called by xenbackendd +# # Usage: vif-bridge xsdir_backend_path state DIR=$(dirname "$0")
tools/hotplug/NetBSD/vif-ip +1 -1
@@ -1,7 +1,7 @@ #!/bin/sh -e # $NetBSD: vif-ip-nbsd,v 1.1.1.1 2008/08/07 20:26:57 cegger Exp $ -# Called by xenbackendd +# # Usage: vif-ip xsdir_backend_path state DIR=$(dirname "$0")
tools/xenbackendd/Makefile deleted +0 -41
41 lines not on this page · raw message
tools/xenbackendd/xenbackendd.c deleted +0 -325
325 lines not on this page · raw message
Signature · 7 lines
1.9.5 (Apple Git-50.3) _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Quoted 14 lines · Roger Pau Monne
The functionality provided by xenbackendd has been integrated into the xl toolstack under the devd command on all platforms, because of that it no longer makes sense to maintain xenbackendd.
Init scripts have also been provided for all platforms in order to launch xl
devd in the background, mimicking the functionality provided by xenbackendd.
Furthermore, xenbackendd is not started by default on NetBSD since a couple
of releases ago (4.2 was the first release to disable the automatic startup
of xenbackendd in xencommons).
Quoted 7 lines
Signed-off-by Roger Pau Monné <[email protected]>Cc Ian Jackson <[email protected]>Cc Stefano Stabellini <[email protected]>Cc Ian Campbell <[email protected]>Cc Wei Liu <[email protected]>Cc George Dunlap <[email protected]>Cc <[email protected]>
I thought I'd replied to this, but the archive and my Sent box both disagree. Anyway:
Probably not 4.6 material any more though?
Quoted 473 lines
--- tools/Makefile | 1 - tools/hotplug/Linux/init.d/sysconfig.xencommons.in | 6 - tools/hotplug/NetBSD/block | 2 +- tools/hotplug/NetBSD/rc.d/xencommons.in | 2 - tools/hotplug/NetBSD/vif-bridge | 2 +- tools/hotplug/NetBSD/vif-ip | 2 +- tools/xenbackendd/Makefile | 41 --- tools/xenbackendd/xenbackendd.c | 325 --------------- ------ 8 files changed, 3 insertions(+), 378 deletions(-) delete mode 100644 tools/xenbackendd/Makefile delete mode 100644 tools/xenbackendd/xenbackendd.ctools/Makefile +0
-1@@ -17,7 +17,6 @@ SUBDIRS-y += xenmon SUBDIRS-y += xenstat SUBDIRS-$(CONFIG_Linux) += memshr SUBDIRS-$(CONFIG_BLKTAP2) += blktap2 -SUBDIRS-$(CONFIG_NetBSD) += xenbackendd SUBDIRS-y += libfsimage SUBDIRS-$(CONFIG_Linux) += libvchantools/hotplug/Linux/init.d/sysconfig.xencommons.in +0
-6@@ -40,11 +40,5 @@ XENSTORED_ARGS= # Running xenstored on XENSTORED_ROOTDIR #XENSTORED_ROOTDIR=@XEN_LIB_STORED@ -## Type: string -## Default: Not defined, xenbackendd debug mode off -# -# Running xenbackendd in debug mode -#XENBACKENDD_DEBUG=[yes|on|1] - # qemu path #QEMU_XEN=@LIBEXEC_BIN@/qemu-system-i386tools/hotplug/NetBSD/block +1
-1@@ -1,7 +1,7 @@ #!/bin/sh -e # $NetBSD: block-nbsd,v 1.1.1.1 2008/08/07 20:26:57 cegger Exp $ -# Called by xenbackendd +# # Usage: block xsdir_backend_path state DIR=$(dirname "$0")tools/hotplug/NetBSD/rc.d/xencommons.in +0
-2@@ -22,8 +22,6 @@ required_files="/kern/xen/privcmd" XENSTORED_PIDFILE="/var/run/xenstored.pid" XENCONSOLED_PIDFILE="/var/run/xenconsoled.pid" -XENBACKENDD_PIDFILE="/var/run/xenbackendd.pid" -#XENBACKENDD_DEBUG=1 #XENCONSOLED_TRACE="/var/log/xen/xenconsole-trace.log" #XENSTORED_TRACE="/var/log/xen/xenstore-trace.log"tools/hotplug/NetBSD/vif renamed from tools/hotplug/NetBSD/vif-bridge +0
-1-bridgeindex b58e922..f12edf0 100644
tools/hotplug/NetBSD/vif-bridge +1
-1@@ -1,7 +1,7 @@ #!/bin/sh -e # $NetBSD: vif-bridge-nbsd,v 1.1.1.1 2008/08/07 20:26:57 cegger Exp $ -# Called by xenbackendd +# # Usage: vif-bridge xsdir_backend_path state DIR=$(dirname "$0")tools/hotplug/NetBSD/vif-ip +1
-1@@ -1,7 +1,7 @@ #!/bin/sh -e # $NetBSD: vif-ip-nbsd,v 1.1.1.1 2008/08/07 20:26:57 cegger Exp $ -# Called by xenbackendd +# # Usage: vif-ip xsdir_backend_path state DIR=$(dirname "$0")tools/xenbackendd/Makefile deleted +0
-41@@ -1,41 +0,0 @@ -# Copyright (c) 2009 Advanced Micro Devices, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; under version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -XEN_ROOT=$(CURDIR)/../.. -include $(XEN_ROOT)/tools/Rules.mk - -CFLAGS += -Werror -CFLAGS += $(CFLAGS_libxenstore) -CPPFLAGS += -DXEN_SCRIPT_DIR="\"$(XEN_SCRIPT_DIR)\"" -LDLIBS += $(LDLIBS_libxenstore) - -.PHONY: all -all: build - -.PHONY: build -build: xenbackendd - -.PHONY: install -install: build - $(INSTALL_DIR) $(DESTDIR)$(sbindir) - $(INSTALL_PROG) xenbackendd $(DESTDIR)$(sbindir) - -.PHONY: clean -clean: - $(RM) *.a *.so *.o $(DEPS) xenbackendd - -.PHONY: distclean -distclean: clean - -xenbackendd: xenbackendd.o - $(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS) - --include $(DEPS)tools/xenbackendd/xenbackendd.c deleted +0
-102@@ -1,325 +0,0 @@ -/* $NetBSD: xenbackendd.c,v 1.1.1.1 2008/08/07 20:26:57 cegger Exp $ */ -/* -* Copyright (C) 2006 Manuel Bouyer <[email protected]> -* Copyright (C) 2009 Christoph Egger <[email protected]> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; under version 2 of the License. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/wait.h> -#include <unistd.h> -#include <fcntl.h> -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> -#include <string.h> -#include <syslog.h> - -#include <xenstore.h> - -#define DEVTYPE_UNKNOWN 0 -#define DEVTYPE_VIF 1 -#define DEVTYPE_VBD 2 -#define DISABLE_EXEC "libxl/disable_udev" - -#define DOMAIN_PATH "/local/domain/0" - -#ifndef XEN_SCRIPT_DIR -#error XEN_SCRIPT_DIR not defined -#endif - -#ifndef VBD_SCRIPT -#define VBD_SCRIPT XEN_SCRIPT_DIR"/block" -#endif -#ifndef LOG_FILE -#define LOG_FILE "/var/log/xen/xenbackendd.log" -#endif -#ifndef PID_FILE -#define PID_FILE "/var/run/xenbackendd.pid" -#endif - - -struct xs_handle *xs; - -int fflag =0 ; -int dflag =0 ; - -const char *vbd_script =NULL ; -const char *log_file =NULL ; -const char *pidfile =NULL ; - -static void -dolog (int pri,const char *fmt, ...) -{ -va_list ap; -va_start (ap, fmt); -vfprintf (stderr, fmt, ap); -va_end (ap); -fprintf (stderr,"\n" ); -fflush (stderr); -va_start (ap, fmt); -vsyslog (pri, fmt, ap); -va_end (ap); -} - -static void -dodebug (const char *fmt, ...) -{ -va_list ap; - -if (dflag ==0 ) -return ; -va_start (ap, fmt); -vfprintf (stdout, fmt, ap); -va_end (ap); -printf ("\n" ); -fflush (stdout); -} - -static void -doexec (const char *cmd,const char *arg1,const char *arg2) -{ -dodebug ("exec %s %s %s" , cmd, arg1, arg2); -switch (vfork ()) { -case -1 : -dolog (LOG_ERR ,"can't vfork: %s" ,strerror (errno)); -break ; -case 0 : -execl (cmd, cmd, arg1, arg2,NULL ); - dolog(LOG_ERR, "can't exec %s: %s", cmd,strerror(errno));
tools/xenbackendd/xenbackendd.c deleted +0
-14-exit (EXIT_FAILURE ); -/* NOTREACHED */ -break ; -default : -wait (NULL ); -break ; - } -} - -static void -usage (void ) -{ - fprintf(stderr, - "usage: %s [-d] [-f] [-l log_file] [-p pif_file] [-svbd_script]\n",
tools/xenbackendd/xenbackendd.c deleted +0
-77- getprogname()); -exit (EXIT_FAILURE ); -} - -static int -xen_setup (void ) -{ - xs =xs_daemon_open (); -if (xs ==NULL ) { -dolog (LOG_ERR , -"Failed to contact xenstore (%s). Is it running?" , -strerror (errno)); - goto out; - } - -if (!xs_watch (xs,DOMAIN_PATH ,"backend" )) { -dolog (LOG_ERR ,"xenstore watch on backend fails." ); - goto out; - } -return 0 ; - - out: -if (xs) { -xs_daemon_close (xs); - xs =NULL ; - } -return -1 ; -} - -int -main (int argc,char *const argv[]) -{ -char **vec; -unsigned int num; -char *s; -int state; -char *sstate, *sdisable; -char *p; -char buf[80 ]; -int type; -int ch; -int debug_fd; -FILE *pidfile_f; - -while ((ch =getopt (argc, argv,"dfl:p:s:" )) !=-1 ) { -switch (ch) { -case 'd' : - dflag =1 ; -break ; -case 'f' : - fflag =1 ; -break ; -case 'l' : - log_file = optarg; -break ; -case 'p' : - pidfile = optarg; -case 's' : - vbd_script = optarg; -break ; -default : -usage (); - } - } - -if (vbd_script ==NULL ) - vbd_script =VBD_SCRIPT ; -if (pidfile ==NULL ) - pidfile =PID_FILE ; -if (log_file ==NULL ) - log_file =LOG_FILE ; - -openlog ("xenbackendd" ,LOG_PID |LOG_NDELAY ,LOG_DAEMON ); - -if (fflag ==0 ) { -/* open log file */ - debug_fd = open(log_file, O_RDWR | O_CREAT | O_TRUNC,0644);
tools/xenbackendd/xenbackendd.c deleted +0
-26-if (debug_fd ==-1 ) { -dolog (LOG_ERR ,"can't open %s: %s" , - log_file,strerror (errno)); -exit (EXIT_FAILURE ); - } - } - -if (fflag ==0 ) { -/* daemonize */ - pidfile_f =fopen (pidfile,"w" ); -if (pidfile_f ==NULL ) { -dolog (LOG_ERR ,"can't open %s: %s" , - pidfile,strerror (errno)); -exit (EXIT_FAILURE ); - } -if (daemon (0 ,0 ) <0 ) { -dolog (LOG_ERR ,"can't daemonize: %s" , -strerror (errno)); -exit (EXIT_FAILURE ); - } -fprintf (pidfile_f,"%d\n" , (int )getpid ()); -fclose (pidfile_f); - -/* redirect stderr to log file */ -if (dup2 (debug_fd,STDERR_FILENO ) <0 ) { - dolog(LOG_ERR, "can't redirect stderr to %s:%s\n",
tools/xenbackendd/xenbackendd.c deleted +0
-47- log_file, strerror(errno)); -exit (EXIT_FAILURE ); - } - -/* also redirect stdout if we're in debug mode */ -if (dflag) { -if (dup2 (debug_fd,STDOUT_FILENO ) <0 ) { -dolog (LOG_ERR , -"can't redirect stdout to %s: %s\n" , - log_file,strerror (errno)); -exit (EXIT_FAILURE ); - } - } - -close (debug_fd); - debug_fd =-1 ; - } - -if (xen_setup () <0 ) -exit (EXIT_FAILURE ); - -for (;;) { - vec =xs_read_watch (xs, &num); -dodebug ("read from xen watch: %s" , *vec); -if (!vec) { -dolog (LOG_ERR ,"xs_read_watch: NULL\n" ); -continue ; - } - - sdisable =xs_read (xs,XBT_NULL ,DISABLE_EXEC ,0 ); -if (sdisable) - goto next1; - -if (strlen (vec[XS_WATCH_PATH ]) <sizeof ("state" )) - goto next1; - -/* find last component of path, check if it's "state" */ - p = &vec[XS_WATCH_PATH ][ -strlen (vec[XS_WATCH_PATH ]) -sizeof ("state" )]; -if (p[0 ] !='/' ) - goto next1; - p[0 ] ='\0' ; - p++; -if (strcmp (p,"state" ) !=0 ) - goto next1; - - snprintf(buf, sizeof(buf), "%s/state",vec[XS_WATCH_PATH]);
tools/xenbackendd/xenbackendd.c deleted +0
-4- sstate =xs_read (xs,XBT_NULL , buf,0 ); -if (sstate ==NULL ) { - dolog(LOG_ERR, - "Failed to read %s (%s)", buf,strerror(errno));
tools/xenbackendd/xenbackendd.c deleted +0
-45- goto next1; - } - - state =atoi (sstate); -snprintf (buf,sizeof (buf),"%s/hotplug-status" , - vec[XS_WATCH_PATH ]); - s =xs_read (xs,XBT_NULL , buf,0 ); -if (s !=NULL && state !=6 /* XenbusStateClosed */ ) - goto next2; - - type =DEVTYPE_UNKNOWN ; -if (strncmp (vec[XS_WATCH_PATH ], -DOMAIN_PATH "/backend/vif" , -strlen (DOMAIN_PATH "/backend/vif" )) ==0 ) - type =DEVTYPE_VIF ; - -if (strncmp (vec[XS_WATCH_PATH ], -DOMAIN_PATH "/backend/vbd" , -strlen (DOMAIN_PATH "/backend/vbd" )) ==0 ) - type =DEVTYPE_VBD ; - -switch (type) { -case DEVTYPE_VIF : -free (s); -snprintf (buf,sizeof (buf),"%s/script" , - vec[XS_WATCH_PATH ]); - s =xs_read (xs,XBT_NULL , buf,0 ); -if (s ==NULL ) { -dolog (LOG_ERR , -"Failed to read %s (%s)" , buf, -strerror (errno)); - goto next2; - } -doexec (s, vec[XS_WATCH_PATH ], sstate); -break ; - -case DEVTYPE_VBD : -doexec (vbd_script, vec[XS_WATCH_PATH ], sstate); -break ; - -default : -break ; - } - -next2:
tools/xenbackendd/xenbackendd.c line 325
Quoted 10 lines
tools/xenbackendd/xenbackendd.c deleted +0
-10-free (s); -free (sstate); - -next1: -free (sdisable); -free (vec); - } - -return 0 ; -}
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
A message that is not in the archive (sent off-list or not yet received): [email protected]
El 28/07/15 a les 13.12, Ian Campbell ha escrit:
Quoted 23 lines · Roger Pau Monne
Quoted 14 lines
The functionality provided by xenbackendd has been integrated into the xl toolstack under the devd command on all platforms, because of that it no longer makes sense to maintain xenbackendd.
Init scripts have also been provided for all platforms in order to launch xl
devd in the background, mimicking the functionality provided by xenbackendd.
Furthermore, xenbackendd is not started by default on NetBSD since a couple
of releases ago (4.2 was the first release to disable the automatic startup
of xenbackendd in xencommons).Quoted 7 lines
Signed-off-by Roger Pau Monné <[email protected]>Cc Ian Jackson <[email protected]>Cc Stefano Stabellini <[email protected]>Cc Ian Campbell <[email protected]>Cc Wei Liu <[email protected]>Cc George Dunlap <[email protected]>Cc <[email protected]>
Quoted 6 lines
I thought I'd replied to this, but the archive and my Sent box both disagree. Anyway:
Acked-by Ian Campbell <[email protected]>Probably not 4.6 material any more though?
Although the risk of this breaking other things is very low IMHO, I don't see much benefit of pushing it to 4.6. It's not going to make the release better or less buggy.
Roger.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 27 lines · Roger Pau Monné
El 28/07/15 a les 13.12, Ian Campbell ha escrit:
Quoted 26 lines · Roger Pau Monne
Quoted 14 lines
The functionality provided by xenbackendd has been integrated into the xl toolstack under the devd command on all platforms, because of that it no longer makes sense to maintain xenbackendd.
Init scripts have also been provided for all platforms in order to launch xl
devd in the background, mimicking the functionality provided by xenbackendd.
Furthermore, xenbackendd is not started by default on NetBSD since a couple
of releases ago (4.2 was the first release to disable the automatic startup
of xenbackendd in xencommons).Quoted 7 lines
Signed-off-by Roger Pau Monné <[email protected]>Cc Ian Jackson <[email protected]>Cc Stefano Stabellini <[email protected]>Cc Ian Campbell <[email protected]>Cc Wei Liu <[email protected]>Cc George Dunlap <[email protected]>Cc <[email protected]>I thought I'd replied to this, but the archive and my Sent box both disagree. Anyway:
Quoted 7 lines
Quoted 3 lines
Acked-by Ian Campbell <[email protected]>Probably not 4.6 material any more though?
Although the risk of this breaking other things is very low IMHO, I don't see much benefit of pushing it to 4.6. It's not going to make the release better or less buggy.
Well, and given that the NetBSD guys have objected before, it might be seen as a bit dodgy to shove a change in at the last minute with no opportunity for them to object again. Given it's just getting rid of dead code, there's no urgency.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel