[Libguestfs] [PATCH nbdkit v2] New tmpdisk plugin.
Eric Blake
eblake at redhat.com
Tue Mar 17 12:05:18 UTC 2020
On 3/17/20 6:58 AM, Richard W.M. Jones wrote:
> On Tue, Mar 17, 2020 at 06:16:49AM -0500, Eric Blake wrote:
>>> +static void *
>>> +tmpdisk_open (int readonly)
>>> +{
>>> + struct handle *h;
>>> + CLEANUP_FREE char *disk = NULL;
>>> + const char *tmpdir;
>>> +
>>> + tmpdir = getenv ("TMPDIR");
>>> + if (!tmpdir)
>>> + tmpdir = "/var/tmp";
>>
>> Rather than calling getenv() for every client, should we
>> pre-populate a file-scope variable once during .get_ready?
>
> Is there a particular reason to do it in .get_ready instead
> of .load? In v3 I did it in .load
Either works for me. If it depended on .config, then .get_ready would
have made sense, but as it is truly independent of the command line,
.load is fine :)
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
More information about the Libguestfs
mailing list