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 causing > issue. After debugging I found that it is returning because > bdrv_get_geometry() is returning 0 in case of format='qcow2'. Below is the > qemu args for the same. Please let me know what I am missing here. > > LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none > /usr/libexec/qemu-kvm -name centos-6.5-vm1 -S -M rhel6.5.0 -enable-kvm -m > 2048 -realtime mlock=off -smp 4,sockets=4,cores=1,threads=1 -uuid > daec3cd9-d8b1-f01c-ba84-352da7f691f1 -nodefconfig -nodefaults -chardev > socket,id=charmonitor,path=/var/lib/libvirt/qemu/centos-6.5-vm1.monitor,server,nowait > -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown > -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive > file=/tmp/centos-6.5.qcow2-vm1,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,aio=native > -device > virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 > -drive > file=oflame://192.168.122.77:5678/openflame/vDisk001,if=none,id=drive-virtio-disk1,format=qcow2,cache=none,aio=native > -device > virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1 > -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device > ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev > tap,fd=24,id=hostnet0,vhost=on,vhostfd=25 -device > virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:0f:f4:34,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 -vga cirrus -device > virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
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=none,cache=none,file=nbd://localhost:1234,\ format=qcow2,id=drive0 \ -device virtio-blk-pci,drive=drive0 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 not > able to see the TRIM in hdparm output of the device. Also, this is working > with raw format only, not with qcow2 format. > > LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none > /usr/libexec/qemu-kvm -name centos-6.5-vm1 -S -M rhel6.5.0 -enable-kvm -m > 2048 -realtime mlock=off -smp 4,sockets=4,cores=1,threads=1 -uuid > daec3cd9-d8b1-f01c-ba84-352da7f691f1 -nodefconfig -nodefaults -chardev > socket,id=charmonitor,path=/var/lib/libvirt/qemu/centos-6.5-vm1.monitor,server,nowait > -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown > -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device > virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x6 -device > virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x7 -drive > file=/tmp/centos-6.5.qcow2-vm1,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,aio=native > -device > virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 > -drive > file=oflame://10.209.133.163:5678/openflame/vDisk001,if=none,id=drive-scsi1-0-0-0,format=raw,cache=none,aio=native > -device > scsi-hd,bus=scsi1.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi1-0-0-0,id=scsi1-0-0-0 > -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device > ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev > tap,fd=24,id=hostnet0,vhost=on,vhostfd=25 -device > virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:0f:f4:34,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 -vga cirrus -device > virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 Try again with qemu.git/master. Note this command-line is missing -drive ...,discard=unmap 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.
pgpe3K4S2MBDN.pgp
Description: PGP signature