diff options
author | Markus Armbruster <armbru@redhat.com> | 2012-07-11 15:08:37 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2012-07-17 16:48:32 +0200 |
commit | 911525dba9ecc21f97b05c0f09bf9319a9de3a7d (patch) | |
tree | 5d82736bd710e29d590d841bd2636d4247085eff /hw/virtio-blk.c | |
parent | 31e404f4ffb6adadea0b35de08e0a6b640e81a02 (diff) |
hw/block-common: Factor out fall back to legacy -drive serial=...
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/virtio-blk.c')
-rw-r--r-- | hw/virtio-blk.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index 38859048b9..ba087bc17f 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -600,13 +600,7 @@ VirtIODevice *virtio_blk_init(DeviceState *dev, VirtIOBlkConf *blk) return NULL; } - if (!blk->serial) { - /* try to fall back to value set with legacy -drive serial=... */ - dinfo = drive_get_by_blockdev(blk->conf.bs); - if (*dinfo->serial) { - blk->serial = strdup(dinfo->serial); - } - } + blkconf_serial(&blk->conf, &blk->serial); s = (VirtIOBlock *)virtio_common_init("virtio-blk", VIRTIO_ID_BLOCK, sizeof(struct virtio_blk_config), |