* [Qemu-devel] [PATCH] block: fix the use of protocols in backing files (v2)
@ 2010-10-27 19:44 Anthony Liguori
2010-10-28 8:58 ` [Qemu-devel] " Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Anthony Liguori @ 2010-10-27 19:44 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Anthony Liguori, Stefan Hajnoczi, Adam Litke
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
v1 -> v2
- Fix up CODING_STYLE of modified code
diff --git a/block.c b/block.c
index 1a965b2..029017e 100644
--- a/block.c
+++ b/block.c
@@ -603,10 +603,17 @@ 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 =
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Qemu-devel] Re: [PATCH] block: fix the use of protocols in backing files (v2)
2010-10-27 19:44 [Qemu-devel] [PATCH] block: fix the use of protocols in backing files (v2) Anthony Liguori
@ 2010-10-28 8:58 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2010-10-28 8:58 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Adam Litke, qemu-devel, Stefan Hajnoczi
Am 27.10.2010 21:44, schrieb Anthony Liguori:
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Thanks, added a meaningful commit message and applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-28 8:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-27 19:44 [Qemu-devel] [PATCH] block: fix the use of protocols in backing files (v2) Anthony Liguori
2010-10-28 8:58 ` [Qemu-devel] " Kevin Wolf
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).