On 02.09.2025 16:25, Richard Henderson wrote:
On 9/1/25 15:31, Michael Tokarev wrote:

It does not give reasons for "other failures".

It does gloss over the implications of "tmpfs".  But off the top of my head:

(1) tmpfs is generally smaller than any other disk-based tmpdir,
     so ENOSPC is easier to trigger, and
(2) tmpfs does not support several O_FOO.

O_DIRECT, yes.  I tried to fix this in mid-2000s, but weren't able to
convince Linus at the time.  Now, in current kernels, O_DIRECT is
finally supported, so this is a non-issue today.

But all this is beyond the point.  The point is that we must not
pretend we know better than the user who set $TMPDIR before invoking
qemu, and override user's choice silently.

Please note: in my case, /var/tmp is the default value, when the user
didn't specify anything.  If the user did specify $TMPDIR, it is what
we should use.

If we want some other mechanism to set the temp directory, we should
(or might) implement it.  But in the new mechanism, we, again, should
not silently substitute /var/tmp for /tmp, as we currently do.  This
is just plain wrong.

Are you saying the user, who decided to explicitly specify TMPDIR,
is wrong, and qemu should use /var/tmp which does not even exist
(see the bug report this patch is fixing)?

I think this is a very strong interpretation since the non-existence of /var/tmp is, IMO, new and rare.  /var/tmp most certainly *does* exist with all of the major distros.

Please see the referenced issue,
https://gitlab.com/qemu-project/qemu/-/issues/1626 , -
myself, I'm not a fan of such systems which violate basic principles
(and I already closed that bug report in the past).

But once again, this is not the point.  The point is that we override
user's choice by our "better" value.  *This* is what I'm trying to fix,
-- we should not pretend we know better than the user.

The original code (before 69fbfff95e84) was correct.  Current code
is not.  My change fixes current wrong code.

If this goes in as-is, you are on the hook for any reported testsuite regression.

Sure.  If there will be regressions, it means we didn't honor our own
choices somewhere, - when we did set TMPDIR but our qemu being tested
used some different place.

Thanks,

/mjt

Reply via email to