aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorCornelia Huck <cohuck@redhat.com>2018-07-06 15:06:18 +0200
committerKevin Wolf <kwolf@redhat.com>2018-07-10 14:36:11 +0200
commit44e8b4689c6e3aba4df08a1201f02ac7bf3d2fdb (patch)
tree62015cc3b8e10be81be4ae78ba07eced8791b14c /blockdev.c
parent19a49c5637a3d7c2c61ba9d1149a4f6ee419988a (diff)
Revert "block: Remove deprecated -drive option serial"
This reverts commit b0083267444a5e0f28391f6c2831a539f878d424. Hold off removing this for one more QEMU release (current libvirt release still uses it.) Signed-off-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/blockdev.c b/blockdev.c
index 37eb40670b..6c530769fd 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -731,6 +731,10 @@ QemuOptsList qemu_legacy_drive_opts = {
.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,
.help = "file name",
@@ -772,10 +776,12 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
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 */
@@ -943,6 +949,9 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
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;
@@ -1017,6 +1026,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
dinfo->type = type;
dinfo->bus = bus_id;
dinfo->unit = unit_id;
+ dinfo->serial = g_strdup(serial);
blk_set_legacy_dinfo(blk, dinfo);