* [Qemu-devel] [PATCH 1/1] block: use /var/tmp instead of /tmp for -snapshot
@ 2014-02-26 9:42 Amit Shah
2014-02-27 10:18 ` Stefan Hajnoczi
0 siblings, 1 reply; 4+ messages in thread
From: Amit Shah @ 2014-02-26 9:42 UTC (permalink / raw)
To: qemu list; +Cc: Kevin Wolf, Amit Shah, Stefan Hajnoczi
If TMPDIR is not specified, the default was to use /tmp for the working
copy of the block devices. Update this to /var/tmp instead, so systems
using tmp-on-tmpfs don't end up inadvertently using RAM for the block
device.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
block.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/block.c b/block.c
index 2fd5482..38bbdf3 100644
--- a/block.c
+++ b/block.c
@@ -547,8 +547,9 @@ int get_tmp_filename(char *filename, int size)
int fd;
const char *tmpdir;
tmpdir = getenv("TMPDIR");
- if (!tmpdir)
- tmpdir = "/tmp";
+ if (!tmpdir) {
+ tmpdir = "/var/tmp";
+ }
if (snprintf(filename, size, "%s/vl.XXXXXX", tmpdir) >= size) {
return -EOVERFLOW;
}
--
1.8.5.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] block: use /var/tmp instead of /tmp for -snapshot
2014-02-26 9:42 [Qemu-devel] [PATCH 1/1] block: use /var/tmp instead of /tmp for -snapshot Amit Shah
@ 2014-02-27 10:18 ` Stefan Hajnoczi
2014-02-27 11:33 ` Amit Shah
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Hajnoczi @ 2014-02-27 10:18 UTC (permalink / raw)
To: Amit Shah; +Cc: Kevin Wolf, qemu list, Stefan Hajnoczi
On Wed, Feb 26, 2014 at 03:12:37PM +0530, Amit Shah wrote:
> If TMPDIR is not specified, the default was to use /tmp for the working
> copy of the block devices. Update this to /var/tmp instead, so systems
> using tmp-on-tmpfs don't end up inadvertently using RAM for the block
> device.
>
> Signed-off-by: Amit Shah <amit.shah@redhat.com>
> ---
> block.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Was expecting someone to argue against this because a path change is
always controversial :-). But I think this makes sense and no one is
protesting....
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] block: use /var/tmp instead of /tmp for -snapshot
2014-02-27 10:18 ` Stefan Hajnoczi
@ 2014-02-27 11:33 ` Amit Shah
2014-02-27 13:42 ` Eric Blake
0 siblings, 1 reply; 4+ messages in thread
From: Amit Shah @ 2014-02-27 11:33 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Kevin Wolf, qemu list, Stefan Hajnoczi
On (Thu) 27 Feb 2014 [11:18:15], Stefan Hajnoczi wrote:
> On Wed, Feb 26, 2014 at 03:12:37PM +0530, Amit Shah wrote:
> > If TMPDIR is not specified, the default was to use /tmp for the working
> > copy of the block devices. Update this to /var/tmp instead, so systems
> > using tmp-on-tmpfs don't end up inadvertently using RAM for the block
> > device.
> >
> > Signed-off-by: Amit Shah <amit.shah@redhat.com>
> > ---
> > block.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
>
> Was expecting someone to argue against this because a path change is
> always controversial :-). But I think this makes sense and no one is
> protesting....
You mean I can relax my crossed fingers now?
> Thanks, applied to my block tree:
> https://github.com/stefanha/qemu/commits/block
Thanks!
Amit
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] block: use /var/tmp instead of /tmp for -snapshot
2014-02-27 11:33 ` Amit Shah
@ 2014-02-27 13:42 ` Eric Blake
0 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2014-02-27 13:42 UTC (permalink / raw)
To: Amit Shah, Stefan Hajnoczi; +Cc: Kevin Wolf, qemu list, Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 1038 bytes --]
On 02/27/2014 04:33 AM, Amit Shah wrote:
> On (Thu) 27 Feb 2014 [11:18:15], Stefan Hajnoczi wrote:
>> On Wed, Feb 26, 2014 at 03:12:37PM +0530, Amit Shah wrote:
>>> If TMPDIR is not specified, the default was to use /tmp for the working
>>> copy of the block devices. Update this to /var/tmp instead, so systems
>>> using tmp-on-tmpfs don't end up inadvertently using RAM for the block
>>> device.
>>>
>>> Signed-off-by: Amit Shah <amit.shah@redhat.com>
>>> ---
>>> block.c | 5 +++--
>>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> Was expecting someone to argue against this because a path change is
>> always controversial :-). But I think this makes sense and no one is
>> protesting....
No protests here. Libvirt doesn't use -snapshot to trigger the behavior
in the first place, and even if it did, it is always possible to
explicitly set TMPDIR if you don't like the (changed) default.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-02-27 13:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-26 9:42 [Qemu-devel] [PATCH 1/1] block: use /var/tmp instead of /tmp for -snapshot Amit Shah
2014-02-27 10:18 ` Stefan Hajnoczi
2014-02-27 11:33 ` Amit Shah
2014-02-27 13:42 ` Eric Blake
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).