Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HGMCL-0007Za-Of for qemu-devel@nongnu.org; Sun, 11 Feb 2007 16:25:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HGMCJ-0007XT-U0 for qemu-devel@nongnu.org; Sun, 11 Feb 2007 16:25:25 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGMCJ-0007XQ-Pf for qemu-devel@nongnu.org; Sun, 11 Feb 2007 16:25:23 -0500 Received: from tapir.sajinet.com.pe ([66.139.79.212]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HGMCJ-0004Pg-8I for qemu-devel@nongnu.org; Sun, 11 Feb 2007 16:25:23 -0500 Date: Sun, 11 Feb 2007 15:39:09 -0600 From: Carlo Marcelo Arenas Belon Message-ID: <20070211213909.GB12406@tapir.sajinet.com.pe> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ZfOjI3PrQbgiZnxM" Content-Disposition: inline Subject: [Qemu-devel] [PATCH] add "support" for enable/disable reverting to power-on defaults Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --ZfOjI3PrQbgiZnxM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Greetings, the following patch adds subcommands 0xCC and 0x66 for enabling/disabling reverting to power-on defaults after a soft reset as invoked by the following command (running under Linux) : # hdparm -K1 /dev/hda /dev/hda: setting drive keep features to 1 (on) this is specially visible in OpenSolaris that locks the drive configuration at boot as shown by (line 1366): http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/intel/io/dktp/controller/ata/ata_common.c and therefore will complain with the following error when booted in qemu : ata_set_feature: (0x66,0x0) failed the proposed implementation just ignores the flag but is consistent with the current behavior for the other IDE feature flags (read look-ahead and write cache) a complete implementation for all SET_FEATURES subcommands as spelled in section 8.37 of the ATA/ATAPI 5 (T13/1321D revision 3) standard will be provided later if the increase in complexity size is worth the added functionality (to be debated) Carlo --ZfOjI3PrQbgiZnxM Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="qemu-keep-features-over-reset.patch" 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 @@ -1729,6 +1728,8 @@ goto abort_cmd; /* XXX: valid for CDROM ? */ switch(s->feature) { + case 0xcc: /* reverting to power-on defaults enable */ + case 0x66: /* reverting to power-on defaults disable*/ case 0x02: /* write cache enable */ case 0x82: /* write cache disable */ case 0xaa: /* read look-ahead enable */ --ZfOjI3PrQbgiZnxM--