From: Oliver Adler <buddy@a999.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Use TMPDIR environment Variable for Snapshot Mode
Date: Sat, 17 Mar 2007 02:40:59 +0100 [thread overview]
Message-ID: <20070317014058.GD25003@hermes.devsoft.com> (raw)
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
reply other threads:[~2007-03-17 1:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070317014058.GD25003@hermes.devsoft.com \
--to=buddy@a999.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).