summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-10-06 18:44:05 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-10-06 23:19:20 +0100
commit6867b0a3fb6491e1d26c747100dad364dbf20c70 (patch)
tree66568c4610d053886815e338b4d943230cb9b278 /src
parent328510121ad720680b71b65b9b2a60e816ca49f8 (diff)
downloadlibguestfs-6867b0a3fb6491e1d26c747100dad364dbf20c70.tar.gz
libguestfs-6867b0a3fb6491e1d26c747100dad364dbf20c70.tar.xz
libguestfs-6867b0a3fb6491e1d26c747100dad364dbf20c70.zip
launch: add_null_drive: Force null drive to be writable.
Because we create a special file, there is no point forcing qemu to create an overlay as well. Save time by setting readonly = 0.
Diffstat (limited to 'src')
-rw-r--r--src/launch.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/launch.c b/src/launch.c
index f325d9f2..4b5ed347 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -190,6 +190,11 @@ add_null_drive (guestfs_h *g, int readonly, const char *format,
if (guestfs___lazy_make_tmpdir (g) == -1)
return -1;
+ /* Because we create a special file, there is no point forcing qemu
+ * to create an overlay as well. Save time by setting readonly = 0.
+ */
+ readonly = 0;
+
tmpfile = safe_asprintf (g, "%s/devnull%d", g->tmpdir, ++g->unique);
fd = open (tmpfile, O_WRONLY|O_CREAT|O_NOCTTY|O_CLOEXEC, 0600);
if (fd == -1) {