qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v8 09/21] null: Switch to .bdrv_co_block_status(


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-block] [PATCH v8 09/21] null: Switch to .bdrv_co_block_status()
Date: Thu, 1 Mar 2018 12:57:23 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

01.03.2018 12:48, Kevin Wolf wrote:
Am 01.03.2018 um 08:25 hat Vladimir Sementsov-Ogievskiy geschrieben:
26.02.2018 17:05, Kevin Wolf wrote:
Essentially, assuming a simple backing chain 'base <- overlay', we got
these combinations to represent in NBD (with my suggestion of the flags
to use):

1. Cluster allocated in overlay
     a. non-zero data                         0
     b. explicit zeroes                       0 or ZERO
2. Cluster marked zero in overlay           HOLE | ZERO
3. Cluster preallocated/zero in overlay     ZERO
4. Cluster unallocated in overlay
     a. Cluster allocated in base (non-zero)  HOLE
     b. Cluster allocated in base (zero)      HOLE or HOLE | ZERO
     c. Cluster marked zero in base           HOLE | ZERO
     d. Cluster preallocated/zero in base     HOLE | ZERO
     e. Cluster unallocated in base           HOLE | ZERO

Instead of 'base' you can read 'anywhere in the backing chain' and the
flags should stay the same.
I think only "anywhere in the backing chain" is valid here. Otherwise,
semantics of bdrv_is_allocated would differ for NBD and for not-NBD.
This was meant as a mapping from cases to flags, not the other way
round, so really doesn't say anything about the cases where the block is
allocated further down the chain.

But yes, it shouldn't make a difference where in the backing chain a
block is allocated, so these cases are the same as 4.

I think, if bdrv_is_allocated returns false, it means that we can skip
this region in copying process, am I right?
-ENOCONTEXT? Which copying process?

There are cases where you want to copy such regions, and other cases
where you want to skip them. It depends on the use case. For example,
'qemu-img convert' skips them with -B (because the backing file is
reused), but not without -B (which creates a full copy).

Kevin

Hm, I thought that bdrv_is_allocated loops through backings, but it doesn't, sorry.

--
Best regards,
Vladimir




reply via email to

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