Received: from eggs.gnu.org ([2001:4830:134:3::10]:47637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpdSD-00062V-DE for qemu-devel@nongnu.org; Thu, 29 Sep 2016 11:41:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpdSC-00034W-Fy for qemu-devel@nongnu.org; Thu, 29 Sep 2016 11:40:57 -0400 Date: Thu, 29 Sep 2016 17:40:43 +0200 From: Kevin Wolf Message-ID: <20160929154043.GN5742@noname.redhat.com> References: <1473090236-14793-1-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1473090236-14793-1-git-send-email-kwolf@redhat.com> Subject: Re: [Qemu-devel] [PATCH 0/3] fdc: Use separate qdev device for drives List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: jsnow@redhat.com, mreitz@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org Am 05.09.2016 um 17:43 hat Kevin Wolf geschrieben: > We have been complaining for a long time about how the floppy controller and > floppy drives are combined in a single qdev device and how this makes the > device awkward to work with because it behaves different from all other block > devices. > > The latest reason to complain was when I noticed that using qdev device names > in QMP commands (e.g. for media change) doesn't really work when only the > controller is a qdev device, but the drives aren't. > > So I decided to have a go at it, and this is the result. > > It doesn't actually change any of the inner workings of the floppy controller, > but it wires things up differently on the qdev layer so that a floppy > controller now exposes a bus on which the floppy drives sit. This results in a > structure that is similar to IDE where the actual drive state is still in the > controller and the qdev device basically just contains the qdev properties - > not pretty, but quite workable. > > The commit message of patch 3 explains how to use it. In short, there is a > '-device floppy' now and it does what you would expect if you ever used ide-cd. > > The other problem is old command lines, especially those using things like > '-global isa-fdc,driveA=...'. In order to keep them working, we need to forward > the property to an internally created floppy drive device. This is a bit like > usb-storage, which we know is ugly, but works well enough in practice. The good > news here is that in contrast to usb-storage, the floppy controller only does > the forwarding for legacy configurations; as soon as you start using '-device > floppy', it doesn't happen any more. > > So as you may have expected, this conversion doesn't result in a perfect > device, but I think it's definitely an improvement over the old state. I hope > you like it despite the warts. :-) > > Kevin Wolf (3): > fdc: Add a floppy qbus > fdc: Add a floppy drive qdev > fdc: Move qdev properties to FloppyDrive > > hw/block/fdc.c | 255 +++++++++++++++++++++++++++++++++++++++++++++++---------- > vl.c | 1 + > 2 files changed, 211 insertions(+), 45 deletions(-) Ping? This series really isn't as scary as one may think when looking only at the subject lines. Kevin