diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-10-06 18:44:05 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-10-06 23:19:20 +0100 |
commit | 6867b0a3fb6491e1d26c747100dad364dbf20c70 (patch) | |
tree | 66568c4610d053886815e338b4d943230cb9b278 /src/launch.c | |
parent | 328510121ad720680b71b65b9b2a60e816ca49f8 (diff) | |
download | libguestfs-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/launch.c')
-rw-r--r-- | src/launch.c | 5 |
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) { |