From: Stefan Hajnoczi <stefanha@gmail.com>
To: Sanjay Kumar2 <Sanjay_Kumar2@symantec.com>
Cc: "'qemu-devel@nongnu.org'" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Important] Query regarding bdrv_co_discard
Date: Wed, 17 Sep 2014 12:20:19 +0100 [thread overview]
Message-ID: <20140917112019.GE10699@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1587858E792C6C48ADD97BCB156E8ED031FC2041AD@APJ1XCHEVSPIN31.SYMC.SYMANTEC.COM>
[-- Attachment #1: Type: text/plain, Size: 4595 bytes --]
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.
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
prev parent reply other threads:[~2014-09-17 11:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-04 12:56 [Qemu-devel] [Important] Query regarding bdrv_co_discard Sanjay Kumar2
2014-09-04 13:59 ` Stefan Hajnoczi
2014-09-11 8:53 ` Sanjay Kumar2
2014-09-17 11:20 ` Stefan Hajnoczi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140917112019.GE10699@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=Sanjay_Kumar2@symantec.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).