* [Qemu-devel] Use TMPDIR environment Variable for Snapshot Mode
@ 2007-03-17 1:40 Oliver Adler
0 siblings, 0 replies; only message in thread
From: Oliver Adler @ 2007-03-17 1:40 UTC (permalink / raw)
To: qemu-devel
Hi Folks,
thank you VERY MUCH for bringing qemu to us.
I would like to see this little modification, honoring the
setting of the TMPDIR environment variable. Then I can use
the snapshot mode even if my /tmp directory is small in
size:
The diff is based on the qemu-0.9.0 release.
--- block.c+ Sat Mar 17 02:06:26 2007
+++ block.c Fri Mar 16 23:21:21 2007
@@ -188,8 +188,13 @@
void get_tmp_filename(char *filename, int size)
{
int fd;
+ char *tmpdir;
/* XXX: race condition possible */
- pstrcpy(filename, size, "/tmp/vl.XXXXXX");
+ tmpdir = getenv("TMPDIR");
+ if (tmpdir == NULL)
+ tmpdir = "/tmp";
+ snprintf(filename, size, "%s/vl.XXXXXX", tmpdir);
+// pstrcpy(filename, size, "/tmp/vl.XXXXXX");
fd = mkstemp(filename);
close(fd);
}
Thank you
Oliver
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-03-17 1:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-17 1:40 [Qemu-devel] Use TMPDIR environment Variable for Snapshot Mode Oliver Adler
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.