qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 04/21] qdev: allow setting drive property for realized device


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH 04/21] qdev: allow setting drive property for realized device
Date: Mon, 17 May 2021 21:09:25 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

17.05.2021 18:48, Max Reitz wrote:
On 17.05.21 08:44, Vladimir Sementsov-Ogievskiy wrote:
We need an ability to insert filters above top block node, attached to
block device. It can't be achieved with blockdev-reopen command. So, we
want do it with help of qom-set.

Intended usage:

1. blockdev-add, creating the filter, which child is at top node A,
    attached to some guest block device.

Is a “not” missing here, i.e. “not attached to any guest block device”?  I 
would have thought one would create a filtered tree that is not in use by any 
frontend, so that the filter need not take any permissions.

node A is attached.

So, we have [blk] --root->  [A}

And want to insert a filter between blk and A.

We do

1.

[filter] --file--\
                 v
[blk] --root-->  [A]

2.

[blk] --root--> [filer] --file--> [A]


2. qom-set, to change bs attached to root blk from original node to
    newly create filter.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
  hw/core/qdev-properties-system.c | 30 ++++++++++++++++++++++--------
  1 file changed, 22 insertions(+), 8 deletions(-)

Looks good, just one question: (well, two, one was above)

diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index 2760c21f11..7d97562654 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c

[...]

@@ -196,6 +209,7 @@ static void release_drive(Object *obj, const char *name, 
void *opaque)
  const PropertyInfo qdev_prop_drive = {
      .name  = "str",
      .description = "Node name or ID of a block device to use as a backend",
+    .realized_set_allowed = true,
      .get   = get_drive,
      .set   = set_drive,
      .release = release_drive,

Why not for qdev_prop_drive_iothread?


Hmm, the only reason is that I missed that part of architecture around here, 
I'm new to qdev code. Will add with next version


--
Best regards,
Vladimir



reply via email to

[Prev in Thread] Current Thread [Next in Thread]