]> xenbits.xensource.com Git - qemu-xen-4.6-testing.git/commitdiff
qemu-dm: open char devices "file:..." with O_APPEND
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 28 Nov 2011 17:16:52 +0000 (17:16 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 28 Nov 2011 17:16:52 +0000 (17:16 +0000)
The "file:..." character open method is used by serial and parallel
ports, to divert the output to a file (and these devices never produce
any input).  This is like a logfile, and so should be opened for
append.

In qemu-xen-unstable, this is used only for the qemu stderr by libxl.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
qemu-char.c

index 35e428d12ae2a138603f7b02f097a5b68fbb92d2..324ed16ec73b5f19b300a7a43ba95526a2d48406 100644 (file)
@@ -588,7 +588,7 @@ static CharDriverState *qemu_chr_open_file_out(const char *file_out)
 {
     int fd_out;
 
-    TFR(fd_out = open(file_out, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0666));
+    TFR(fd_out = open(file_out, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY | O_APPEND, 0666));
     if (fd_out < 0)
         return NULL;
     return qemu_chr_open_fd(-1, fd_out);