qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH 2/3] block-nbd: fix use of protocols in back


From: Kevin Wolf
Subject: Re: [Qemu-devel] Re: [PATCH 2/3] block-nbd: fix use of protocols in backing files and nbd probing
Date: Thu, 16 Sep 2010 16:08:11 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100907 Fedora/3.0.7-1.fc12 Thunderbird/3.0.7

Am 16.09.2010 15:00, schrieb Anthony Liguori:
> On 09/16/2010 03:08 AM, Kevin Wolf wrote:
>> Am 11.09.2010 16:04, schrieb Anthony Liguori:
>>    
>>> The use of protocols in backing_files is currently broken because of some
>>> checks for adjusting relative pathnames.
>>>
>>> Additionally, there's a spurious read when using an nbd protocol that can be
>>> quite destructive when using copy-on-read.  Potentially, this can lead to
>>> probing an image file over top of NBD but this is completely wrong as NBD
>>> devices are not growable.
>>>
>>> Signed-off-by: Anthony Liguori<address@hidden>
>>> ---
>>> NB: this is absolutely not ideal.  A more elegant suggestion would be
>>> appreciated.  I don't think NBD cleanly fits the model of a protocol as it
>>> stands today.
>>>
>>> diff --git a/block.c b/block.c
>>> index cd2ee31..a32d5dd 100644
>>> --- a/block.c
>>> +++ b/block.c
>>> @@ -344,6 +344,12 @@ static int find_image_format(const char *filename, 
>>> BlockDriver **pdrv)
>>>           return ret;
>>>       }
>>>
>>> +    if (strcmp(bs->drv->protocol_name, "nbd") == 0) {
>>> +        drv = bs->drv;
>>> +        bdrv_delete(bs);
>>> +        goto out;
>>> +    }
>>>      
>> Is nbd really the only protocol that behaves like this? I don't like
>> hardcoding driver names in generic block layer code.
>>    
> 
> I'll drop this chunk from the patch as using backing_fmt achieves the 
> same goal.  The important hunk is the next one that removes assumptions 
> that URIs are filenames.

Right, but next hunk is broken as Juan already mentioned. You always get
a protocol back, so with this patch applied you never resolve relative
paths for backing files.

Kevin



reply via email to

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