.name = "if",
.type = QEMU_OPT_STRING,
.help = "interface (ide, scsi, sd, mtd, floppy, pflash, virtio)",
+ },{
+ .name = "serial",
+ .type = QEMU_OPT_STRING,
+ .help = "disk serial number",
},{
.name = "file",
.type = QEMU_OPT_STRING,
const char *werror, *rerror;
bool read_only = false;
bool copy_on_read;
+ const char *serial;
const char *filename;
Error *local_err = NULL;
int i;
+ const char *deprecated[] = {
+ "serial"
+ };
/* Change legacy command line options into QMP ones */
static const struct {
goto fail;
}
+ /* Other deprecated options */
+ if (!qtest_enabled()) {
+ for (i = 0; i < ARRAY_SIZE(deprecated); i++) {
+ if (qemu_opt_get(legacy_opts, deprecated[i]) != NULL) {
+ error_report("'%s' is deprecated, please use the corresponding "
+ "option of '-device' instead", deprecated[i]);
+ }
+ }
+ }
+
/* Media type */
value = qemu_opt_get(legacy_opts, "media");
if (value) {
goto fail;
}
+ /* Serial number */
+ serial = qemu_opt_get(legacy_opts, "serial");
+
/* no id supplied -> create one */
if (qemu_opts_id(all_opts) == NULL) {
char *new_id;
dinfo->type = type;
dinfo->bus = bus_id;
dinfo->unit = unit_id;
+ dinfo->serial = g_strdup(serial);
blk_set_legacy_dinfo(blk, dinfo);