On 02/17/2014 07:45 AM, Kevin Wolf wrote: > Instead of making the backing file contents visible again after a discard > request, set the zero flag if possible (i.e. on version >= 3). > > Signed-off-by: Kevin Wolf <[email protected]> > --- > block/qcow2-cluster.c | 22 ++++++++++++++++++++-- > tests/qemu-iotests/046 | 18 ++++++++++++++---- > 2 files changed, 34 insertions(+), 6 deletions(-) >
> + if (!!(old_offset & QCOW_OFLAG_ZERO)) {
The !! is not necessary here; any non-zero value in a boolean context
gives the same result as an explicit conversion to 0-or-1.
But as that's cosmetic, I'm okay whether you leave it as is or simplify
it, when adding:
Reviewed-by: Eric Blake <[email protected]>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
