All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO
@ 2015-12-06 15:07 David Manouchehri
  2015-12-06 20:02 ` [Qemu-devel] [Bug 1523246] " David Manouchehri
                   ` (16 more replies)
  0 siblings, 17 replies; 19+ messages in thread
From: David Manouchehri @ 2015-12-06 15:07 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

When model=virtio is used, TRIM is not supported.

# mount -o discard /dev/vda4 /mnt
# mount | tail -1
/dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
# fstrim /mnt/
fstrim: /mnt/: the discard operation is not supported

Booting without model=virtio allows using TRIM (in Windows as well).

Full QEMU line:

qemu-system-x86_64 -enable-kvm -cpu host -bios
/usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
-net nic,model=virtio -net user -drive discard=unmap,detect-
zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

** Affects: qemu
     Importance: Undecided
         Status: New


** Tags: trim virtio windows

** Attachment added: "2015-12-06-14:04:03-screenshot.png"
   https://bugs.launchpad.net/bugs/1523246/+attachment/4530502/+files/2015-12-06-14%3A04%3A03-screenshot.png

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Cannot TRIM with VirtIO

Status in QEMU:
  New

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions

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

* [Qemu-devel] [Bug 1523246] Re: Cannot TRIM with VirtIO
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
@ 2015-12-06 20:02 ` David Manouchehri
  2015-12-06 20:02 ` David Manouchehri
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: David Manouchehri @ 2015-12-06 20:02 UTC (permalink / raw)
  To: qemu-devel

Ideally there should be a warning if a user gives discard=unmap and
isn't using the SCSI bus. Using the following options allows the guest
to detect the drive as a thinly provisioned drive.

-drive discard=unmap,detect-
zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=none,id=hd
-device virtio-scsi-pci,id=scsi -device scsi-hd,drive=hd

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Cannot TRIM with VirtIO

Status in QEMU:
  New

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions

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

* [Qemu-devel] [Bug 1523246] Re: Cannot TRIM with VirtIO
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
  2015-12-06 20:02 ` [Qemu-devel] [Bug 1523246] " David Manouchehri
@ 2015-12-06 20:02 ` David Manouchehri
  2016-12-24 19:16 ` Коренберг Марк
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: David Manouchehri @ 2015-12-06 20:02 UTC (permalink / raw)
  To: qemu-devel

** Attachment added: "2015-12-06-19:20:59-screenshot.png"
   https://bugs.launchpad.net/qemu/+bug/1523246/+attachment/4530556/+files/2015-12-06-19%3A20%3A59-screenshot.png

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Cannot TRIM with VirtIO

Status in QEMU:
  New

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions

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

* [Qemu-devel] [Bug 1523246] Re: Cannot TRIM with VirtIO
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
  2015-12-06 20:02 ` [Qemu-devel] [Bug 1523246] " David Manouchehri
  2015-12-06 20:02 ` David Manouchehri
@ 2016-12-24 19:16 ` Коренберг Марк
  2017-01-02  8:22 ` Paolo Bonzini
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Коренберг Марк @ 2016-12-24 19:16 UTC (permalink / raw)
  To: qemu-devel

Virtio will never support discard requests. Please use virtio-scsi.

So, please rename bug to "Feature request: Refuse to operate if virtio +
discard is requested"

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Cannot TRIM with VirtIO

Status in QEMU:
  New

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions

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

* [Qemu-devel] [Bug 1523246] Re: Cannot TRIM with VirtIO
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
                   ` (2 preceding siblings ...)
  2016-12-24 19:16 ` Коренберг Марк
@ 2017-01-02  8:22 ` Paolo Bonzini
  2017-03-04 13:50 ` [Qemu-devel] [Bug 1523246] Re: Virtio-blk does not support TRIM Rustam Abdullaev
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Paolo Bonzini @ 2017-01-02  8:22 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: New => Confirmed

** Changed in: qemu
   Importance: Undecided => Wishlist

** Summary changed:

- Cannot TRIM with VirtIO
+ VirtIO does not support TRIM

** Summary changed:

- VirtIO does not support TRIM
+ Virtio-blk does not support TRIM

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Virtio-blk does not support TRIM

Status in QEMU:
  Confirmed

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions

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

* [Qemu-devel] [Bug 1523246] Re: Virtio-blk does not support TRIM
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
                   ` (3 preceding siblings ...)
  2017-01-02  8:22 ` Paolo Bonzini
@ 2017-03-04 13:50 ` Rustam Abdullaev
  2017-04-19 12:05 ` Mike Mol
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Rustam Abdullaev @ 2017-03-04 13:50 UTC (permalink / raw)
  To: qemu-devel

> Virtio will never support discard requests.

 - what is that?

> Please use virtio-scsi.

 - in some tests, SCSI emulation appears 7 times slower than the
paravirtualized bus.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Virtio-blk does not support TRIM

Status in QEMU:
  Confirmed

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions

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

* [Qemu-devel] [Bug 1523246] Re: Virtio-blk does not support TRIM
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
                   ` (4 preceding siblings ...)
  2017-03-04 13:50 ` [Qemu-devel] [Bug 1523246] Re: Virtio-blk does not support TRIM Rustam Abdullaev
@ 2017-04-19 12:05 ` Mike Mol
  2017-04-19 12:08 ` Mike Mol
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Mike Mol @ 2017-04-19 12:05 UTC (permalink / raw)
  To: qemu-devel

> Virtio will never support discard requests.

Why? If you don't want to write a treatise on the subject, perhaps point
at an LWN article or LKML thread where that conclusion was discussed or
reached.

> So, please rename bug to "Feature request: Refuse to operate if virtio
+ discard is requested"

Uh, if the feature as requested will never be satisfied, WONTFIX it and
create a feature that could be satisfied.  Or WONTFIX it and take no
further action. Either way, the status of things would be much clearer
to use poor schmucks who land here googling the issue.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Virtio-blk does not support TRIM

Status in QEMU:
  Confirmed

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions

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

* [Qemu-devel] [Bug 1523246] Re: Virtio-blk does not support TRIM
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
                   ` (5 preceding siblings ...)
  2017-04-19 12:05 ` Mike Mol
@ 2017-04-19 12:08 ` Mike Mol
  2017-04-19 13:15   ` Jack Wang
  2017-04-19 12:21 ` Mike Mol
                   ` (9 subsequent siblings)
  16 siblings, 1 reply; 19+ messages in thread
From: Mike Mol @ 2017-04-19 12:08 UTC (permalink / raw)
  To: qemu-devel

discard support for virtio-blk is on the QEMU TODO list:

http://wiki.qemu-project.org/ToDo/Block#virtio-
blk_discard_support_.5BPeter_Lieven.5D

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Virtio-blk does not support TRIM

Status in QEMU:
  Confirmed

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions

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

* [Qemu-devel] [Bug 1523246] Re: Virtio-blk does not support TRIM
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
                   ` (6 preceding siblings ...)
  2017-04-19 12:08 ` Mike Mol
@ 2017-04-19 12:21 ` Mike Mol
  2019-01-12  3:12 ` James Harvey
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Mike Mol @ 2017-04-19 12:21 UTC (permalink / raw)
  To: qemu-devel

Granted, it's been there since October of 2014. http://wiki.qemu-
project.org/index.php?title=ToDo/Block&oldid=4410#virtio-
blk_discard_support_.5BPeter_Lieven.5D

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Virtio-blk does not support TRIM

Status in QEMU:
  Confirmed

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions

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

* Re: [Qemu-devel] [Bug 1523246] Re: Virtio-blk does not support TRIM
  2017-04-19 12:08 ` Mike Mol
@ 2017-04-19 13:15   ` Jack Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Jack Wang @ 2017-04-19 13:15 UTC (permalink / raw)
  To: Bug 1523246; +Cc: qemu-devel

Latest effort was one month ago:

https://patchwork.kernel.org/patch/9645537/

2017-04-19 14:08 GMT+02:00 Mike Mol <mikemol@gmail.com>:
> discard support for virtio-blk is on the QEMU TODO list:
>
> http://wiki.qemu-project.org/ToDo/Block#virtio-
> blk_discard_support_.5BPeter_Lieven.5D
>
> --
> You received this bug notification because you are a member of qemu-
> devel-ml, which is subscribed to QEMU.
> https://bugs.launchpad.net/bugs/1523246
>
> Title:
>   Virtio-blk does not support TRIM
>
> Status in QEMU:
>   Confirmed
>
> Bug description:
>   When model=virtio is used, TRIM is not supported.
>
>   # mount -o discard /dev/vda4 /mnt
>   # mount | tail -1
>   /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
>   # fstrim /mnt/
>   fstrim: /mnt/: the discard operation is not supported
>
>   Booting without model=virtio allows using TRIM (in Windows as well).
>
>   Full QEMU line:
>
>   qemu-system-x86_64 -enable-kvm -cpu host -bios
>   /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
>   -net nic,model=virtio -net user -drive discard=unmap,detect-
>   zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions
>

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

* [Qemu-devel] [Bug 1523246] Re: Virtio-blk does not support TRIM
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
                   ` (7 preceding siblings ...)
  2017-04-19 12:21 ` Mike Mol
@ 2019-01-12  3:12 ` James Harvey
  2019-01-14  9:30 ` Stefan Hajnoczi
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: James Harvey @ 2019-01-12  3:12 UTC (permalink / raw)
  To: qemu-devel

I believe this feature was just merged by Linus about a week ago, and is
in linux 5.0-rc1:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d548e65904ae43b0637d200a2441fc94e0589c30

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Virtio-blk does not support TRIM

Status in QEMU:
  Confirmed

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions

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

* [Qemu-devel] [Bug 1523246] Re: Virtio-blk does not support TRIM
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
                   ` (8 preceding siblings ...)
  2019-01-12  3:12 ` James Harvey
@ 2019-01-14  9:30 ` Stefan Hajnoczi
  2019-04-12  6:57 ` Thomas Huth
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Stefan Hajnoczi @ 2019-01-14  9:30 UTC (permalink / raw)
  To: qemu-devel

While the Linux virtio-blk guest driver now supports discard and write
zeroes, QEMU's virtio-blk device emulation does not support it yet.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Virtio-blk does not support TRIM

Status in QEMU:
  Confirmed

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions

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

* [Qemu-devel] [Bug 1523246] Re: Virtio-blk does not support TRIM
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
                   ` (9 preceding siblings ...)
  2019-01-14  9:30 ` Stefan Hajnoczi
@ 2019-04-12  6:57 ` Thomas Huth
  2019-04-24  6:01 ` Thomas Huth
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Thomas Huth @ 2019-04-12  6:57 UTC (permalink / raw)
  To: qemu-devel

The DISCARD feature has now been implemented in QEMU, too:
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=37b06f8d46fe602e630e4

** Changed in: qemu
       Status: Confirmed => Fix Committed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Virtio-blk does not support TRIM

Status in QEMU:
  Fix Committed

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions

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

* [Qemu-devel] [Bug 1523246] Re: Virtio-blk does not support TRIM
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
                   ` (10 preceding siblings ...)
  2019-04-12  6:57 ` Thomas Huth
@ 2019-04-24  6:01 ` Thomas Huth
  2022-12-12  9:43 ` mohammadreza nasrabadi
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Thomas Huth @ 2019-04-24  6:01 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Virtio-blk does not support TRIM

Status in QEMU:
  Fix Released

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions

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

* [Bug 1523246] Re: Virtio-blk does not support TRIM
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
                   ` (11 preceding siblings ...)
  2019-04-24  6:01 ` Thomas Huth
@ 2022-12-12  9:43 ` mohammadreza nasrabadi
  2022-12-12 10:25 ` Thomas Huth
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: mohammadreza nasrabadi @ 2022-12-12  9:43 UTC (permalink / raw)
  To: qemu-devel

On which version of qemu the discard option is supported?

I have emulated a VM with below qemu options related to disk type:

-drive file=disk.img,if=none,id=disk0,l2-cache-
size=8M,format=qcow2,discard=on,detect-zeroes=unmap,aio=io_uring -device
virtio-blk-pci,drive=disk0,scsi=off,bootindex=2

the disk file on the host side is located on xfs mountpoint on RAID
level 10 array.

After I downloaded a file with 1GB size on the guest OS, I saw the size
of the disk file on the host has been increased as well.

But when I delete the downloaded file and issue fstrim --all -v command,
the disk file on host has not been decreased.

The version of qemu I'm using is 5.2.0

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Virtio-blk does not support TRIM

Status in QEMU:
  Fix Released

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions



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

* [Bug 1523246] Re: Virtio-blk does not support TRIM
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
                   ` (12 preceding siblings ...)
  2022-12-12  9:43 ` mohammadreza nasrabadi
@ 2022-12-12 10:25 ` Thomas Huth
  2022-12-12 12:59 ` mohammadreza nasrabadi
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Thomas Huth @ 2022-12-12 10:25 UTC (permalink / raw)
  To: qemu-devel

$ git tag --contains 37b06f8d46fe602e630e4 | grep ^v | sort | head -n1
v4.0.0

How did you check the size of the file? It might appear bigger than it
is due to sparse blocks.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Virtio-blk does not support TRIM

Status in QEMU:
  Fix Released

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions



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

* [Bug 1523246] Re: Virtio-blk does not support TRIM
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
                   ` (13 preceding siblings ...)
  2022-12-12 10:25 ` Thomas Huth
@ 2022-12-12 12:59 ` mohammadreza nasrabadi
  2022-12-12 13:33 ` Thomas Huth
  2022-12-13  8:14 ` mohammadreza nasrabadi
  16 siblings, 0 replies; 19+ messages in thread
From: mohammadreza nasrabadi @ 2022-12-12 12:59 UTC (permalink / raw)
  To: qemu-devel

I've checked the size of disk file with ls -alh  and du --apparent-size
commands

I downloaded the 1G size file 5 times to make sure about sparse blocks
issue, but the problem still exists

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Virtio-blk does not support TRIM

Status in QEMU:
  Fix Released

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions



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

* [Bug 1523246] Re: Virtio-blk does not support TRIM
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
                   ` (14 preceding siblings ...)
  2022-12-12 12:59 ` mohammadreza nasrabadi
@ 2022-12-12 13:33 ` Thomas Huth
  2022-12-13  8:14 ` mohammadreza nasrabadi
  16 siblings, 0 replies; 19+ messages in thread
From: Thomas Huth @ 2022-12-12 13:33 UTC (permalink / raw)
  To: qemu-devel

I think you should check with "du" but without "--apparent-size" since
that parameter counts the sparse blocks, too. See e.g.:

$ truncate -s 10M test.dat
$ ls -alh test.dat 
-rw-rw-r--. 1 root root 10M Dec 12 14:31 test.dat
$ du -sh --apparent-size test.dat 
10M	test.dat
$ du -sh test.dat 
0	test.dat

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Virtio-blk does not support TRIM

Status in QEMU:
  Fix Released

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions



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

* [Bug 1523246] Re: Virtio-blk does not support TRIM
  2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
                   ` (15 preceding siblings ...)
  2022-12-12 13:33 ` Thomas Huth
@ 2022-12-13  8:14 ` mohammadreza nasrabadi
  16 siblings, 0 replies; 19+ messages in thread
From: mohammadreza nasrabadi @ 2022-12-13  8:14 UTC (permalink / raw)
  To: qemu-devel

thanks. so now my question is that are these sparsed blocks rewritable? I mean after deletion of a file and downloading again, will these files be stored on the sparsed blocks or the number of starting block for write operation will be after the number of latest sparsed block?

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1523246

Title:
  Virtio-blk does not support TRIM

Status in QEMU:
  Fix Released

Bug description:
  When model=virtio is used, TRIM is not supported.

  # mount -o discard /dev/vda4 /mnt
  # mount | tail -1
  /dev/vda4 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
  # fstrim /mnt/
  fstrim: /mnt/: the discard operation is not supported

  Booting without model=virtio allows using TRIM (in Windows as well).

  Full QEMU line:

  qemu-system-x86_64 -enable-kvm -cpu host -bios
  /usr/share/ovmf/ovmf_x64.bin -smp 2 -m 7G -vga qxl -usbdevice tablet
  -net nic,model=virtio -net user -drive discard=unmap,detect-
  zeroes=unmap,cache=none,file=vms/win10.hd.img.vmdk,format=vmdk,if=virtio

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1523246/+subscriptions



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

end of thread, other threads:[~2022-12-13  8:21 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-06 15:07 [Qemu-devel] [Bug 1523246] [NEW] Cannot TRIM with VirtIO David Manouchehri
2015-12-06 20:02 ` [Qemu-devel] [Bug 1523246] " David Manouchehri
2015-12-06 20:02 ` David Manouchehri
2016-12-24 19:16 ` Коренберг Марк
2017-01-02  8:22 ` Paolo Bonzini
2017-03-04 13:50 ` [Qemu-devel] [Bug 1523246] Re: Virtio-blk does not support TRIM Rustam Abdullaev
2017-04-19 12:05 ` Mike Mol
2017-04-19 12:08 ` Mike Mol
2017-04-19 13:15   ` Jack Wang
2017-04-19 12:21 ` Mike Mol
2019-01-12  3:12 ` James Harvey
2019-01-14  9:30 ` Stefan Hajnoczi
2019-04-12  6:57 ` Thomas Huth
2019-04-24  6:01 ` Thomas Huth
2022-12-12  9:43 ` mohammadreza nasrabadi
2022-12-12 10:25 ` Thomas Huth
2022-12-12 12:59 ` mohammadreza nasrabadi
2022-12-12 13:33 ` Thomas Huth
2022-12-13  8:14 ` mohammadreza nasrabadi

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.