qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Akihiko Odaki <akihiko.odaki@daynix.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	"Yuval Shaia" <yuval.shaia.ml@gmail.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Konstantin Kostiuk" <kkostiuk@redhat.com>,
	"Michael Roth" <michael.roth@amd.com>,
	"Fam Zheng" <fam@euphon.net>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Stefan Weil" <sw@weilnetz.de>, "Yan Vugenfirer" <yan@daynix.com>
Subject: Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()
Date: Tue, 16 Jul 2024 22:35:23 +0900	[thread overview]
Message-ID: <fe1f7bb0-b235-4f57-ab56-8da1ef0ce18e@daynix.com> (raw)
In-Reply-To: <CABgObfab1xUc8bz7Sr4zs+tiKwLBmPK-App+iULE2AHhz2-rbw@mail.gmail.com>

On 2024/07/16 22:29, Paolo Bonzini wrote:
> On Tue, Jul 16, 2024 at 2:46 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>>
>> On 2024/07/16 19:43, Paolo Bonzini wrote:
>>> On Tue, Jul 16, 2024 at 11:56 AM Daniel P. Berrangé <berrange@redhat.com> wrote:
>>>>
>>>> On Tue, Jul 16, 2024 at 11:06:57AM +0300, Michael Tokarev wrote:
>>>>> 16.07.2024 10:27, Akihiko Odaki wrote:
>>>>>> qemu_get_runtime_dir() returns a dynamically allocated directory path
>>>>>> that is appropriate for storing runtime files. It corresponds to "run"
>>>>>> directory in Unix.
>>>>>
>>>>> Since runtime dir is always used with a filename within, how about
>>>>>
>>>>>     char *qemu_get_runtime_path(const char *filename)
>>>>>
>>>>> which return RUNTIME_DIR/filename instead of just RUNTIME_DIR ?
>>>>
>>>> Yeah, I agree, every single caller of the function goes on to call
>>>> g_build_filename with the result. The helper should just be building
>>>> the filename itself.
>>>
>>> That would mean using variable arguments and g_build_filename_valist().
>>
>> We can't prepend an element to va_list.
> 
> You could do it in two steps, with g_build_filename(runtime_dir,
> first) followed by g_build_filename_valist(result, ap); doing these
> steps only if if first != NULL of course.

It unfortunately involves an extra effort to free the result of the 
first call of g_build_filename().

Regards,
Akihiko Odaki


  reply	other threads:[~2024-07-16 13:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-16  7:27 [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir() Akihiko Odaki
2024-07-16  7:27 ` [PATCH v4 1/7] " Akihiko Odaki
2024-07-16  9:53   ` Daniel P. Berrangé
2024-07-16 10:52     ` Akihiko Odaki
2024-07-16 10:54       ` Daniel P. Berrangé
2024-07-16 11:27         ` Akihiko Odaki
2024-07-16  7:27 ` [PATCH v4 2/7] ivshmem-server: Use qemu_get_runtime_dir() Akihiko Odaki
2024-07-16  7:27 ` [PATCH v4 3/7] qga: " Akihiko Odaki
2024-07-16  7:27 ` [PATCH v4 4/7] scsi: " Akihiko Odaki
2024-07-16  7:27 ` [PATCH v4 5/7] module: " Akihiko Odaki
2024-07-16  7:27 ` [PATCH v4 6/7] util: Remove qemu_get_local_state_dir() Akihiko Odaki
2024-07-16  7:27 ` [PATCH v4 7/7] spice-app: Use qemu_get_runtime_dir() Akihiko Odaki
2024-07-16  8:06 ` [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir() Michael Tokarev
2024-07-16  9:32   ` Akihiko Odaki
2024-07-16  9:41     ` Michael Tokarev
2024-07-16  9:56   ` Daniel P. Berrangé
2024-07-16 10:43     ` Paolo Bonzini
2024-07-16 12:45       ` Akihiko Odaki
2024-07-16 13:29         ` Paolo Bonzini
2024-07-16 13:35           ` Akihiko Odaki [this message]
2024-07-16  8:45 ` Paolo Bonzini
2025-01-11  5:15 ` Akihiko Odaki

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=fe1f7bb0-b235-4f57-ab56-8da1ef0ce18e@daynix.com \
    --to=akihiko.odaki@daynix.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=fam@euphon.net \
    --cc=kkostiuk@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=michael.roth@amd.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=sw@weilnetz.de \
    --cc=yan@daynix.com \
    --cc=yuval.shaia.ml@gmail.com \
    /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).