All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carlo Marcelo Arenas Belon <carenas-kLeDWSohozoJb6fo7hG9ng@public.gmane.org>
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [PATCH 1/2] Revert "kvm: qemu: GET_CONFIGURATION fixes to allow OpenSolaris CD-ROM access"
Date: Mon, 14 Jan 2008 02:20:52 -0600	[thread overview]
Message-ID: <20080114082052.GC17588@tapir> (raw)
In-Reply-To: <20080114081835.GB17588@tapir>

This reverts commit b64c20519d5826875679b6df85afebed27e1a9a8.

Conflicts:

	qemu/hw/ide.c (keep uint64_t total_sectors)

Signed-off-by: Carlo Marcelo Arenas Belon <carenas-kLeDWSohozoJb6fo7hG9ng@public.gmane.org>
---
 qemu/hw/ide.c |   27 ++++++++-------------------
 1 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/qemu/hw/ide.c b/qemu/hw/ide.c
index 90f2f2b..9a22db9 100644
--- a/qemu/hw/ide.c
+++ b/qemu/hw/ide.c
@@ -1640,7 +1640,6 @@ static void ide_atapi_cmd(IDEState *s)
         break;
     case GPCMD_GET_CONFIGURATION:
         {
-            uint32_t len;
             uint64_t total_sectors;
 
             /* only feature 0 is supported */
@@ -1649,27 +1648,17 @@ static void ide_atapi_cmd(IDEState *s)
                                     ASC_INV_FIELD_IN_CMD_PACKET);
                 break;
             }
-            max_len = ube16_to_cpu(packet + 7);
-            bdrv_get_geometry(s->bs, &total_sectors);
             memset(buf, 0, 32);
-            if (total_sectors) {
-                if (total_sectors > 1433600) {
-                    buf[7] = 0x10; /* DVD-ROM */
-                } else {
-                    buf[7] = 0x08; /* CD-ROM */
-                }
-            } else {
-                buf[7] = 0x00; /* no current profile */
-            }
-            buf[10] = 0x02 | 0x01; /* persistent and current */
-            buf[11] = 0x08; /* size of profile list = 4 bytes per profile */
+            bdrv_get_geometry(s->bs, &total_sectors);
+            buf[3] = 16;
+            buf[7] = total_sectors <= 1433600 ? 0x08 : 0x10; /* current profile */
+            buf[10] = 0x10 | 0x1;
+            buf[11] = 0x08; /* size of profile list */
             buf[13] = 0x10; /* DVD-ROM profile */
-            buf[14] = buf[13] == buf[7]; /* (in)active */
+            buf[14] = buf[7] == 0x10; /* (in)active */
             buf[17] = 0x08; /* CD-ROM profile */
-            buf[18] = buf[17] == buf[7]; /* (in)active */
-            len = 8 + 4 + buf[11]; /* headers + size of profile list */
-            cpu_to_ube32(buf, len - 4); /* data length */
-            ide_atapi_cmd_reply(s, len, max_len);
+            buf[18] = buf[7] == 0x08; /* (in)active */
+            ide_atapi_cmd_reply(s, 32, 32);
             break;
         }
     default:
-- 
1.5.3.7


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

  reply	other threads:[~2008-01-14  8:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-14  8:18 [PATCH 0/2] qemu: Multi-profile IDE DVD-ROM support Carlo Marcelo Arenas Belon
2008-01-14  8:20 ` Carlo Marcelo Arenas Belon [this message]
2008-01-14  8:26 ` [PATCH 2/2] qemu: Multi-profile " Carlo Marcelo Arenas Belon
2008-01-15 14:08 ` [PATCH 0/2] qemu: Multi-profile IDE " Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080114082052.GC17588@tapir \
    --to=carenas-kledwsohozojb6fo7hg9ng@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.