Patchwork [28/32] ide pc: Put hard disk info into CMOS only for hard disks

login
register
mail settings
Submitter Markus Armbruster
Date July 6, 2012, 6:58 a.m.
Message ID <1341557890-17464-29-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/169347/
State New
Headers show

Comments

Markus Armbruster - July 6, 2012, 6:58 a.m.
In particular, don't set disk type and geometry when a CD-ROM on bus
ide.0 has media during CMOS initialization.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/ide/qdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index f191dd3..84097fd 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -117,7 +117,7 @@  int ide_get_geometry(BusState *bus, int unit,
 {
     IDEState *s = &DO_UPCAST(IDEBus, qbus, bus)->ifs[unit];
 
-    if (!s->bs) {
+    if (s->drive_kind != IDE_HD || !s->bs) {
         return -1;
     }