From: Anthony Liguori <anthony@codemonkey.ws>
To: Juan Quintela <quintela@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
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 10:40:31 -0500 [thread overview]
Message-ID: <4C923A6F.2070604@codemonkey.ws> (raw)
In-Reply-To: <m3lj739ekg.fsf@trasno.org>
On 09/15/2010 11:06 AM, Juan Quintela wrote:
> Anthony Liguori<aliguori@us.ibm.com> wrote:
>
>> 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<aliguori@us.ibm.com>
>> ---
>> 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.
>>
> Bad, bad boy, you fixed two things in a single patch.
>
You're not supposed to notice that :-) It was an RFC series, I was
really just looking to start a conversation.
>> @@ -603,10 +610,16 @@ int bdrv_open(BlockDriverState *bs, const char *filename, int flags,
>> BlockDriver *back_drv = NULL;
>>
>> bs->backing_hd = bdrv_new("");
>> - path_combine(backing_filename, sizeof(backing_filename),
>> - filename, bs->backing_file);
>> - if (bs->backing_format[0] != '\0')
>> - back_drv = bdrv_find_format(bs->backing_format);
>> + back_drv = bdrv_find_protocol(bs->backing_file);
>> + if (!back_drv) {
>> + path_combine(backing_filename, sizeof(backing_filename),
>> + filename, bs->backing_file);
>> + if (bs->backing_format[0] != '\0')
>> + back_drv = bdrv_find_format(bs->backing_format);
>> + } else {
>> + pstrcpy(backing_filename, sizeof(backing_filename),
>> + bs->backing_file);
>> + }
>>
>> /* backing files always opened read-only */
>> back_flags =
>>
> But this one breaks my setup, I have to backout this patch to be able to
> launch guests with qcow2 file images.
>
Kevin, do you have an opinion about the best way to resolve this?
The relative/absolute path is broken for non-file URIs. I think we
could mark a protocol as having a file URI type or we could push the
absolute/relative conversion down to the file/phys_dev protocol.
I think the former approach is probably the least invasive.
Regards,
Anthony LIguori
> Later, Juan.
>
>
next prev parent reply other threads:[~2010-09-16 16:50 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-11 14:04 [Qemu-devel] [RFC][PATCH 0/3] Fix caching issues with live migration Anthony Liguori
2010-09-11 14:04 ` [Qemu-devel] [PATCH 1/3] block: allow migration to work with image files Anthony Liguori
2010-09-12 10:37 ` Avi Kivity
2010-09-12 13:06 ` Anthony Liguori
2010-09-12 13:28 ` Avi Kivity
2010-09-12 15:26 ` Anthony Liguori
2010-09-12 16:06 ` Avi Kivity
2010-09-12 17:10 ` Anthony Liguori
2010-09-12 17:51 ` Avi Kivity
2010-09-15 16:00 ` [Qemu-devel] " Juan Quintela
2010-09-15 15:57 ` Juan Quintela
2010-09-13 8:21 ` Kevin Wolf
2010-09-13 13:27 ` Anthony Liguori
2010-09-15 16:03 ` Juan Quintela
2010-09-16 7:54 ` Kevin Wolf
2010-09-15 15:53 ` Juan Quintela
2010-09-11 14:04 ` [Qemu-devel] [PATCH 2/3] block-nbd: fix use of protocols in backing files and nbd probing Anthony Liguori
2010-09-11 16:53 ` Stefan Hajnoczi
2010-09-11 17:27 ` Anthony Liguori
2010-09-11 17:45 ` Anthony Liguori
2010-09-15 16:06 ` [Qemu-devel] " Juan Quintela
2010-09-16 15:40 ` Anthony Liguori [this message]
2010-09-17 8:53 ` Kevin Wolf
2010-09-16 8:08 ` Kevin Wolf
2010-09-16 13:00 ` Anthony Liguori
2010-09-16 14:08 ` Kevin Wolf
2010-09-11 14:04 ` [Qemu-devel] [PATCH 3/3] disk: don't read from disk until the guest starts Anthony Liguori
2010-09-11 17:24 ` Stefan Hajnoczi
2010-09-11 17:34 ` Anthony Liguori
2010-09-12 10:42 ` Avi Kivity
2010-09-12 13:08 ` Anthony Liguori
2010-09-12 13:26 ` Avi Kivity
2010-09-12 15:29 ` Anthony Liguori
2010-09-12 16:04 ` Avi Kivity
2010-09-15 16:10 ` [Qemu-devel] " Juan Quintela
2010-09-13 8:32 ` Kevin Wolf
2010-09-13 13:29 ` Anthony Liguori
2010-09-13 13:39 ` Kevin Wolf
2010-09-13 13:42 ` Anthony Liguori
2010-09-13 14:13 ` Kevin Wolf
2010-09-13 14:34 ` Anthony Liguori
2010-09-14 9:47 ` Avi Kivity
2010-09-14 12:51 ` Anthony Liguori
2010-09-14 13:16 ` Avi Kivity
2010-09-13 19:29 ` Stefan Hajnoczi
2010-09-13 20:03 ` Kevin Wolf
2010-09-13 20:09 ` Anthony Liguori
2010-09-14 8:28 ` Kevin Wolf
2010-09-15 16:16 ` Juan Quintela
2010-09-12 10:46 ` [Qemu-devel] [RFC][PATCH 0/3] Fix caching issues with live migration Avi Kivity
2010-09-12 13:12 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C923A6F.2070604@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).