[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: "Woodhouse, David" <dwmw@xxxxxxxxxxxx>
- From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Date: Wed, 22 Nov 2023 23:49:28 +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=ng9KHCSY27fs4W0E92o00gpr24norQc20LS+wnJZT9Y=; b=N5ymO6F3RYrXqkulrLcUnBHb4n9qIA/kqVj6IQAhrRg//bcqSJuPL6Pmzkkf3mcwc+LxpPU3CheuywZAswkGWxum+zAcZ5EUTHRt1cyLYzBofrcmqbY2lUD3gwNhvg/Q5FadiSvsv/zNSmHm1v24TYNcC6qVTkfTiP4WIvRmkM24zSGPPBlDswfzd0CBgqmM5jtFabAKNWma+hmx7ryKVYDSpCBIuj1/9wnvvlS5t4ZI0fAdVDGzOBA1fWBh2RktPwGTlXuF7Z4eaUI4nnVbdzLiuJJIpN7swpPOZnJnVSnBoZ6Ush01LQ3F8mTixt8RVVGAO9fhnb+G0D3H+6dzow==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AciWoT8xpCokaZDAuWHYw6NSKpf5yNt0LXWOAIIJDDIxEugoELn2Eh8k2u4iqJZ1POc8FICPpIrof8wipdmYvBlLFMcbS4sjkqJyUye2VR1yvHf9AaGZa+IeciZAx1HgFzf1H1RED5LdXm4ug5ke5PahkcLv9YLukAxv1n/loQG5EBvlq7ywSOSIZNKWACXMGOjg675JI9VieWqMF2Uy8A52Z0I4n7m6NLYBYiTF/r0W2p9Rsq/PcXojb2+RxgQJiK7+Jg+cY12MraMxH/hPQZ+nulNLOHQQUn/Rez8TPS+N7QW5pEXXy6wOaTQtatnQeyKwyee9KhkhBcVV/DQ9PQ==
- Cc: "qemu-devel@xxxxxxxxxx" <qemu-devel@xxxxxxxxxx>, "paul@xxxxxxx" <paul@xxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, "hreitz@xxxxxxxxxx" <hreitz@xxxxxxxxxx>, "anthony.perard@xxxxxxxxxx" <anthony.perard@xxxxxxxxxx>, "marcandre.lureau@xxxxxxxxxx" <marcandre.lureau@xxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "qemu-block@xxxxxxxxxx" <qemu-block@xxxxxxxxxx>, "kwolf@xxxxxxxxxx" <kwolf@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "pbonzini@xxxxxxxxxx" <pbonzini@xxxxxxxxxx>, "jasowang@xxxxxxxxxx" <jasowang@xxxxxxxxxx>
- Delivery-date: Wed, 22 Nov 2023 23:49:43 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHaHMeI32LlpkxN1EiN6kyRHznaJrCGkpqAgABet4CAABHlAA==
- Thread-topic: [PATCH v2 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it
Hi David,
"Woodhouse, David" <dwmw@xxxxxxxxxxxx> writes:
> On Wed, 2023-11-22 at 17:05 +0000, Paul Durrant wrote:
>> 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.
>
> I think I did that in
> https://git.infradead.org/users/dwmw2/qemu.git/commitdiff/94f1b474478ce0ede
> but didn't get round to sending it out again because of travel.
I can just pull it from this link, if you don't mind.
--
WBR, Volodymyr
|