On 29/09/14 20:55, Michael Tokarev wrote:
Control: reassign -1 qemu-system
Control: tag -1 + moreinfo unreproducible
Please note: qemu-kvm does not exist, it is a trivial
one-line /bin/sh wrapper around qemu-system-x86_64.
29.09.2014 13:31, David Marshall wrote:
Package: qemu-kvm
Version: 2.1+dfsg-4
Severity: normal
Dear Maintainer,
I am not able to get discard to work on qcow2 disks
In my libvirt xml file I have the following:
<devices>
<emulator>/usr/bin/kvm</emulator>
<controller type='scsi' index='0' model='virtio-scsi'/>
................
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none' io='native'
discard='unmap'/>
<source file='/opt/marshall/vm/media-image/david.qcow2'/>
<target dev='sdd' bus='scsi'/>
</disk>
Please show the resulting (pieces from) qemu command line.
I can definitely use discard inside linux guest with virtio-scsi
and qcow2 drive images (even older linux guests works). So the
prob should be the way how your libvirt runs qemu.
Thanks,
/mjt
Hi,
Below is the output from virsh domxml-to-native qemu-argv
I think the relevant bits are:
-device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x4
-drive
file=/opt/marshall/vm/media-image/david.qcow2,if=none,id=drive-scsi0-0-0-3,format=qcow2,cache=none,discard=unmap,aio=native
-device
scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=3,drive=drive-scsi0-0-0-3,id=scsi0-0-0-3
LC_ALL=C
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin HOME=/
QEMU_AUDIO_DRV=none /usr/bin/kvm -name media -machine
pc-0.12,accel=kvm,usb=off -m 4096 -realtime mlock=off -smp
1,sockets=1,cores=1,threads=1 -uuid 124e079d-b200-5229-7900-9837f39236e3
-no-user-config -nodefaults -chardev
socket,id=charmonitor,path=/var/lib/libvirt/qemu/media.monitor,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc
-no-shutdown -boot order=c,menu=on,strict=on -device
piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device
virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x4 -device
lsi,id=scsi1,bus=pci.0,addr=0x5 -drive
file=/opt/marshall/vm/media-image/data.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none,aio=native
-device
scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0
-drive
file=/opt/marshall/vm/media-image/becky.qcow2,if=none,id=drive-scsi0-0-0-1,format=qcow2,cache=none,aio=native
-device
scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=1,drive=drive-scsi0-0-0-1,id=scsi0-0-0-1
-drive
file=/opt/marshall/vm/media-image/chris.qcow2,if=none,id=drive-scsi0-0-0-2,format=qcow2,cache=none,aio=native
-device
scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=2,drive=drive-scsi0-0-0-2,id=scsi0-0-0-2
-drive
file=/opt/marshall/vm/media-image/david.qcow2,if=none,id=drive-scsi0-0-0-3,format=qcow2,cache=none,discard=unmap,aio=native
-device
scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=3,drive=drive-scsi0-0-0-3,id=scsi0-0-0-3
-drive
file=/opt/marshall/vm/media-image/claire.qcow2,if=none,id=drive-scsi0-0-0-4,format=qcow2,cache=none,aio=native
-device
scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=4,drive=drive-scsi0-0-0-4,id=scsi0-0-0-4
-drive
file=/opt/marshall/vm/media-image/daniel.qcow2,if=none,id=drive-scsi0-0-0-5,format=qcow2,cache=none,aio=native
-device
scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=5,drive=drive-scsi0-0-0-5,id=scsi0-0-0-5
-drive
file=/opt/marshall/vm/media-image/douglas.qcow2,if=none,id=drive-scsi0-0-0-6,format=qcow2,cache=none,aio=native
-device
scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=6,drive=drive-scsi0-0-0-6,id=scsi0-0-0-6
-drive
file=/opt/marshall/vm/media-image/nicole.qcow2,if=none,id=drive-scsi1-0-0,format=qcow2,cache=none,aio=native
-device scsi-hd,bus=scsi1.0,scsi-id=0,drive=drive-scsi1-0-0,id=scsi1-0-0
-drive
file=/dev/host-vg/media-swap,if=none,id=drive-scsi1-0-1,format=raw,cache=none,aio=native
-device scsi-hd,bus=scsi1.0,scsi-id=1,drive=drive-scsi1-0-1,id=scsi1-0-1
-drive
file=/opt/marshall/vm/media-image/root.qcow2,if=none,id=drive-ide0-0-0,format=qcow2,cache=none,discard=unmap,aio=native
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -netdev
tap,id=hostnet0 -device
virtio-net-pci,netdev=hostnet0,id=net0,mac=02:da:de:ca:fe:d1,bus=pci.0,addr=0x3
-chardev pty,id=charserial0 -device
isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0
-vnc 0.0.0.0:0,password -device cirrus-vga,id=video0,bus=pci.0,addr=0x2
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 -msg timestamp=on
The file was created using the command:
create -f qcow2 -o preallocation=metadata
/opt/marshall/vm/media-image/david.qcow2 2T
Here is the ouput of virsh domblkinfo media
/opt/marshall/vm/media-image/david.qcow2
Capacity: 2199023255552
Allocation: 61342908416
Physical: 61342908416
Regards,
David.
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org