Greetings,

the following patch changes the logic for the processing of WIN_SETMULT so
that setting it to 0 (off) is a valid operation as shown by (running Linux
on qemu)

  # hdparm -m0 /dev/hda

  /dev/hda:
  setting multcount to 0
  multcount    =  0 (off)

this is specially visible while running Ubuntu Linux 6.06 (dapper) on qemu as
it by default disables multmode at boot resulting in the following error :

  hda: set_multmode: status=0x41 { DriveReady Error }
  hda: set_multmode: error=0x04 { DriveStatusError }
  ide: failed opcode was: 0xef

Carlo
Index: hw/ide.c
===================================================================
RCS file: /sources/qemu/qemu/hw/ide.c,v
retrieving revision 1.53
diff -u -r1.53 ide.c
--- hw/ide.c    24 Jan 2007 21:35:22 -0000      1.53
+++ hw/ide.c    11 Feb 2007 20:32:24 -0000
@@ -1631,9 +1631,8 @@
             ide_set_irq(s);
             break;
         case WIN_SETMULT:
-            if (s->nsector > MAX_MULT_SECTORS || 
-                s->nsector == 0 ||
-                (s->nsector & (s->nsector - 1)) != 0) {
+            if (s->nsector != 0 && (s->nsector > MAX_MULT_SECTORS || 
+                (s->nsector & (s->nsector - 1)) != 0)) {
                 ide_abort_command(s);
             } else {
                 s->mult_sectors = s->nsector;
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to