<div dir="ltr"><div>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:<br><br></div><div>HDIO_GET_IDENTITY failed: Invalid argument <br><br></div><div>as the error,but on the host, I will get the full harddisk/SSD info.<br><br></div><div>Can I know how to resolve this so that the output is the same for both host and guest?<br><br></div><div>My strace of hdparm from within the guest (just "-e ioctl" is traced):<br><br>ioctl(3, HDIO_GET_MULTCOUNT, 0x618ef0)  = -1 EINVAL (Invalid argument)<br>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<br>ioctl(3, HDIO_GET_IDENTITY, 0x7fffda088500) = -1 EINVAL (Invalid argument)<br> HDIO_GET_IDENTITY failed: Invalid argument<br>+++ exited with 22 +++<br><br></div><div>And at the host level:<br><br></div><div>ioctl(1, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0x7ffd4b096d90) = -1 ENOTTY (Inappropriate ioctl for device)<br>ioctl(3, HDIO_GET_MULTCOUNT, 0x618ef0)  = -1 ENOTTY (Inappropriate ioctl for device)<br>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<br>ioctl(3, HDIO_GET_IDENTITY, 0x7ffd4b0976e0) = 0<br>+++ exited with 0 +++<br><br></div><div>And my qemu command line:<br><br>sudo ./x86_64-softmmu/qemu-system-x86_64 -m 1024 -boot c -enable-kvm -net nic -net user \<br>-device virtio-scsi-pci \<br>-drive if=none,file=/dev/sdb,id=sdb,cache=none,format=raw \<br>-device scsi-block,drive=sdb \<br>-hda /home/user/ubuntu1404_x86_64/ubuntu1404_x86_64.img<br><br></div><div>where qemu-system_x86_64 is freshly compiled from latest qemu-devel git tree.<br><br></div><div>I would the SSD (internal SATA) at /dev/sdb to be pass directly into qemu.<br></div><div><br></div>Please kindly recommend the best solution:   distro (CentOS??),  kernel version,  qemu command like, and setup procedure for libvirtd?  or virtio-scsi?<br><br></div>