From: "Andreas Färber" <afaerber@suse.de>
To: peter@gridcentric.ca
Cc: andreslc@gridcentric.ca, aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] exec: make -mem-path filenames deterministic
Date: Fri, 01 Mar 2013 19:47:48 +0100 [thread overview]
Message-ID: <5130F7D4.3060406@suse.de> (raw)
In-Reply-To: <1362158493-11907-1-git-send-email-peter@gridcentric.ca>
Am 01.03.2013 18:21, schrieb peter@gridcentric.ca:
> From: Peter Feiner <peter@gridcentric.ca>
>
> Adds ramblocks' names to their backing files when using -mem-path. Eases
> introspection and debugging.
>
> Signed-off-by: Peter Feiner <peter@gridcentric.ca>
> ---
>
> On Tue, Jan 8, 2013 at 2:04 PM, Anthony Liguori <aliguori@us.ibm.com> wrote:
>>
>> Yes, please submit the oneliner.
>
> Here it is :)
>
> The commit should probably be called "exec: add ramblocks' names to -mem-path
> files" since the paths aren't deterministic.
>
> v1 -> v2: Just add ramblock name to mkstemp template.
>
> Thanks,
> Peter
>
> exec.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/exec.c b/exec.c
> index a41bcb8..16a5452 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -865,7 +865,8 @@ static void *file_ram_alloc(RAMBlock *block,
> return NULL;
> }
>
> - filename = g_strdup_printf("%s/qemu_back_mem.XXXXXX", path);
> + filename = g_strdup_printf("%s/qemu_back_mem.%s.XXXXXX", path,
> + block->mr->name);
Is it safe to use a MemoryRegion name as part of mkstemp()? "/../" seems
rather unlikely but a "/" less so.
Also note that v2 is expected to be posted as a top-level patch since
the patches tool does not cope well with "hidden" reposts.
Andreas
>
> fd = mkstemp(filename);
> if (fd < 0) {
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2013-03-01 18:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-20 12:10 [Qemu-devel] [PATCH 0/1] Exogenous memory management via -mem-path Peter Feiner
2012-11-20 12:10 ` [Qemu-devel] [PATCH 1/1] exec: make -mem-path filenames deterministic Peter Feiner
2012-11-29 16:29 ` Peter Feiner
2013-01-07 19:55 ` Anthony Liguori
2013-01-08 15:59 ` Peter Feiner
2013-01-08 19:04 ` Anthony Liguori
2013-01-08 19:59 ` Peter Maydell
2013-03-01 17:21 ` [Qemu-devel] [PATCH v2] " peter
2013-03-01 18:47 ` Andreas Färber [this message]
2013-03-01 19:20 ` Peter Feiner
2013-01-02 19:34 ` [Qemu-devel] [PATCH 0/1] Exogenous memory management via -mem-path Peter Feiner
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=5130F7D4.3060406@suse.de \
--to=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=andreslc@gridcentric.ca \
--cc=peter@gridcentric.ca \
--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).