diff options
author | Cornelia Huck <cohuck@redhat.com> | 2018-07-06 15:06:20 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-07-10 14:36:12 +0200 |
commit | 6703db131f832d6af58fa629be11c5efa5a6adb8 (patch) | |
tree | c9326a22cfbfab46dcd29c273ecc40665abd0332 /hw | |
parent | 75f4cd297922e1ac352625badf548d4a1bb96089 (diff) | |
download | qemu-6703db131f832d6af58fa629be11c5efa5a6adb8.zip qemu-6703db131f832d6af58fa629be11c5efa5a6adb8.tar.gz qemu-6703db131f832d6af58fa629be11c5efa5a6adb8.tar.bz2 |
Revert "block: Remove deprecated -drive geometry options"
This reverts commit a7aff6dd10b16b67e8b142d0c94c5d92c3fe88f6.
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 'hw')
-rw-r--r-- | hw/block/block.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/block/block.c b/hw/block/block.c index b6c80ab..b91e2b6 100644 --- a/hw/block/block.c +++ b/hw/block/block.c @@ -108,6 +108,20 @@ bool blkconf_geometry(BlockConf *conf, int *ptrans, unsigned cyls_max, unsigned heads_max, unsigned secs_max, Error **errp) { + DriveInfo *dinfo; + + if (!conf->cyls && !conf->heads && !conf->secs) { + /* try to fall back to value set with legacy -drive cyls=... */ + dinfo = blk_legacy_dinfo(conf->blk); + if (dinfo) { + conf->cyls = dinfo->cyls; + conf->heads = dinfo->heads; + conf->secs = dinfo->secs; + if (ptrans) { + *ptrans = dinfo->trans; + } + } + } if (!conf->cyls && !conf->heads && !conf->secs) { hd_geometry_guess(conf->blk, &conf->cyls, &conf->heads, &conf->secs, |