qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	 Stefano Stabellini <sstabellini@kernel.org>,
	 "paul@xen.org" <paul@xen.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	 Julien Grall <julien@xen.org>,
	 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
	Anthony Perard <anthony.perard@citrix.com>,
	 "open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory
Date: Fri, 24 Nov 2023 12:56:48 +0000	[thread overview]
Message-ID: <87wmu7b97z.fsf@draig.linaro.org> (raw)
In-Reply-To: <87cyw1z61i.fsf@epam.com> (Volodymyr Babchuk's message of "Thu, 23 Nov 2023 00:07:05 +0000")

Volodymyr Babchuk <Volodymyr_Babchuk@epam.com> writes:

> Hi,
>
> Volodymyr Babchuk <volodymyr_babchuk@epam.com> writes:
>
>> Hi Stefano,
>>
>> Stefano Stabellini <sstabellini@kernel.org> writes:
>>
>>> On Wed, 22 Nov 2023, David Woodhouse wrote:
>>>> On Wed, 2023-11-22 at 15:09 -0800, Stefano Stabellini wrote:
>>>> > On Wed, 22 Nov 2023, David Woodhouse wrote:
>>>> > > On Wed, 2023-11-22 at 14:29 -0800, Stefano Stabellini wrote:
>>>> > > > On Wed, 22 Nov 2023, Paul Durrant wrote:
>>>> > > > > On 21/11/2023 22:10, Volodymyr Babchuk wrote:
>>>> > > > > > From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
<snip>
>>>> The -xen-domid argument on the QEMU command line today is the *guest*
>>>> domain ID, not the domain ID in which QEMU itself is running.
>>>> 
>>>> Or were you thinking of something different?
>>>
>>> Ops, you are right and I understand your comment better now. The backend
>>> domid is not on the command line but it should be discoverable (on
>>> xenstore if I remember right).
>>
>> Yes, it is just "~/domid". I'll add a function that reads it.
>
> Just a quick question to QEMU folks: is it better to add a global
> variable where we will store own Domain ID or it will be okay to read
> domid from Xenstore every time we need it?
>
> If global variable variant is better, what is proffered place to define
> this variable? system/globals.c ?

Hmm maybe, I see Xen already has some but the comment:

  "Global variables that (mostly) should not exist"

I think it to dissuade the file growing more than it should.

I think generally the best pattern to use if a global can't be avoided
is to have a "static global" in the main .c file for the module and then
provide a helper access function for other files to read it. That also
makes re-factoring easier if things like locking need to be added down
the line.

We still do have a few true global variables which need "extern"
declarations in the headers but if we can avoid adding more that would
be good.

Of course ideally this sort of data would be wrapped up in QOM
structures but I can see the argument for the host domain ID.

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


      parent reply	other threads:[~2023-11-24 12:57 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21 22:10 [PATCH v2 0/6] xen-arm: add support for virtio-pci Volodymyr Babchuk
2023-11-21 22:10 ` [PATCH v2 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it Volodymyr Babchuk
2023-11-22 15:54   ` Paul Durrant
2023-11-22 17:05   ` Paul Durrant
2023-11-22 22:44     ` Woodhouse, David via
2023-11-22 23:49       ` Volodymyr Babchuk
2023-11-22 23:55         ` Woodhouse, David via
2023-11-22 22:56     ` Volodymyr Babchuk
2023-11-22 23:04       ` David Woodhouse
2023-11-23  9:29         ` Paul Durrant
2023-11-21 22:10 ` [PATCH v2 2/6] xen: backends: touch some XenStore nodes only if device Volodymyr Babchuk
2023-11-22 11:07   ` Philippe Mathieu-Daudé
2023-11-22 22:49     ` Volodymyr Babchuk
2023-11-22 23:19       ` David Woodhouse
2023-11-22 17:03   ` Paul Durrant
2023-11-22 22:46     ` Woodhouse, David via
2023-11-22 22:50     ` Volodymyr Babchuk
2023-11-21 22:10 ` [PATCH v2 3/6] xen: xenstore: add possibility to preserve owner Volodymyr Babchuk
2023-11-22 17:07   ` Paul Durrant
2023-11-22 22:28     ` Stefano Stabellini
2023-11-22 23:01   ` David Woodhouse
2023-11-22 23:03     ` Volodymyr Babchuk
2023-11-23  1:19     ` Volodymyr Babchuk
2023-11-21 22:10 ` [PATCH v2 5/6] xen_arm: Set mc->max_cpus to GUEST_MAX_VCPUS in xen_arm_init() Volodymyr Babchuk
2023-11-22 11:10   ` Philippe Mathieu-Daudé
2023-11-24 12:04   ` Igor Mammedov
2023-11-21 22:10 ` [PATCH v2 6/6] xen_arm: Add virtual PCIe host bridge support Volodymyr Babchuk
2023-11-22 22:39   ` Stefano Stabellini
2023-11-22 23:44     ` Vikram Garhwal
2023-11-23  0:11       ` Volodymyr Babchuk
2023-11-24 12:30   ` Igor Mammedov
2023-11-24 15:47     ` Volodymyr Babchuk
2023-11-21 22:10 ` [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory Volodymyr Babchuk
2023-11-22 17:11   ` Paul Durrant
2023-11-22 22:29     ` Stefano Stabellini
2023-11-22 23:03       ` David Woodhouse
2023-11-22 23:09         ` Stefano Stabellini
2023-11-22 23:11           ` David Woodhouse
2023-11-22 23:20             ` Stefano Stabellini
2023-11-22 23:46               ` Volodymyr Babchuk
2023-11-23  0:07                 ` Volodymyr Babchuk
2023-11-23  9:28                   ` Paul Durrant
2023-11-23 10:45                     ` David Woodhouse
2023-11-23 11:43                       ` Volodymyr Babchuk
2023-11-23 11:51                         ` David Woodhouse
2023-11-23 11:54                     ` Volodymyr Babchuk
2023-11-23 11:57                       ` David Woodhouse
2023-11-23 12:17                         ` Volodymyr Babchuk
2023-11-23 12:27                           ` David Woodhouse
2023-11-23 12:54                             ` Paul Durrant
2023-11-24  0:24                             ` Volodymyr Babchuk
2023-11-24 12:56                   ` Alex Bennée [this message]

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=87wmu7b97z.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=Oleksandr_Tyshchenko@epam.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=anthony.perard@citrix.com \
    --cc=dwmw2@infradead.org \
    --cc=julien@xen.org \
    --cc=paul@xen.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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).