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

Re: [PATCH v2 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it


  • To: "paul@xxxxxxx" <paul@xxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Wed, 22 Nov 2023 22:56:09 +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=xgVT4rtx4sDyaqAQgUh6a1OE8aBuIehIj85TllrI8kY=; b=hMiE8JXrTSyY+6dppUM8NNalaSGiGdWnn/nEg6GCWAs9cNx18pT9S7dOHlu6ugXx2SSDr1yI4Flz/FDzZLilmg7E14Us356WpsP7RroWly3++x+S3mVsDjqH0RVw21zHSj++C3HUQiCvpBINAyj28AkguV9nA7NFqSGKcVzq7EceZ81nFpQ5Tz3Cijz8xhCsWKhPBn3lbX2hZnkGaUSUPmdLWQK7DgHmgl9AJU0p31/gojL9MgmdoIir35wsWH1Hf09W2ztORgnLQ9corG/2yxr/E9mhZZvpMVfXROnZg5L+YN5FJzr0wXcj1rmxwKnHan2Ps7PgBKcPedHwdYA81w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FVK0Hvc67DeCJYR9W5yfaA8dXd/ToawqTU8iFK438c0YBB5y3JKnPCq9JsBdTRsBXwQCDcHjh0EbAP0/gL3IWNHRvH6tD/aGMEdfsY97fpMVcq9foyvgPBSvCx0cS0XD0/zquDa8ZWyemGYrI9uqIe4AjA8ANdjGj+Ozb38F0MBiYJYOalY62pQTvEDEZruAh+6p8ogjkMs5FjPxGUuLtca3N4MOCYonUZZLDoDpG7OMI5q2F+cV/wW++gRyiYVEL8ciEQRMccB+0ZccMtQzdbiQt2ytPNwAog65ayqwRz/P5jbWPk7yPRwb77PKkFmp713zKnhTqy/uHf8JSTROxg==
  • Cc: "qemu-devel@xxxxxxxxxx" <qemu-devel@xxxxxxxxxx>, David Woodhouse <dwmw@xxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Kevin Wolf <kwolf@xxxxxxxxxx>, Hanna Reitz <hreitz@xxxxxxxxxx>, Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Jason Wang <jasowang@xxxxxxxxxx>, "open list:Block layer core" <qemu-block@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 22 Nov 2023 22:56:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHaHMeI32LlpkxN1EiN6kyRHznaJrCGkpqAgABhOIA=
  • Thread-topic: [PATCH v2 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it


Paul Durrant <xadimgnik@xxxxxxxxx> writes:

> On 21/11/2023 22:10, Volodymyr Babchuk wrote:
>> From: David Woodhouse <dwmw@xxxxxxxxxxxx>
>> This allows a XenDevice implementation to know whether it was
>> created
>> by QEMU, or merely discovered in XenStore after the toolstack created
>> it. This will allow us to create frontend/backend nodes only when we
>> should, rather than unconditionally attempting to overwrite them from
>> a driver domain which doesn't have privileges to do so.
>> As an added benefit, it also means we no longer have to call the
>> xen_backend_set_device() function from the device models immediately
>> after calling qdev_realize_and_unref(). Even though we could make
>> the argument that it's safe to do so, and the pointer to the unreffed
>> device *will* actually still be valid, it still made my skin itch to
>> look at it.
>> Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
>> ---
>>   hw/block/xen-block.c         | 3 +--
>>   hw/char/xen_console.c        | 2 +-
>>   hw/net/xen_nic.c             | 2 +-
>>   hw/xen/xen-bus.c             | 4 ++++
>>   include/hw/xen/xen-backend.h | 2 --
>>   include/hw/xen/xen-bus.h     | 2 ++
>>   6 files changed, 9 insertions(+), 6 deletions(-)
>> 
>
> Actually, I think you should probably update
> xen_backend_try_device_destroy() in this patch too. It currently uses
> xen_backend_list_find() to check whether the specified XenDevice has
> an associated XenBackendInstance.

Sure. Looks like it is the only user of xen_backend_list_find(), so we
can get rid of it as well.

I'll drop your R-b tag, because of those additional changes in the new
version.

-- 
WBR, Volodymyr


 


Rackspace

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