On 01.02.2016 06:33, Peter Teoh wrote:
At the present moment, my guest is running inside qemu and host is
kvm
intel, running Ubuntu 14.04, kernel is 4.3.0 stable. From within the
guest, when I run "hdparm -i /dev/sdb" on the guest, I get:
HDIO_GET_IDENTITY failed: Invalid argument
as the error,but on the host, I will get the full harddisk/SSD info.
Can I know how to resolve this so that the output is the same for both host
and guest?
My strace of hdparm from within the guest (just "-e ioctl" is traced):
ioctl(3, HDIO_GET_MULTCOUNT, 0x618ef0) = -1 EINVAL (Invalid argument)
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[16]=[85, 08, 0e, 00, 00, 00,
01, 00, 00, 00, 00, 00, 00, 40, ec, 00], mx_sb_len=32, iovec_count=0,
dxfer_len=512, timeout=15000, flags=0,
data[512]=["@\0\377?7\310\20\0\0\0\0\0?\0\0\0\0\0\0\0HPAD0409105B"...],
status=00, masked_status=00, sb[0]=[], host_status=0, driver_status=0,
resid=0, duration=184, info=0}) = 0
ioctl(3, HDIO_GET_IDENTITY, 0x7fffda088500) = -1 EINVAL (Invalid argument)
HDIO_GET_IDENTITY failed: Invalid argument
+++ exited with 22 +++
I guess this is qemu-kvm limitation. You'd better ask on qemu-devel list.
Michal