}
memcpy(&outbuf[8], "QEMU ", 8);
memset(&outbuf[32], 0, 4);
- memcpy(&outbuf[32], s->version ? s->version : QEMU_VERSION,
- MIN(4, strlen(s->version ? s->version : QEMU_VERSION)));
+ memcpy(&outbuf[32], s->version, MIN(4, strlen(s->version)));
/*
* We claim conformance to SPC-3, which is required for guests
* to ask for modern features like READ CAPACITY(16) or the
}
}
+ if (!s->version) {
+ s->version = qemu_strdup(QEMU_VERSION);
+ }
+
if (bdrv_is_sg(s->bs)) {
error_report("scsi-disk: unwanted /dev/sg*");
return -1;