qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 01/33] block: Add BlockDriver.is_format


From: Eric Blake
Subject: Re: [PATCH v2 01/33] block: Add BlockDriver.is_format
Date: Wed, 5 Feb 2020 07:51:55 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 2/4/20 11:08 AM, Max Reitz wrote:
We want to unify child_format and child_file at some point.  One of the
important things that set format drivers apart from other drivers is
that they do not expect other format nodes under them (except in the
backing chain).  That means we need something on which to distinguish
format drivers from others, and hence this flag.

It _is_ possible to set up a format node on top of another; in fact, our testsuite does that in at least iotest 072. I agree that setups like 'qcow2 - qcow2 - file' are uncommon, but the setup 'qcow2 - raw - file' may be useful for extracting a partition of a raw disk when it is known that the partition in that disk itself contains qcow2 data.


Signed-off-by: Max Reitz <address@hidden>
---

+++ b/include/block/block_int.h
@@ -94,6 +94,13 @@ struct BlockDriver {
       * must implement them and return -ENOTSUP.
       */
      bool is_filter;
+    /*
+     * Set to true if the BlockDriver is a format driver.  Format nodes
+     * generally do not expect their children to be other format nodes
+     * (except for backing files), and so format probing is disabled
+     * on those children.

Aha - nested formats ARE still allowed when you explicitly request it (which is what iotest 72 does) - what you are stating here is that implicit probing of is forbidden for a parent declared as a format driver. That makes more sense.

I'm not sure if the commit message needs a tweak, but the patch itself is sane as-is.

Reviewed-by: Eric Blake <address@hidden>

+     */
+    bool is_format;
      /*
       * Return true if @to_replace can be replaced by a BDS with the
       * same data as @bs without it affecting @bs's behavior (that is,


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

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