qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [question] Partial sector issue while discard in qcow2 image
@ 2020-06-02  7:45 Lin Ma
  2020-06-02 11:06 ` Kevin Wolf
  0 siblings, 1 reply; 3+ messages in thread
From: Lin Ma @ 2020-06-02  7:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, pbonzini

[-- Attachment #1: Type: text/plain, Size: 825 bytes --]

Hi all,

During  woring to add GET LBA STATUS support in qemu scsi emulation layer, I encountered
an unmap issue with qcow2 image, It's likely about how to unmap partial clusters. e.g.:

With these default values:
* the default value of s->qdev.blocksize: 512
* the default value of s->cluster_size of qcow2 image: 65536

Running 'sg_unmap -l 1024 -n 32 /dev/sda' hits the condition
'if (!QEMU_IS_ALIGNED(offset | bytes, s->cluster_size))' in the function qcow2_co_pdiscard,
Then it won't perform qcow2_cluster_discard(), So the corresponding clusters won't be discard
in this situation, Correct?

Of cause, with the default blocksize and cluster_size, The below examples won't hit the condition 'if (!QEMU_IS_ALIGNED...'.
sg_unmap -l 1024 -n 128 /dev/sda
or
sg_unmap -l 256 -n 128 /dev/sda

Thanks,
Lin

[-- Attachment #2: Type: text/html, Size: 2038 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-03  7:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-02  7:45 [question] Partial sector issue while discard in qcow2 image Lin Ma
2020-06-02 11:06 ` Kevin Wolf
2020-06-03  7:04   ` Lin Ma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).