ide: Correct the CHS 'cyls_max' limit to be 65535
authorShmulik Ladkani <shmulik.ladkani@ravellosystems.com>
Mon, 25 Jan 2016 19:34:40 +0000 (14:34 -0500)
committerJohn Snow <jsnow@redhat.com>
Mon, 25 Jan 2016 19:34:40 +0000 (14:34 -0500)
In b7eb0c9:
  hw/block-common: Factor out fall back to legacy -drive cyls=...
'blkconf_geometry()' was introduced, factoring out CHS limit validation
code that was repeated in ide, scsi, virtio-blk.

The original IDE CHS limit prior b7eb0c9 was 65535,16,255 (as per ATA
CHS addressing).
However the 'cyls_max' argument passed to 'blkconf_geometry' in the
ide_dev_initfn case was accidentally set to 65536 instead of 65535.

Fix, providing the correct 'cyls_max'.

Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 1453112371-29760-1-git-send-email-shmulik.ladkani@ravellosystems.com
Signed-off-by: John Snow <jsnow@redhat.com>
hw/ide/qdev.c

index 1f831098c7653fa154f8397137fac2d1543bdd83..fea54256adcba38151b03c76c2e21b336a4c609d 100644 (file)
@@ -172,7 +172,7 @@ static int ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind)
 
     blkconf_serial(&dev->conf, &dev->serial);
     if (kind != IDE_CD) {
-        blkconf_geometry(&dev->conf, &dev->chs_trans, 65536, 16, 255, &err);
+        blkconf_geometry(&dev->conf, &dev->chs_trans, 65535, 16, 255, &err);
         if (err) {
             error_report_err(err);
             return -1;