[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory


  • To: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Thu, 23 Nov 2023 12:17:57 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0+0sv1FgfciTdIqpRKA+4ejvw1lyXLNxJsEWq5qi5Bo=; b=moLlh4qZy/vkgGUP0InqLQ40jJgBJ8V9Nh3YLodmNT8+/0CJR/WxR3PlUOIWNE27CgmZxX+9gwtvxYUFdocWF/B1zCczWEKGPuD1MT6EZRFaPQW7kuBYSXpEsV1MpbUSaNIQ32r1ItEvJvZQ53qBAvQ50uEQBPDDAFV7nA9Iu+HdxIL8fXjAUaJK6yrVaxyKO1lOZEqP3vwbIye+pF5LwyVV4ZpYX3epyTWAzpkQl9syqmnurZkJvwsfWBo47Y9LgXEsP5JPgA5C1NYQ2SbLLBIgfAs4iADeKEVPAL3Swoob+vF57/FpTU/G5b1EeoTyuN/4xwOgsDzbjwtbVbiQvQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B0pGYeemUvqIqkf1OxR/qjN6Oi38k+4x63vNPJZd/ch0cVykbEa7Imm+VlLtBuQfNRCefA+PwackGFclVVnQrVerLm0W+U1zyWdeA4IELGJoGIqwWAx3ig+pRuw/HwIaw75SeZ1dMxBvyjll2EONZWGAmriYSySrhQ1UMDAzLs2pCPydqnUj8nLeqgVjOQlFBPDoKe4eKymYrGC/i0N1nVYV4WsoEAY1M7BtoNRDI4KWVTqthI4p82uKn+Ox/nTXA3R0sUfkeGZbfqzt24f+U+Ou+fiwQXPlECh5755lNBrVVW52HievXKwKeBqmt6POMet/H/VnSdRirsLsXjP7Fw==
  • Cc: "paul@xxxxxxx" <paul@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "qemu-devel@xxxxxxxxxx" <qemu-devel@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 23 Nov 2023 12:18:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHaHMeIsCU+MAEGAkSnPoa9ThBNz7CGlGOAgABYsYCAAAmAgIAAAakAgAAAyoCAAAJ4gIAABwqAgAAFCoCAAJ2+AIAAJb8AgAAD5ICAAASYAA==
  • Thread-topic: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

Hi David,

David Woodhouse <dwmw2@xxxxxxxxxxxxx> writes:

> On 23 November 2023 11:54:01 GMT, Volodymyr Babchuk 
> <Volodymyr_Babchuk@xxxxxxxx> wrote:
>>
>>Hi Paul,
>>
>>Paul Durrant <xadimgnik@xxxxxxxxx> writes:
>>
>>> On 23/11/2023 00:07, Volodymyr Babchuk wrote:
>>>> Hi,
>>>> Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx> writes:
>>>> 
>>>>> Hi Stefano,
>>>>>
>>>>> Stefano Stabellini <sstabellini@xxxxxxxxxx> 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@xxxxxxxx>
>>>>>>>>>>>>
>>>>>>>>>>>> Instead of forcing the owner to domid 0, use XS_PRESERVE_OWNER to
>>>>>>>>>>>> inherit the owner of the directory.
>>>>>>>>>>>
>>>>>>>>>>> Ah... so that's why the previous patch is there.
>>>>>>>>>>>
>>>>>>>>>>> This is not the right way to fix it. The QEMU Xen support is 
>>>>>>>>>>> *assuming* that
>>>>>>>>>>> QEMU is either running in, or emulating, dom0. In the emulation 
>>>>>>>>>>> case this is
>>>>>>>>>>> probably fine, but the 'real Xen' case it should be using the 
>>>>>>>>>>> correct domid
>>>>>>>>>>> for node creation. I guess this could either be supplied on the 
>>>>>>>>>>> command line
>>>>>>>>>>> or discerned by reading the local domain 'domid' node.
>>>>>>>>>>
>>>>>>>>>> yes, it should be passed as command line option to QEMU
>>>>>>>>>
>>>>>>>>> I'm not sure I like the idea of a command line option for something
>>>>>>>>> which QEMU could discover for itself.
>>>>>>>>
>>>>>>>> That's fine too. I meant to say "yes, as far as I know the toolstack
>>>>>>>> passes the domid to QEMU as a command line option today".
>>>>>>>
>>>>>>> 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 ?
>>>> 
>>>
>>> Actually... is it possible for QEMU just to use a relative path for
>>> the backend nodes? That way it won't need to know it's own domid, will
>>> it?
>>
>>Well, it is possible to use relative path, AFAIK, linux-based backends
>>are doing exactly this. But problem is with xenstore_mkdir() function,
>>which requires domain id to correctly set owner when it causes call to
>>set_permissions().
>>
>>As David said, architecturally it will be better to get rid of
>>xenstore_mkdir() usage, because it is used by legacy backends only. But
>>to do this, someone needs to convert legacy backends to use newer API. I
>>have no capacity to do this right now, so I implemented a contained
>>solution:
>>
>>static int xenstore_read_own_domid(unsigned int *domid)
>>
>>in xen_pvdev.c. I believe, this new function will be removed along with
>>whole xen_pvdev.c when there will be no legacy backends left.
>
> Which PV backends do you care about? We already have net, block and console 
> converted.

Well, this is all what we need, actually. Even console only will be
sufficient, as we are using QEMU to provide virtio-pci backends, so both
storage and networking should be provided by virtio. Are you proposing
to just drop this patch at all? I believe we can live without it, yes.

-- 
WBR, Volodymyr


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.