From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUDHp-0004fk-31 for qemu-devel@nongnu.org; Wed, 17 Sep 2014 07:20:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUDHf-0005xV-P5 for qemu-devel@nongnu.org; Wed, 17 Sep 2014 07:20:37 -0400 Received: from mail-wg0-x232.google.com ([2a00:1450:400c:c00::232]:33667) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUDHe-0005xM-OG for qemu-devel@nongnu.org; Wed, 17 Sep 2014 07:20:27 -0400 Received: by mail-wg0-f50.google.com with SMTP id x13so1213735wgg.33 for ; Wed, 17 Sep 2014 04:20:22 -0700 (PDT) Date: Wed, 17 Sep 2014 12:20:19 +0100 From: Stefan Hajnoczi Message-ID: <20140917112019.GE10699@stefanha-thinkpad.redhat.com> References: <1587858E792C6C48ADD97BCB156E8ED031FB39D059@APJ1XCHEVSPIN31.SYMC.SYMANTEC.COM> <20140904135926.GD27130@stefanha-thinkpad.redhat.com> <1587858E792C6C48ADD97BCB156E8ED031FC2041AD@APJ1XCHEVSPIN31.SYMC.SYMANTEC.COM> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wchHw8dVAp53YPj8" Content-Disposition: inline In-Reply-To: <1587858E792C6C48ADD97BCB156E8ED031FC2041AD@APJ1XCHEVSPIN31.SYMC.SYMANTEC.COM> Subject: Re: [Qemu-devel] [Important] Query regarding bdrv_co_discard List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sanjay Kumar2 Cc: "'qemu-devel@nongnu.org'" --wchHw8dVAp53YPj8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 11, 2014 at 01:53:49AM -0700, Sanjay Kumar2 wrote: > 1. With my new network based disk protocol, if I use 'raw' format, then = it is working perfectly. But, when I am using 'qcow2' format, then is it ca= using issue. After debugging I found that it is returning because bdrv_get_= geometry() is returning 0 in case of format=3D'qcow2'. Below is the qemu ar= gs for the same. Please let me know what I am missing here. >=20 > LC_ALL=3DC PATH=3D/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=3Dnone /us= r/libexec/qemu-kvm -name centos-6.5-vm1 -S -M rhel6.5.0 -enable-kvm -m 2048= -realtime mlock=3Doff -smp 4,sockets=3D4,cores=3D1,threads=3D1 -uuid daec3= cd9-d8b1-f01c-ba84-352da7f691f1 -nodefconfig -nodefaults -chardev socket,id= =3Dcharmonitor,path=3D/var/lib/libvirt/qemu/centos-6.5-vm1.monitor,server,n= owait -mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol -rtc base=3Dut= c -no-shutdown -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 -= drive file=3D/tmp/centos-6.5.qcow2-vm1,if=3Dnone,id=3Ddrive-virtio-disk0,fo= rmat=3Dqcow2,cache=3Dnone,aio=3Dnative -device virtio-blk-pci,scsi=3Doff,bu= s=3Dpci.0,addr=3D0x4,drive=3Ddrive-virtio-disk0,id=3Dvirtio-disk0,bootindex= =3D1 -drive file=3Doflame://192.168.122.77:5678/openflame/vDisk001,if=3Dnon= e,id=3Ddrive-virtio-disk1,format=3Dqcow2,cache=3Dnone,aio=3Dnative -device = virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-virtio-disk1= ,id=3Dvirtio-disk1 -drive if=3Dnone,media=3Dcdrom,id=3Ddrive-ide0-1-0,reado= nly=3Don,format=3Draw -device ide-drive,bus=3Dide.1,unit=3D0,drive=3Ddrive-= ide0-1-0,id=3Dide0-1-0 -netdev tap,fd=3D24,id=3Dhostnet0,vhost=3Don,vhostfd= =3D25 -device virtio-net-pci,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:0f:= f4:34,bus=3Dpci.0,addr=3D0x3 -chardev pty,id=3Dcharserial0 -device isa-seri= al,chardev=3Dcharserial0,id=3Dserial0 -device usb-tablet,id=3Dinput0 -vnc 0= =2E0.0.0:0 -vga cirrus -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0= ,addr=3D0x5 The following test works with qemu.git: # Serve pre-installed qcow2 disk image over NBD. Note that we tell # qemu-nbd it is a raw file so that qemu-nbd does not interpret the # file contents. qemu-nbd -t -p 1234 -f raw test.qcow2 $ qemu-system-x86_64 -enable-kvm -cpu host -m 1024 \ -drive if=3Dnone,cache=3Dnone,file=3Dnbd://localhost:1234,\ format=3Dqcow2,id=3Ddrive0 \ -device virtio-blk-pci,drive=3Ddrive0 The guest boots up successfully. This suggests either your block driver is buggy or you need to rebase onto qemu.git/master for it to work. If you would like help debugging then please rebase onto qemu.git/master and post a git URL where we can see the code. > 2. The qemu-kvm is starting with below arguments with virtio-scsi. I am n= ot able to see the TRIM in hdparm output of the device. Also, this is worki= ng with raw format only, not with qcow2 format. >=20 > LC_ALL=3DC PATH=3D/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=3Dnone /us= r/libexec/qemu-kvm -name centos-6.5-vm1 -S -M rhel6.5.0 -enable-kvm -m 2048= -realtime mlock=3Doff -smp 4,sockets=3D4,cores=3D1,threads=3D1 -uuid daec3= cd9-d8b1-f01c-ba84-352da7f691f1 -nodefconfig -nodefaults -chardev socket,id= =3Dcharmonitor,path=3D/var/lib/libvirt/qemu/centos-6.5-vm1.monitor,server,n= owait -mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol -rtc base=3Dut= c -no-shutdown -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 -= device virtio-scsi-pci,id=3Dscsi0,bus=3Dpci.0,addr=3D0x6 -device virtio-scs= i-pci,id=3Dscsi1,bus=3Dpci.0,addr=3D0x7 -drive file=3D/tmp/centos-6.5.qcow2= -vm1,if=3Dnone,id=3Ddrive-virtio-disk0,format=3Dqcow2,cache=3Dnone,aio=3Dna= tive -device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive= -virtio-disk0,id=3Dvirtio-disk0,bootindex=3D1 -drive file=3Doflame://10.209= =2E133.163:5678/openflame/vDisk001,if=3Dnone,id=3Ddrive-scsi1-0-0-0,format= =3Draw,cache=3Dnone,aio=3Dnative -device scsi-hd,bus=3Dscsi1.0,channel=3D0,= scsi-id=3D0,lun=3D0,drive=3Ddrive-scsi1-0-0-0,id=3Dscsi1-0-0-0 -drive if=3D= none,media=3Dcdrom,id=3Ddrive-ide0-1-0,readonly=3Don,format=3Draw -device i= de-drive,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0 -netdev = tap,fd=3D24,id=3Dhostnet0,vhost=3Don,vhostfd=3D25 -device virtio-net-pci,ne= tdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:0f:f4:34,bus=3Dpci.0,addr=3D0x3 -c= hardev pty,id=3Dcharserial0 -device isa-serial,chardev=3Dcharserial0,id=3Ds= erial0 -device usb-tablet,id=3Dinput0 -vnc 0.0.0.0:0 -vga cirrus -device vi= rtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x5 Try again with qemu.git/master. Note this command-line is missing -drive ...,discard=3Dunmap so it will not pass discard requests to the host. I'm also not sure whether hdparm is the right tool. This is a SCSI disk whereas hdparm is intended for ATA disks. Perhaps the ioctls are wired up so it works fine for SCSI disks but you should use sdparm for SCSI-specific stuff. --wchHw8dVAp53YPj8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUGW5zAAoJEJykq7OBq3PI6WoH/A90FNqncgS+MC34NDSn/7Mj Sq8xrEq92RV3LHOtZjONi9Nf6yO6qH6ZhXGG5Wm9PwmO19/HbjNLK0F2EttmSWHv mbv8Au3udTmx/YURVCgdjDJQXyoSV5LEdugQrG949ArK5z1tFrnfgBVw/nDB+Gad UYbwVwqLbsDgk7O54Z0qX7fKDk3P4ciX/9ZSyebLoT0XkCYK1xSGrve2A4z0tmJu fjOeB26/znBRWCmo29f5tw2EbXo8DuyS1UqnFO5HPrNWTeMcRzMf24IQJI/lQ+0X QmCnsnJkUB1F2gVgwEJbh3Bjgdkf05cx3k7cicyg5KAuBELhKz9vQdoR99rs6Lo= =8cIb -----END PGP SIGNATURE----- --wchHw8dVAp53YPj8--