qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 02/13] block: Omit bdrv_find_format for essen


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v2 02/13] block: Omit bdrv_find_format for essential drivers
Date: Tue, 02 Dec 2014 10:12:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

On 2014-12-01 at 17:01, Eric Blake wrote:
On 11/27/2014 07:48 AM, Max Reitz wrote:
We can always assume raw, file and qcow2 being available; so do not use
bdrv_find_format() to locate their BlockDriver objects but statically
reference the respective objects.

Cc: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
  block.c | 11 ++---------
  1 file changed, 2 insertions(+), 9 deletions(-)
Reviewed-by: Eric Blake <address@hidden>

@@ -1293,7 +1288,6 @@ int bdrv_append_temp_snapshot(BlockDriverState *bs, int 
flags, Error **errp)
      /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */
      char *tmp_filename = g_malloc0(PATH_MAX + 1);
      int64_t total_size;
-    BlockDriver *bdrv_qcow2;
Hmm - how hard would it be to get qemu to be clean under -Wshadow?  This
is a case where you would have had to change this hunk during patch 1 if
-Wshadow were in effect.

Well, I know I once found a bug which would have been spotted by -Wshadow; so in principle, I'm in favor of trying to enforce -Wshadow. On the other hand, I guess it may be really hard. We could try some time, but I don't want to have to run through all of qemu's code...

Max



reply via email to

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