mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
bitkeeper revision 1.1159.183.4 (41a26aceaXU8CHj-DqjbnM3q7zLf2g)
Merge ssh://xenbk@gandalf.hpl.hp.com//var/bk/xeno-unstable.bk into labyrinth.cl.cam.ac.uk:/auto/anfs/scratch/labyrinth/iap10/xeno-clone/xeno.bk
This commit is contained in:
commit
62d6a29b71
5 files changed
+38
-56
No files matched your search
@@ -258,6 +258,8 @@ int Parser_pop(Parser *p){
|
||||
int err = 0;
|
||||
ParserState *s = p->state;
|
||||
p->state = s->parent;
|
||||
if (p->start_state == s)
|
||||
p->start_state = NULL;
|
||||
ParserState_free(s);
|
||||
return err;
|
||||
}
|
||||
@@ -390,7 +392,7 @@ Sxpr Parser_get_all(Parser *p){
|
||||
if(CONSP(p->val)){
|
||||
v = p->val;
|
||||
p->val = ONONE;
|
||||
} else if(CONSP(p->start_state->val)){
|
||||
} else if(p->start_state && CONSP(p->start_state->val)){
|
||||
v = p->start_state->val;
|
||||
p->start_state->val = ONULL;
|
||||
v = nrev(v);
|
||||
@@ -824,26 +826,13 @@ int at_eof(Parser *p){
|
||||
return p->eof;
|
||||
}
|
||||
|
||||
//#define SXPR_PARSER_MAIN
|
||||
#ifdef SXPR_PARSER_MAIN
|
||||
/* Stuff for standalone testing. */
|
||||
|
||||
#include "file_stream.h"
|
||||
#include "string_stream.h"
|
||||
|
||||
int stringof(Sxpr exp, char **s){
|
||||
int err = 0;
|
||||
if(ATOMP(exp)){
|
||||
*s = atom_name(exp);
|
||||
} else if(STRINGP(exp)){
|
||||
*s = string_string(exp);
|
||||
} else {
|
||||
err = -EINVAL;
|
||||
*s = NULL;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
extern int stringof(Sxpr exp, char **s);
|
||||
int child_string(Sxpr exp, Sxpr key, char **s){
|
||||
int err = 0;
|
||||
Sxpr val = sxpr_child_value(exp, key, ONONE);
|
||||
@@ -851,22 +840,7 @@ int child_string(Sxpr exp, Sxpr key, char **s){
|
||||
return err;
|
||||
}
|
||||
|
||||
int intof(Sxpr exp, int *v){
|
||||
int err = 0;
|
||||
char *s;
|
||||
unsigned long l;
|
||||
if(INTP(exp)){
|
||||
*v = OBJ_INT(exp);
|
||||
} else {
|
||||
err = stringof(exp, &s);
|
||||
if(err) goto exit;
|
||||
err = convert_atoul(s, &l);
|
||||
*v = (int)l;
|
||||
}
|
||||
exit:
|
||||
return err;
|
||||
}
|
||||
|
||||
extern int intof(Sxpr exp, int *v);
|
||||
int child_int(Sxpr exp, Sxpr key, int *v){
|
||||
int err = 0;
|
||||
Sxpr val = sxpr_child_value(exp, key, ONONE);
|
||||
|
||||
+5
-1
@@ -26,11 +26,15 @@ XFRD_PROG_OBJ += $(UTIL_LIB)
|
||||
# Define to use stubs, undefine to use the real Xen functions.
|
||||
#CPPFLAGS += -D _XEN_XFR_STUB_
|
||||
|
||||
ifeq ($(SXPR_DEBUG),1)
|
||||
CPPFLAGS += -D _XEN_XFR_STUB_ -D SXPR_PARSER_MAIN
|
||||
endif
|
||||
|
||||
CC := gcc
|
||||
|
||||
CFLAGS += -g
|
||||
CFLAGS += -Wall
|
||||
CFALGS += -Werror
|
||||
CFLAGS += -Werror
|
||||
CFLAGS += $(INCLUDES)
|
||||
# Make gcc generate dependencies.
|
||||
CFLAGS += -Wp,-MD,.$(@F).d
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#else
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ int xen_domain_snd(Conn *xend, IOStream *io,
|
||||
}
|
||||
|
||||
dom = 99;
|
||||
err = domain_suspend(dom, xend);
|
||||
err = domain_suspend(xend, dom);
|
||||
IOStream_close(io);
|
||||
exit:
|
||||
#else
|
||||
|
||||
+26
-23
@@ -171,6 +171,25 @@ void usage(int err){
|
||||
exit(err ? 1 : 0);
|
||||
}
|
||||
|
||||
typedef struct Args {
|
||||
int bufsize;
|
||||
unsigned long port;
|
||||
int verbose;
|
||||
int compress;
|
||||
} Args;
|
||||
|
||||
/** Transfer states. */
|
||||
enum {
|
||||
XFR_INIT,
|
||||
XFR_HELLO,
|
||||
XFR_STATE,
|
||||
XFR_RUN,
|
||||
XFR_FAIL,
|
||||
XFR_DONE,
|
||||
XFR_MAX
|
||||
};
|
||||
|
||||
#ifndef SXPR_PARSER_MAIN
|
||||
/** Short options. Options followed by ':' take an argument. */
|
||||
static char *short_opts = (char[]){
|
||||
OPT_PORT, ':',
|
||||
@@ -190,23 +209,12 @@ static struct option const long_opts[] = {
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
typedef struct Args {
|
||||
int bufsize;
|
||||
unsigned long port;
|
||||
int verbose;
|
||||
int compress;
|
||||
} Args;
|
||||
/** Xfrd arguments. */
|
||||
static Args _args = {};
|
||||
|
||||
/** Transfer states. */
|
||||
enum {
|
||||
XFR_INIT,
|
||||
XFR_HELLO,
|
||||
XFR_STATE,
|
||||
XFR_RUN,
|
||||
XFR_FAIL,
|
||||
XFR_DONE,
|
||||
XFR_MAX
|
||||
};
|
||||
/** Xfrd arguments. */
|
||||
static Args *args = &_args;
|
||||
#endif
|
||||
|
||||
/** Initialize an array element for a constant to its string name. */
|
||||
#define VALDEF(val) { val, #val }
|
||||
@@ -318,12 +326,6 @@ int XfrState_first_err_state(XfrState *s){
|
||||
return s->err_state;
|
||||
}
|
||||
|
||||
/** Xfrd arguments. */
|
||||
static Args _args = {};
|
||||
|
||||
/** Xfrd arguments. */
|
||||
static Args *args = &_args;
|
||||
|
||||
/** Set xfrd default arguments.
|
||||
*
|
||||
* @param args arguments to set
|
||||
@@ -1212,6 +1214,7 @@ int xfrd_main(Args *args){
|
||||
return err;
|
||||
}
|
||||
|
||||
#ifndef SXPR_PARSER_MAIN
|
||||
/** Parse command-line arguments and call the xfrd main program.
|
||||
*
|
||||
* @param arg argument count
|
||||
@@ -1265,4 +1268,4 @@ int main(int argc, char *argv[]){
|
||||
}
|
||||
return (err ? 1 : 0);
|
||||
}
|
||||
|
||||
#endif
|
||||