qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 03/23] block: Connect BlockBackend to BlockDrive


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 03/23] block: Connect BlockBackend to BlockDriverState
Date: Thu, 11 Sep 2014 12:52:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Benoît Canet <address@hidden> writes:

> The Wednesday 10 Sep 2014 à 10:13:32 (+0200), Markus Armbruster wrote :
>> The pointer from BlockBackend to BlockDriverState is a strong
>> reference, managed with bdrv_ref() / bdrv_unref(), the back-pointer is
>> a weak one.
>> 
>> Convenience function blk_new_with_bs() creates a BlockBackend with its
>> BlockDriverState.  Callers have to unref both.  The commit after next
>> will relieve them of the need to unref the BlockDriverState.
>> 
>> Signed-off-by: Markus Armbruster <address@hidden>
>> ---
>>  block.c                        |  10 ++--
>>  block/block-backend.c          |  79 +++++++++++++++++++++++++++++++
>>  blockdev.c                     |  49 +++++++++++---------
>>  hw/block/xen_disk.c            |   8 +---
>>  include/block/block_int.h      |   2 +
>>  include/sysemu/block-backend.h |   5 ++
>>  qemu-img.c                     | 103 
>> +++++++++++++++++++++--------------------
>>  qemu-io.c                      |   4 +-
>>  qemu-nbd.c                     |   3 +-
>>  9 files changed, 175 insertions(+), 88 deletions(-)
>> 
>> diff --git a/block.c b/block.c
>> index 4b3bcd4..a6c03da 100644
>> --- a/block.c
>> +++ b/block.c
>> @@ -2032,7 +2032,7 @@ static void bdrv_move_feature_fields(BlockDriverState 
>> *bs_dest,
>>   * This will modify the BlockDriverState fields, and swap contents
>>   * between bs_new and bs_old. Both bs_new and bs_old are modified.
>>   *
>> - * bs_new is required to be anonymous.
>> + * bs_new must be nameless and not attached to a BlockBackend.
>
> 1)
> Does "nameless" refer to device_name or node_name ?
> From the code I see it's device_name but the wording can be confusing.

Yes.  It's slightly better than "anonymous", because that really means
both device_name and node_name (since commit dc364f4).

The "nameless" part will go away in PATCH 08, so I'm inclined not to
worry about it now.

> maybe:
> + * bs_new must have an empty device_name and not be attached to a 
> BlockBackend.

Can do if you think it's necessary.



reply via email to

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