qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] block: fix the use of protocols in backing file


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] block: fix the use of protocols in backing files
Date: Wed, 27 Oct 2010 14:42:17 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100915 Lightning/1.0b1 Thunderbird/3.0.8

On 10/27/2010 02:22 PM, malc wrote:
On Wed, 27 Oct 2010, Anthony Liguori wrote:

Signed-off-by: Anthony Liguori<address@hidden>

diff --git a/block.c b/block.c
index 1a965b2..00b6f21 100644
--- a/block.c
+++ b/block.c
@@ -603,10 +603,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);
Sigh..

Always good to see such clear and constructive comments...

I'll respin.

Regards,

Anthony Liguori

+        } else {
+            pstrcpy(backing_filename, sizeof(backing_filename),
+                    bs->backing_file);
+        }

          /* backing files always opened read-only */
          back_flags =





reply via email to

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