diff mbox

[0/2] block: Fix unset "filename" for certain drivers

Message ID 20140623083544.GA10862@stefanha-thinkpad.redhat.com
State New
Headers show

Commit Message

Stefan Hajnoczi June 23, 2014, 8:35 a.m. UTC
On Wed, Jun 18, 2014 at 12:14:08AM +0200, Max Reitz wrote:
> For some protocol block drivers, the "filename" attribute in their BDSs
> is unset due to bdrv_file_open() removing it from the options QDict
> before bdrv_open_common() is able to copy it into the BDS. Fix this by
> not removing it until until bdrv_open_common() has indeed copied it.
> 
> 
> Max Reitz (2):
>   block: Do not prematurely remove "filename"
>   iotests: Add test for set "filename" for NBD
> 
>  block.c                    | 12 ++++++--
>  tests/qemu-iotests/097     | 72 ++++++++++++++++++++++++++++++++++++++++++++++
>  tests/qemu-iotests/097.out | 13 +++++++++
>  tests/qemu-iotests/group   |  1 +
>  4 files changed, 95 insertions(+), 3 deletions(-)
>  create mode 100755 tests/qemu-iotests/097
>  create mode 100644 tests/qemu-iotests/097.out

Please check qemu-iotests 051.  Dropping from block queue for now.

051 5s ... - output mismatch (see 051.out.bad)

Comments

Max Reitz June 26, 2014, 6:58 p.m. UTC | #1
On 23.06.2014 10:35, Stefan Hajnoczi wrote:
> On Wed, Jun 18, 2014 at 12:14:08AM +0200, Max Reitz wrote:
>> For some protocol block drivers, the "filename" attribute in their BDSs
>> is unset due to bdrv_file_open() removing it from the options QDict
>> before bdrv_open_common() is able to copy it into the BDS. Fix this by
>> not removing it until until bdrv_open_common() has indeed copied it.
>>
>>
>> Max Reitz (2):
>>    block: Do not prematurely remove "filename"
>>    iotests: Add test for set "filename" for NBD
>>
>>   block.c                    | 12 ++++++--
>>   tests/qemu-iotests/097     | 72 ++++++++++++++++++++++++++++++++++++++++++++++
>>   tests/qemu-iotests/097.out | 13 +++++++++
>>   tests/qemu-iotests/group   |  1 +
>>   4 files changed, 95 insertions(+), 3 deletions(-)
>>   create mode 100755 tests/qemu-iotests/097
>>   create mode 100644 tests/qemu-iotests/097.out
> Please check qemu-iotests 051.  Dropping from block queue for now.

Thanks for catching this. The problem was me always removing the 
"filename" entry from the QDict if the driver could not handle it; 
however, to maintain the current behavior, it should only be removed if 
it has been parsed before. I'll send a v2.

Max
diff mbox

Patch

--- 051.out	2014-06-20 15:12:57.034266987 +0800
+++ 051.out.bad	2014-06-23 16:34:37.880591037 +0800
@@ -237,7 +237,8 @@ 
 (qemu) quit
 
 Testing: -drive file=TEST_DIR/t.qcow2,file.driver=qcow2
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,file.driver=qcow2: could not open disk image TEST_DIR/t.qcow2: Block format 'qcow2' used by device '' doesn't support the option 'filename'
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit