mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
Revert stubdom+xenstore 9pfs changes
to unblock CI. It turns out there are still issues in some configurations. https://gitlab.com/xen-project/xen/-/pipelines/1188660609 This reverts commitf5e1c527d0. This reverts commita76f8809f1. This reverts commit93892648ff. This reverts commit297a2587e6. This reverts commit0b761781c4. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
f5e1c527d0
commit
92babc88f6
11 files changed
+30
-107
No files matched your search
@@ -3,7 +3,7 @@ CONFIG_NETFRONT=n
|
||||
CONFIG_FBFRONT=n
|
||||
CONFIG_KBDFRONT=n
|
||||
CONFIG_CONSFRONT=n
|
||||
CONFIG_XENBUS=n
|
||||
CONFIG_LWIP=n
|
||||
CONFIG_9PFRONT=y
|
||||
CONFIG_BALLOON=y
|
||||
XEN_INTERFACE_VERSION=__XEN_LATEST_INTERFACE_VERSION__
|
||||
@@ -4,7 +4,7 @@ CONFIG_NETFRONT=n
|
||||
CONFIG_FBFRONT=n
|
||||
CONFIG_KBDFRONT=n
|
||||
CONFIG_CONSFRONT=n
|
||||
CONFIG_XENBUS=n
|
||||
CONFIG_LWIP=n
|
||||
CONFIG_9PFRONT=y
|
||||
CONFIG_BALLOON=y
|
||||
XEN_INTERFACE_VERSION=__XEN_LATEST_INTERFACE_VERSION__
|
||||
@@ -58,6 +58,7 @@ XENSTORED_ARGS=
|
||||
## Default: Not defined, tracing off
|
||||
#
|
||||
# Log xenstored messages
|
||||
# Only evaluated if XENSTORETYPE is "daemon".
|
||||
#XENSTORED_TRACE=[yes|on|1]
|
||||
|
||||
## Type: integer
|
||||
|
||||
@@ -98,7 +98,6 @@ test -f @CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons && . @CONFIG_DIR@/@CONFIG_LEAF
|
||||
[ -z "$XENSTORE_DOMAIN_SIZE" ] && XENSTORE_DOMAIN_SIZE=8
|
||||
XENSTORE_DOMAIN_ARGS="$XENSTORE_DOMAIN_ARGS --memory $XENSTORE_DOMAIN_SIZE"
|
||||
[ -z "$XENSTORE_MAX_DOMAIN_SIZE" ] || XENSTORE_DOMAIN_ARGS="$XENSTORE_DOMAIN_ARGS --maxmem $XENSTORE_MAX_DOMAIN_SIZE"
|
||||
[ -z "$XENSTORED_TRACE" ] || XENSTORE_DOMAIN_ARGS="$XENSTORE_DOMAIN_ARGS -T xenstored-trace.log"
|
||||
|
||||
echo -n Starting $XENSTORE_DOMAIN_KERNEL...
|
||||
${LIBEXEC_BIN}/init-xenstore-domain $XENSTORE_DOMAIN_ARGS || exit 1
|
||||
|
||||
@@ -201,6 +201,19 @@ static int do_control_quota_s(const void *ctx, struct connection *conn,
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
#ifdef __MINIOS__
|
||||
static int do_control_memreport(const void *ctx, struct connection *conn,
|
||||
const char **vec, int num)
|
||||
{
|
||||
if (num)
|
||||
return EINVAL;
|
||||
|
||||
talloc_report_full(NULL, stdout);
|
||||
|
||||
send_ack(conn, XS_CONTROL);
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static int do_control_logfile(const void *ctx, struct connection *conn,
|
||||
const char **vec, int num)
|
||||
{
|
||||
@@ -209,7 +222,7 @@ static int do_control_logfile(const void *ctx, struct connection *conn,
|
||||
|
||||
close_log();
|
||||
talloc_free(tracefile);
|
||||
tracefile = absolute_filename(NULL, vec[0]);
|
||||
tracefile = talloc_strdup(NULL, vec[0]);
|
||||
reopen_log();
|
||||
|
||||
send_ack(conn, XS_CONTROL);
|
||||
@@ -220,7 +233,6 @@ static int do_control_memreport(const void *ctx, struct connection *conn,
|
||||
const char **vec, int num)
|
||||
{
|
||||
FILE *fp;
|
||||
const char *filename;
|
||||
int fd;
|
||||
|
||||
if (num > 1)
|
||||
@@ -243,12 +255,8 @@ static int do_control_memreport(const void *ctx, struct connection *conn,
|
||||
if (!fp)
|
||||
close(fd);
|
||||
}
|
||||
} else {
|
||||
filename = absolute_filename(ctx, vec[0]);
|
||||
if (!filename)
|
||||
return ENOMEM;
|
||||
fp = fopen(filename, "a");
|
||||
}
|
||||
} else
|
||||
fp = fopen(vec[0], "a");
|
||||
|
||||
if (!fp)
|
||||
return EBADF;
|
||||
@@ -259,6 +267,7 @@ static int do_control_memreport(const void *ctx, struct connection *conn,
|
||||
send_ack(conn, XS_CONTROL);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int do_control_print(const void *ctx, struct connection *conn,
|
||||
const char **vec, int num)
|
||||
@@ -300,8 +309,12 @@ static struct cmd_s cmds[] = {
|
||||
"[-c <cmdline>] [-F] [-t <timeout>] <file>\n"
|
||||
" Default timeout is 60 seconds.", 5 },
|
||||
#endif
|
||||
#ifdef __MINIOS__
|
||||
{ "memreport", do_control_memreport, "" },
|
||||
#else
|
||||
{ "logfile", do_control_logfile, "<file>" },
|
||||
{ "memreport", do_control_memreport, "[<file>]" },
|
||||
#endif
|
||||
{ "print", do_control_print, "<string>" },
|
||||
{ "quota", do_control_quota,
|
||||
"[set <name> <val>|<domid>|max [-r]]" },
|
||||
|
||||
+2
-13
@@ -63,7 +63,7 @@ char **orig_argv;
|
||||
LIST_HEAD(connections);
|
||||
int tracefd = -1;
|
||||
bool keep_orphans = false;
|
||||
const char *tracefile = NULL;
|
||||
char *tracefile = NULL;
|
||||
static struct hashtable *nodes;
|
||||
unsigned int trace_flags = TRACE_OBJ | TRACE_IO;
|
||||
|
||||
@@ -137,17 +137,6 @@ void trace_destroy(const void *data, const char *type)
|
||||
trace("obj: DESTROY %s %p\n", type, data);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return an absolute filename.
|
||||
* In case of a relative filename given as input, prepend XENSTORE_LIB_DIR.
|
||||
*/
|
||||
const char *absolute_filename(const void *ctx, const char *filename)
|
||||
{
|
||||
if (filename[0] != '/')
|
||||
return talloc_asprintf(ctx, XENSTORE_LIB_DIR "/%s", filename);
|
||||
return talloc_strdup(ctx, filename);
|
||||
}
|
||||
|
||||
void close_log(void)
|
||||
{
|
||||
if (tracefd >= 0)
|
||||
@@ -2770,7 +2759,7 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
if (tracefile)
|
||||
tracefile = absolute_filename(NULL, tracefile);
|
||||
tracefile = talloc_strdup(NULL, tracefile);
|
||||
|
||||
#ifndef NO_LIVE_UPDATE
|
||||
/* Read state in case of live update. */
|
||||
|
||||
+1
-10
@@ -36,8 +36,6 @@
|
||||
#include "list.h"
|
||||
#include "hashtable.h"
|
||||
|
||||
#define XENSTORE_LIB_DIR XEN_LIB_DIR "/xenstore"
|
||||
|
||||
#ifndef O_CLOEXEC
|
||||
#define O_CLOEXEC 0
|
||||
/* O_CLOEXEC support is needed for Live Update in the daemon case. */
|
||||
@@ -341,7 +339,7 @@ void close_log(void);
|
||||
extern int orig_argc;
|
||||
extern char **orig_argv;
|
||||
|
||||
extern const char *tracefile;
|
||||
extern char *tracefile;
|
||||
extern int tracefd;
|
||||
|
||||
/* Trace flag values must be kept in sync with trace_switches[] contents. */
|
||||
@@ -401,13 +399,6 @@ void handle_special_fds(void);
|
||||
int get_socket_fd(void);
|
||||
void set_socket_fd(int fd);
|
||||
|
||||
#ifdef __MINIOS__
|
||||
void mount_9pfs(void);
|
||||
#endif
|
||||
|
||||
const char *xenstore_rundir(void);
|
||||
const char *absolute_filename(const void *ctx, const char *filename);
|
||||
|
||||
/* Close stdin/stdout/stderr to complete daemonize */
|
||||
void finish_daemonize(void);
|
||||
|
||||
|
||||
@@ -1236,8 +1236,6 @@ void stubdom_init(void)
|
||||
barf_perror("Failed to initialize stubdom");
|
||||
|
||||
xenevtchn_notify(xce_handle, stubdom->port);
|
||||
|
||||
mount_9pfs();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ void lu_get_dump_state(struct lu_dump_state *state)
|
||||
state->size = 0;
|
||||
|
||||
state->filename = talloc_asprintf(NULL, "%s/state_dump",
|
||||
xenstore_rundir());
|
||||
xenstore_daemon_rundir());
|
||||
if (!state->filename)
|
||||
barf("Allocation failure");
|
||||
|
||||
@@ -65,7 +65,7 @@ FILE *lu_dump_open(const void *ctx)
|
||||
int fd;
|
||||
|
||||
filename = talloc_asprintf(ctx, "%s/state_dump",
|
||||
xenstore_rundir());
|
||||
xenstore_daemon_rundir());
|
||||
if (!filename)
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -17,20 +17,10 @@
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <syslog.h>
|
||||
#include "talloc.h"
|
||||
#include "core.h"
|
||||
#include "utils.h"
|
||||
#include <xen/grant_table.h>
|
||||
#include <mini-os/lib.h>
|
||||
#include <mini-os/9pfront.h>
|
||||
#include <mini-os/sched.h>
|
||||
#include <mini-os/xenbus.h>
|
||||
#include <mini-os/xmalloc.h>
|
||||
|
||||
#define P9_STATE_PATH "device/9pfs/0/state"
|
||||
|
||||
static void *p9_device;
|
||||
|
||||
void finish_daemonize(void)
|
||||
{
|
||||
@@ -84,55 +74,3 @@ int get_socket_fd(void)
|
||||
void set_socket_fd(int fd)
|
||||
{
|
||||
}
|
||||
|
||||
static void mount_thread(void *p)
|
||||
{
|
||||
xenbus_event_queue events = NULL;
|
||||
char *err;
|
||||
char *dummy;
|
||||
|
||||
err = xenbus_watch_path_token(XBT_NIL, P9_STATE_PATH, "9pfs", &events);
|
||||
if (err) {
|
||||
log("error \"%s\" when setting watch on \"%s\"\n", err,
|
||||
P9_STATE_PATH);
|
||||
free(err);
|
||||
return;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
xenbus_wait_for_watch(&events);
|
||||
|
||||
/*
|
||||
* We only care for existence of the state node.
|
||||
* State changes are handled in init_9pfront().
|
||||
*/
|
||||
err = xenbus_read(XBT_NIL, P9_STATE_PATH, &dummy);
|
||||
if (!err)
|
||||
break;
|
||||
free(err);
|
||||
}
|
||||
|
||||
free(dummy);
|
||||
|
||||
err = xenbus_unwatch_path_token(XBT_NIL, P9_STATE_PATH, "9pfs");
|
||||
if (err) {
|
||||
log("error \"%s\" when unwatching \"%s\", leaking watch\n",
|
||||
err, P9_STATE_PATH);
|
||||
free(err);
|
||||
}
|
||||
|
||||
p9_device = init_9pfront(0, XENSTORE_LIB_DIR);
|
||||
|
||||
/* Start logging if selected. */
|
||||
reopen_log();
|
||||
}
|
||||
|
||||
void mount_9pfs(void)
|
||||
{
|
||||
create_thread("mount-9pfs", mount_thread, NULL);
|
||||
}
|
||||
|
||||
const char *xenstore_rundir(void)
|
||||
{
|
||||
return XENSTORE_LIB_DIR;
|
||||
}
|
||||
@@ -326,10 +326,9 @@ void early_init(bool live_update, bool dofork, const char *pidfile)
|
||||
{
|
||||
reopen_log();
|
||||
|
||||
/* Make sure xenstored directories exist. */
|
||||
/* Make sure xenstored directory exists. */
|
||||
/* Errors ignored here, will be reported when we open files */
|
||||
mkdir(xenstore_daemon_rundir(), 0755);
|
||||
mkdir(XENSTORE_LIB_DIR, 0755);
|
||||
|
||||
if (dofork) {
|
||||
openlog("xenstored", 0, LOG_DAEMON);
|
||||
@@ -407,8 +406,3 @@ void set_socket_fd(int fd)
|
||||
{
|
||||
sock = fd;
|
||||
}
|
||||
|
||||
const char *xenstore_rundir(void)
|
||||
{
|
||||
return xenstore_daemon_rundir();
|
||||
}
|
||||