From: Kevin Wolf <kwolf@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
Alexander Graf <agraf@suse.de>,
QEMU-devel Developers <qemu-devel@nongnu.org>,
Joerg Roedel <Joerg.Roedel@amd.com>,
"tj@kernel.org" <tj@kernel.org>,
Sebastian Herbszt <herbszt@gmx.de>,
Roland Elek <elek.roland@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 00/10] AHCI emulation support v2
Date: Fri, 19 Nov 2010 13:27:37 +0100 [thread overview]
Message-ID: <4CE66D39.9010404@redhat.com> (raw)
In-Reply-To: <4CE66605.9090807@redhat.com>
Am 19.11.2010 12:56, schrieb Gerd Hoffmann:
> Hi,
>
>>> As I would rather have something working we can base on in the
>>> tree, so whoever volunteers for the refactoring (hint!) knows how
>>> to design the interfaces, I am not sure how much is reasonable
>>> within this patch set.
>>
>> I guess I have to read this as: You want to drop the code into the
>> repository, no matter what mess it creates, and leave the cleanup to
>> some volunteer that will never appear. So whoever is in the
>> unfortunate position of having to touch the IDE code afterwards will
>> have the pain because this series is doing only the half of what
>> should be done.
>
> Well, this is how IDE gets cleaned up right now. I was one of the
> victims ;)
>
> IDE is in a noticeable better state than it used to be two years ago.
> It is still quite messy though.
Sure that's how it works today. We have no choice because we can't
change the mistakes that were made in the past. But we can avoid to
contribute new mess to it or we'll need even more victims. ;-)
>> I'm sure that with a working time of only a few days the result could
>> be substantially improved, even if a month would be needed for
>> perfection.
>
> [ disclaimer: didn't look at v3 yet ]
>
> Adding ahci should at least not make it more messy that it already is.
>
> Doing the controller-depending dispatching through a function pointer
> table (aka IDEBusOps) looks sane to me. SCSI does the same, although
> without a Ops struct as it needs a single function pointer only.
Yes, I suppose (still haven't looked at it in detail) these interfaces
are generally sane, based on your comments and a quick look.
This is also what makes me think that doing the next step shouldn't be
too hard. The abstraction is basically in place, the rest should be
mostly code movement and maybe splitting up some IDE data structures to
make things look more symmetric between PATA and SATA.
> Moving code shared between sata/ahci and ide to another source file
> (ata.c ?) makes sense and would be a good start to make clear which code
> is used for what.
I agree (and ata.c would have been my suggestion, too).
> IDEBus must learn some things about sata. For example there is no such
> thing as a slave device, so a IDEBus representing a sata port must not
> allow slave devices being attached.
Hm, do the generic functions (i.e. what would end up in ata.c) even need
access to the IDEBus? If not, we could leave IDEBus as it is for Legacy
IDE and introduce a completely new SATABus.
Most occurrences in core.c seem to use the bus only for ide_set_irq.
> Fixing the IDEState mess would be great. Right now IDEBus carries a
> array of IDEStates for master and slave for historical reasons: The ide
> code (used to?) assume that the IDEStates for master and slave are
> allocated together and that it can easily jump from one to the other and
> back using pointer arithmetics on the IDEState struct. IDEState doesn't
> belong there though, it should be part of IDEDrive.
Okay, that makes sense.
Kevin
next prev parent reply other threads:[~2010-11-19 12:27 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-18 3:27 [Qemu-devel] [PATCH 00/10] AHCI emulation support v2 Alexander Graf
2010-11-18 3:27 ` [Qemu-devel] [PATCH 01/10] ide: split ide command interpretation off Alexander Graf
2010-11-18 3:27 ` [Qemu-devel] [PATCH 02/10] ide: fix whitespace gap in ide_exec_cmd Alexander Graf
2010-11-18 3:27 ` [Qemu-devel] [PATCH 03/10] ide: add support for ide bus ops Alexander Graf
2010-11-18 3:27 ` [Qemu-devel] [PATCH 04/10] ide: add DMA hooks to " Alexander Graf
2010-11-18 3:27 ` [Qemu-devel] [PATCH 05/10] ide: add ncq identify data for ahci sata drives Alexander Graf
2010-11-18 3:27 ` [Qemu-devel] [PATCH 06/10] pci: add storage class for sata Alexander Graf
2010-11-18 3:27 ` [Qemu-devel] [PATCH 07/10] pci: add ich7 pci id Alexander Graf
2010-11-18 3:27 ` [Qemu-devel] [PATCH 08/10] ahci: add ahci emulation Alexander Graf
2010-11-18 8:01 ` [Qemu-devel] " Gerd Hoffmann
2010-11-18 18:05 ` Alexander Graf
2010-11-19 9:12 ` Gerd Hoffmann
2010-11-19 10:08 ` Roedel, Joerg
2010-11-18 3:27 ` [Qemu-devel] [PATCH 09/10] ahci: add -drive support Alexander Graf
2010-11-18 3:27 ` [Qemu-devel] [PATCH 10/10] ahci: spawn controller on demand Alexander Graf
2010-11-18 10:00 ` [Qemu-devel] Re: [PATCH 00/10] AHCI emulation support v2 Stefan Hajnoczi
2010-11-18 13:26 ` [Qemu-devel] " Kevin Wolf
2010-11-18 18:43 ` Alexander Graf
2010-11-18 20:06 ` Ryan Harper
2010-11-18 23:24 ` Alexander Graf
2010-11-19 9:12 ` Stefan Hajnoczi
2010-11-21 2:32 ` Alexander Graf
2010-11-19 9:15 ` Kevin Wolf
2010-11-19 11:56 ` Gerd Hoffmann
2010-11-19 12:27 ` Kevin Wolf [this message]
2010-11-19 13:08 ` Alexander Graf
2010-11-19 13:46 ` Kevin Wolf
2010-11-21 2:19 ` Alexander Graf
2010-11-22 8:45 ` Kevin Wolf
2010-11-19 14:36 ` Gerd Hoffmann
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=4CE66D39.9010404@redhat.com \
--to=kwolf@redhat.com \
--cc=Joerg.Roedel@amd.com \
--cc=agraf@suse.de \
--cc=elek.roland@gmail.com \
--cc=herbszt@gmx.de \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=tj@kernel.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.