aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xfrd
diff options
context:
space:
mode:
authormjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>2004-08-16 09:32:12 +0000
committermjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>2004-08-16 09:32:12 +0000
commitcf9d7415abe59356baf7e792d5594c94aaa47696 (patch)
tree9887580eabe9dfb749f2f0834f86f3291c1a5f08 /tools/xfrd
parentd9cdfdffb669e59a4b24d39b94407942a0a5fe82 (diff)
downloadxen-cf9d7415abe59356baf7e792d5594c94aaa47696.tar.gz
xen-cf9d7415abe59356baf7e792d5594c94aaa47696.tar.bz2
xen-cf9d7415abe59356baf7e792d5594c94aaa47696.zip
bitkeeper revision 1.1159.1.67 (41207f1cCT7YHIMzP5SKhkRLzpuobA)
Don't compress domain save files. Don't use O_EXCL.
Diffstat (limited to 'tools/xfrd')
-rw-r--r--tools/xfrd/xfrd.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/tools/xfrd/xfrd.c b/tools/xfrd/xfrd.c
index c5abcdcf1b..5f3b4752bf 100644
--- a/tools/xfrd/xfrd.c
+++ b/tools/xfrd/xfrd.c
@@ -738,22 +738,18 @@ int xfr_send(Args *args, XfrState *state, Conn *xend, uint32_t addr, uint32_t po
*/
int xfr_save(Args *args, XfrState *state, Conn *xend, char *file){
int err = 0;
- int flags = (O_CREAT | O_EXCL | O_WRONLY);
- int mode = 0644;
- int fd;
+ int compress = 0;
IOStream *io = NULL;
dprintf("> file=%s\n", file);
- fd = open(file, flags, mode);
- if(fd < 0) {
- eprintf("> Failed to open %s\n", file);
- err = -EIO;
- goto exit;
+ if(compress){
+ io = gzip_stream_fopen(file, "wb1");
+ } else {
+ io = file_stream_fopen(file, "wb");
}
- io = gzip_stream_fdopen(fd, "wb1");
if(!io){
- eprintf("> Failed to allocate gzip state for %s\n", file);
- err = -ENOMEM;
+ eprintf("> Failed to open %s\n", file);
+ err = -EINVAL;
goto exit;
}
err = xen_domain_snd(xend, io, state->vmid, state->vmconfig, state->vmconfig_n);