[libvirt] [PATCH v2 0/2] Add support for zero-write detection

John Ferlan jferlan at redhat.com
Tue Dec 15 12:27:46 UTC 2015



On 12/14/2015 09:57 AM, Martin Kletzander wrote:
> QEMU supports detect-zeroes option since version 2.1, but we never
> added support for it in libvirt.  If was requested by Vasiliy Tolstov
> in the list, so I just added it.
> 
> There are two discussions to be had, optionally.  One is to decide
> whether we should disable detect_zeros='unmap' if discard is not set
> to 'unmap', but this is getting very hypervisor-specific, so I just
> documented the behaviour.  The other one is the naming.  I described
> why I made the decision for "zeros" instead of "zeroes" the decision
> in the patch, but I have no problem changing it to what others like
> better.

Unfortunate that qemu chose "zeroes" instead of "zeros" or instead of
"detect_zero_writes" (or something even longer and more descriptive).

Seems strange though to say "detect_zeros=unmap". Would perhaps
something like :

detect = zero_write  [or just zero, zeros, or zeroes]
detect = unmap
...

or
detect_zero = write
detect_zero = unmap
...

Be more generic?  Also, I would think detect_zero[e]s = off is
meaningless since it's an optional parameter. The way the code is
written, passing detect_zeroes=off to me would be akin to not providing
it at all.

I think from my quick read - this would be similar to the "discard"
option, w.r.t. values used/set.

John
> 
> v2:
>  - format detect_zeroes on the command line instead of detect_zeros
> 
> v1:
>  - https://www.redhat.com/archives/libvir-list/2015-December/msg00484.html
> 
> Martin Kletzander (2):
>   conf: Add support of zero-detection for disks
>   qemu: Add support for zero-detection writes
> 
>  docs/formatdomain.html.in                          | 10 ++++++
>  docs/schemas/domaincommon.rng                      | 12 +++++++
>  src/conf/domain_conf.c                             | 23 +++++++++++++-
>  src/conf/domain_conf.h                             | 11 +++++++
>  src/libvirt_private.syms                           |  2 ++
>  src/qemu/qemu_capabilities.c                       |  2 ++
>  src/qemu/qemu_capabilities.h                       |  1 +
>  src/qemu/qemu_command.c                            | 11 +++++++
>  tests/qemucapabilitiesdata/caps_2.1.1-1.caps       |  1 +
>  tests/qemucapabilitiesdata/caps_2.4.0-1.caps       |  1 +
>  tests/qemucapabilitiesdata/caps_2.5.0-1.caps       |  1 +
>  .../qemuxml2argv-disk-drive-detect-zeros.args      | 27 ++++++++++++++++
>  .../qemuxml2argv-disk-drive-detect-zeros.xml       | 37 ++++++++++++++++++++++
>  tests/qemuxml2argvtest.c                           |  4 +++
>  tests/qemuxml2xmltest.c                            |  1 +
>  15 files changed, 143 insertions(+), 1 deletion(-)
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-detect-zeros.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-detect-zeros.xml
> 
> --
> 2.6.4
> 
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
> 




More information about the libvir-list mailing list