qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd
@ 2013-12-30 11:58 Teng-Feng Yang
  2014-01-02 16:15 ` Richard W.M. Jones
  2014-01-06  2:45 ` Stefan Hajnoczi
  0 siblings, 2 replies; 13+ messages in thread
From: Teng-Feng Yang @ 2013-12-30 11:58 UTC (permalink / raw)
  To: qemu-devel

Hi folks,

I have been studying QCOW2 file format for a couple of days, and I am
a little bit confused about whether QCOW2 supports UNMAP or not.
As I surf through internet, some mailing list discussion had mentioned
that qemu-nbd and nbd module both support UNMAP command.
So I follow the steps below on my machine (Ubuntu 13.10 with linux
kernel 3.12) to test if qemu-nbd and QCOW2 do support UNMAP.

1. Create a qcow2 file via qemu-img
    > sudo qemu-img create -f qcow2 -o cluster_size=524288 base.qcow2 1G

2. Connect this qcow2 file with qemu-nbd
    > sudo qemu-nbd -c /dev/nbd0 base.qcow2 --discard=unmap

3. Use sg_unmap command to issue UNMAP command to this NBD
    > sudo sg_unmap --lba=0 --num=1 /dev/nbd0

Everytime I get the following error message:

    unmap cdb: 42 00 00 00 00 00 00 00 18 00
unmap: pass through os error: Inappropriate ioctl for device
UNMAP failed (use '-v' to get more information)

I also try to format this nbd device with EXT4 and mount it, but still
cannot perform fstrim on the mount point.

Have I done anything wrong?

Any help would be grateful.
Thanks.

Best Regards,
Dennis

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

end of thread, other threads:[~2014-01-09  7:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-30 11:58 [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd Teng-Feng Yang
2014-01-02 16:15 ` Richard W.M. Jones
2014-01-07 14:48   ` Paolo Bonzini
2014-01-07 20:27     ` Richard W.M. Jones
2014-01-07 20:48       ` Paolo Bonzini
2014-01-07 21:22         ` Richard W.M. Jones
2014-01-08 22:11           ` Paolo Bonzini
2014-01-08 22:24             ` Richard W.M. Jones
2014-01-08 22:45               ` Paolo Bonzini
2014-01-08 22:53                 ` Richard W.M. Jones
2014-01-09  7:02                   ` Paolo Bonzini
2014-01-07 21:27         ` Richard W.M. Jones
2014-01-06  2:45 ` Stefan Hajnoczi

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).