提交 552fee93 编写于 作者: M Markus Armbruster 提交者: Kevin Wolf

scsi: Fix info qtree for scsi-disk.ver

Show the actual default value instead of <null> when the property has
not been set.
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 a0fef654
...@@ -462,8 +462,7 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf) ...@@ -462,8 +462,7 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf)
} }
memcpy(&outbuf[8], "QEMU ", 8); memcpy(&outbuf[8], "QEMU ", 8);
memset(&outbuf[32], 0, 4); memset(&outbuf[32], 0, 4);
memcpy(&outbuf[32], s->version ? s->version : QEMU_VERSION, memcpy(&outbuf[32], s->version, MIN(4, strlen(s->version)));
MIN(4, strlen(s->version ? s->version : QEMU_VERSION)));
/* /*
* We claim conformance to SPC-3, which is required for guests * We claim conformance to SPC-3, which is required for guests
* to ask for modern features like READ CAPACITY(16) or the * to ask for modern features like READ CAPACITY(16) or the
...@@ -1066,6 +1065,10 @@ static int scsi_disk_initfn(SCSIDevice *dev) ...@@ -1066,6 +1065,10 @@ static int scsi_disk_initfn(SCSIDevice *dev)
} }
} }
if (!s->version) {
s->version = qemu_strdup(QEMU_VERSION);
}
if (bdrv_is_sg(s->bs)) { if (bdrv_is_sg(s->bs)) {
error_report("scsi-disk: unwanted /dev/sg*"); error_report("scsi-disk: unwanted /dev/sg*");
return -1; return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册