Use virtio-scsi rather than virtio-blk
Submitted by David Jaša
Link to original bug (#738444)
Description
Description of problem: gnome-boxes by default uses virtio-blk disks backed by qcow2 files stored in home directories. It would be nice to use virtio-scsi disks by default with "<driver ... discard='unmap'/>" option tuned on for guests that support virtio-scsi (IIRC RHEL >= 6.4, RHEL 7, Windows >= 7 with virtio drivers). That way, valuable space in user's home can be conserved:
backing file usage on host
$ du -sm .local/share/gnome-boxes/images/rhel7.0 8820 .local/share/gnome-boxes/images/rhel7.0
run fstrim in the guest:
[root@rhel7 ~]# fstrim -v / /: 2.4 GiB (2528993280 bytes) trimmed
backing file usage after guest's fstrim
[djasa@cihla ~]$ du -sm .local/share/gnome-boxes/images/rhel7.0 6768 .local/share/gnome-boxes/images/rhel7.0
Note that Windows 7 by default issue discards without user intervention, in RHEL (and IIRC Fedora as well), you either have to set up a cron job for fstrim or add "discards" to mount options
Version-Release number of selected component (if applicable): gnome-boxes-3.8.3-9.el7.x86_64
How reproducible: always
Steps to Reproduce:
- install a guest that supports virtio-scsi
- inspect domain xml for the VM
Actual results: virtio-blk is used
Expected results: virtio-scsi with discard='unmap' is configured
Additional info: