From: Thomas Huth <thuth@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>,
"Bin Meng" <bin.meng@windriver.com>
Cc: Fam Zheng <fam@euphon.net>, qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH] tests/unit/test-image-locking: Fix handling of temporary files
Date: Wed, 12 Oct 2022 11:46:38 +0200 [thread overview]
Message-ID: <1db96c1d-d54e-cf06-588d-9204dd31e55f@redhat.com> (raw)
In-Reply-To: <CAJ+F1C+ebT3se0QUNwUxiC_1TAnuDhTkW2jus3DmsgPOEKSypA@mail.gmail.com>
On 12/10/2022 11.21, Marc-André Lureau wrote:
> Hi
>
> On Wed, Oct 12, 2022 at 1:03 PM Thomas Huth <thuth@redhat.com
> <mailto:thuth@redhat.com>> wrote:
>
> test-image-locking leaves some temporary files around - clean
> them up. While we're at it, test-image-locking is a unit test,
> so it should not use "qtest.*" for temporary file names. Give
> them better names instead, so that it clear where the temporary
> files come from.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com <mailto:thuth@redhat.com>>
> ---
[...]
> @@ -140,6 +140,8 @@ static void test_set_perm_abort(void)
> check_locked_bytes(fd, perm, ~shared_perm);
> blk_unref(blk1);
> blk_unref(blk2);
> + close(fd);
> + unlink(img_path);
>
>
> Perhaps we should use g_unlink() instead for better portability? although
> this is pre-existing.
I thought about that, too, but apparently you have to include an additional
header file (gstdio.h) to get the prototype - so it seems to be more effort
for no real gain (unless you want to use non-ASCII characters in the
filename - which we are not doing here).
Thomas
next prev parent reply other threads:[~2022-10-12 9:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 8:59 [PATCH] tests/unit/test-image-locking: Fix handling of temporary files Thomas Huth
2022-10-12 9:21 ` Marc-André Lureau
2022-10-12 9:46 ` Thomas Huth [this message]
2022-10-12 12:59 ` Bin Meng
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=1db96c1d-d54e-cf06-588d-9204dd31e55f@redhat.com \
--to=thuth@redhat.com \
--cc=bin.meng@windriver.com \
--cc=fam@euphon.net \
--cc=marcandre.lureau@gmail.com \
--cc=qemu-block@nongnu.org \
--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).