Il 09/01/2013 11:58, Liu Yuan ha scritto:
> On 01/09/2013 06:46 PM, Liu Yuan wrote:
>> I'll collect some numbers on it.
> 
> Well, when I use hdparm -W 0 /dev/vdx to choose the writethrough cache
> in the Guest (virtio disk), it says:
> 
> test@vm1:~$ sudo hdparm -W 0 /dev/vdb
> 
> /dev/vdb:
>  setting drive write-caching to 0 (off)
>  HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
>  HDIO_DRIVE_CMD(flushcache) failed: Inappropriate ioctl for device
>  HDIO_DRIVE_CMD(setcache) failed: Inappropriate ioctl for device
>  HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
>  HDIO_DRIVE_CMD(flushcache) failed: Inappropriate ioctl for device
>  HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
> 
> Do I need extra flags to enable WCE?

"hdparm" is specific for IDE devices.  sysfs is supported by SCSI
(including IDE with libata, and virtio-scsi) and virtio-blk.

You can use this for SCSI:

echo 'write back' > /sys/block/sda/device/scsi_disk/*/cache_type

and a similar command for virtio-blk.

Paolo

> Both Guest and Host kernel is 3.7 and I start QEMU by following command:
> 
> $ qemu-system-x86_64 --enable-kvm -drive
> file=~/images/test1,if=virtio,cache=writeback -smp 2 -cpu host -m 1024
> -drive file=sheepdog:test,if=virtio,cache=writeback
> 
> Thanks,
> Yuan
> 
> 


Reply via email to