Output of hdparam is below. Also let me know does network based protocol supports 'qcow2' format. As my block driver is network based. It is perfectly working for raw format. When I change the type='qcow2', then it is not working because bdrv_get_geometry() is returning 0. This I am talking about qemu-kvm-0.12.1.2.
[root@localhost ~]# hdparm -I /dev/sda /dev/sda: SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ATA device, with non-removable media Standards: Likely used: 1 Configuration: Logical max current cylinders 0 0 heads 0 0 sectors/track 0 0 -- Logical/Physical Sector size: 512 bytes device size with M = 1024*1024: 0 MBytes device size with M = 1000*1000: 0 MBytes cache/buffer size = unknown Capabilities: IORDY not likely Cannot perform double-word IO R/W multiple sector transfer: not supported DMA: not supported PIO: pio0 -----Original Message----- From: Sanjay Kumar2 Sent: Wednesday, September 03, 2014 4:11 PM To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org Subject: RE: [Qemu-devel] Query regarding bdrv_co_discard Thanks Stefan. I using the same. Below is the XML. <disk type='network' device='disk'> <driver name='qemu' type='raw' cache='none' io='native' discard='unmap'/> <source protocol='oflame' name='/dev/of/vdisk/{a30c3997-0ad8-4495-8549-68431abfa84a}'> <host name='10.209.133.163' port='9999'/> </source> <target dev='sda' bus='scsi'/> <address type='drive' controller='1' bus='0' target='0' unit='0'/> </disk> .... <controller type='scsi' index='1' model='virtio-scsi'> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </controller> I am able to see the scsi disk, /dev/sda inside the guest, but does not showing TRIM supported in the hdparm output. Fstrim command is also failing. Regards, Sanjay -----Original Message----- From: Stefan Hajnoczi [mailto:stefa...@gmail.com] Sent: Wednesday, September 03, 2014 4:06 PM To: Sanjay Kumar2 Cc: qemu-devel@nongnu.org Subject: Re: [Qemu-devel] Query regarding bdrv_co_discard On Tue, Sep 02, 2014 at 02:09:44AM -0700, Sanjay Kumar2 wrote: > Please let me know how to test bdrv_co_discard interface. I mean what steps I > need to do on KVM host and inside guest to do end to end testing of this > interface. I have implemented a network protocol based block driver and > defined bdrv_co_discard interface as well which free the blocks on the remote > storage device. Use a virtio-scsi storage controller and then the guest can send SCSI discard commands. Make sure to use the -drive ...,discard=unmap option, otherwise discard commands are silently ignored. Stefan