From: "Lukas Sichert" <l.sichert@proxmox.com>
To: "Daniel Kral" <d.kral@proxmox.com>,
"David Riley" <d.riley@proxmox.com>,
<pve-devel@lists.proxmox.com>
Subject: Re: [PATCH manager v3] fix #4503: ui: qemu: add detect zeroes disk option
Date: Tue, 23 Jun 2026 16:06:43 +0200 [thread overview]
Message-ID: <DJGHJGS9GG5N.1J6X0KX4S7DJ8@proxmox.com> (raw)
In-Reply-To: <DJFG7AYIOTAS.270SDV4FZWCSQ@proxmox.com>
On 2026-06-22 10:51, Daniel Kral <d.kral@proxmox.com> wrote:
> On Fri Jun 19, 2026 at 1:01 PM CEST, David Riley wrote:
>> On 6/18/26 1:49 PM, Lukas Sichert wrote:
>>> When discard is enabled, qemu-server defaults to 'detect-zeroes=unmap'.
>>> This can have a significant performance impact for zero writes on some
>>> setups, while users might still want to keep guest discard/TRIM support
>>> enabled.
>>>
>>> Allow configuring the option independently so 'discard' can stay enabled
>>> while zero detection is disabled. Persist the checkbox state explicitly,
>>> as the backend treats an absent value as default-enabled behavior,
>>> resulting in 'detect-zeroes=unmap' when 'discard' is enabled.
>>
>> Thanks for submitting this patch.
>>
>> While it clearly addresses the performance issues reported in #4503
>> [0], I was reading through the Bugzilla thread and noticed a request
>> to support the third QEMU state for detect_zeroes [1]. Currently, the
>> underlying parameter supports off, on, and unmap [2].
>>
>> Since we are already modifying this configuration in the UI, it might
>> make sense to fully expose all three options to the user rather than
>> just a binary toggle as there is a difference between "on" and
>> "unmap".
>
> This would need adapting the detect_zeroes option and parsing logic
> (it's only boolean right now) so it can take any of the 3 valid values
> by QEMU and be backwards compatible to the old values in our config.
>
> This should probably also check the constraint that detect-zeroes=unmap
> can only be set if discard=unmap, but the error message seems already be
> quite clear for that [0].
Already in src/PVE/QemuServer/Drive.pm in the qemu-server repo, this is
checked and set accordingly.
Since detect-zeroes=unmap is essentially an extension of
detect-zeroes=on [1], and detect-zeroes=unmap is currently the default
when discard is enabled, I would keep this patch as is to preserve
backward compatibility.
[1]: https://www.qemu.org/docs/master/interop/qemu-storage-daemon-qmp-ref.html#enum-QSD-block-core.BlockdevDetectZeroesOptions
> [0] https://gitlab.com/qemu-project/qemu/-/blob/master/block.c?ref_type=heads#L1120
>
>>
>> [0] https://bugzilla.proxmox.com/show_bug.cgi?id=4503
>> [1] https://bugzilla.proxmox.com/show_bug.cgi?id=4503#c8
>> [2] https://www.qemu.org/docs/master/interop/qemu-storage-daemon-qmp-ref.html#enum-QSD-block-core.BlockdevDetectZeroesOptions
>>
>>> Link: https://bugzilla.proxmox.com/show_bug.cgi?id=4503
>>> Signed-off-by: Lukas Sichert <l.sichert@proxmox.com>
>>> ---
>>>
>>> Notes:
>>> changes from v2 to v3 (thanks @Fabian):
>>> - add a comment explaining why this property is handled differently from
>>> the others
>>>
>>> changes from v1 to v2:
>>> - added bug-numer to commit header
>>> - appended bug-link to commit body
>>>
>>> www/manager6/qemu/HDEdit.js | 10 ++++++++++
>>> 1 file changed, 10 insertions(+)
>>>
>>> [...]
>>>
prev parent reply other threads:[~2026-06-23 14:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 11:49 [PATCH manager v3] fix #4503: ui: qemu: add detect zeroes disk option Lukas Sichert
2026-06-19 11:01 ` David Riley
2026-06-22 8:51 ` Daniel Kral
2026-06-23 14:06 ` Lukas Sichert [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DJGHJGS9GG5N.1J6X0KX4S7DJ8@proxmox.com \
--to=l.sichert@proxmox.com \
--cc=d.kral@proxmox.com \
--cc=d.riley@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.