ia64/xen-unstable

changeset 2247:929e4eab6e66

bitkeeper revision 1.1159.1.67 (41207f1cCT7YHIMzP5SKhkRLzpuobA)

Don't compress domain save files.
Don't use O_EXCL.
author mjw@wray-m-3.hpl.hp.com
date Mon Aug 16 09:32:12 2004 +0000 (2004-08-16)
parents 2f6326715a73
children 64ae4d06485a
files tools/libxutil/Makefile tools/xfrd/xfrd.c
line diff
     1.1 --- a/tools/libxutil/Makefile	Mon Aug 16 08:52:15 2004 +0000
     1.2 +++ b/tools/libxutil/Makefile	Mon Aug 16 09:32:12 2004 +0000
     1.3 @@ -27,16 +27,14 @@ MAJOR    := 1.3
     1.4  MINOR    := 0
     1.5  LIB_NAME := libxutil
     1.6  LIB      := $(LIB_NAME).so 
     1.7 -LIB      += $(LIB_NAME).so.$(MAJOR)
     1.8 -LIB      += $(LIB_NAME).so.$(MAJOR).$(MINOR)
     1.9  
    1.10  all: check-for-zlib $(LIB)
    1.11  
    1.12 -$(LIB_NAME).so:
    1.13 -	ln -sf $(LIB_NAME).so.$(MAJOR) $@
    1.14 +$(LIB_NAME).so: $(LIB_NAME).so.$(MAJOR)
    1.15 +	ln -sf $^ $@
    1.16  
    1.17 -$(LIB_NAME).so.$(MAJOR):
    1.18 -	ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $@
    1.19 +$(LIB_NAME).so.$(MAJOR): $(LIB_NAME).so.$(MAJOR).$(MINOR)
    1.20 +	ln -sf $^ $@
    1.21  
    1.22  $(LIB_NAME).so.$(MAJOR).$(MINOR): $(LIB_OBJS)
    1.23  	$(CC) -Wl,-soname -Wl,$(LIB_NAME).so.$(MAJOR) -shared -o $@ $^
    1.24 @@ -54,7 +52,7 @@ install: all
    1.25  	install -m0755 $(LIB) $(prefix)/usr/lib
    1.26  
    1.27  clean:
    1.28 -	$(RM) *.a *.so *.o *.rpm $(LIB)
    1.29 +	$(RM) *.a *.so *.so.* *.o *.rpm 
    1.30  	$(RM) *~
    1.31  	$(RM) $(DEPS)
    1.32  
     2.1 --- a/tools/xfrd/xfrd.c	Mon Aug 16 08:52:15 2004 +0000
     2.2 +++ b/tools/xfrd/xfrd.c	Mon Aug 16 09:32:12 2004 +0000
     2.3 @@ -738,22 +738,18 @@ int xfr_send(Args *args, XfrState *state
     2.4   */
     2.5  int xfr_save(Args *args, XfrState *state, Conn *xend, char *file){
     2.6      int err = 0;
     2.7 -    int flags = (O_CREAT | O_EXCL | O_WRONLY);
     2.8 -    int mode = 0644;
     2.9 -    int fd;
    2.10 +    int compress = 0;
    2.11      IOStream *io = NULL;
    2.12  
    2.13      dprintf("> file=%s\n", file);
    2.14 -    fd = open(file, flags, mode);
    2.15 -    if(fd < 0) {
    2.16 +    if(compress){
    2.17 +        io = gzip_stream_fopen(file, "wb1");
    2.18 +    } else {
    2.19 +        io = file_stream_fopen(file, "wb");
    2.20 +    }
    2.21 +    if(!io){
    2.22          eprintf("> Failed to open %s\n", file);
    2.23 -        err = -EIO;
    2.24 -        goto exit;
    2.25 -    }
    2.26 -    io = gzip_stream_fdopen(fd, "wb1");
    2.27 -    if(!io){
    2.28 -        eprintf("> Failed to allocate gzip state for %s\n", file);
    2.29 -        err = -ENOMEM;
    2.30 +        err = -EINVAL;
    2.31          goto exit;
    2.32      }
    2.33      err = xen_domain_snd(xend, io, state->vmid, state->vmconfig, state->vmconfig_n);