qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 0/4] Adding -cdrom, -hd[abcd] and -drive file=... to Q35
@ 2014-08-18 22:05 John Snow
  2014-08-18 22:05 ` [Qemu-devel] [RFC 1/4] blockdev: add if_get_max_devs John Snow
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: John Snow @ 2014-08-18 22:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, jsnow, armbru, stefanha, agraf

Currently, the drive definitions created by drive_new() when using
the -drive file=...[,if=ide] or -cdrom or -hd[abcd] options are not
picked up by the Q35 initialization routine.

To fix this, we have to add hooks to search for these drives using
something like pc_piix's ide_drive_get and then add them using
something like pci_ide_create_devs.

Where it gets slightly wonky is the fact that if=ide is specified
to use two devices per bus, whereas AHCI does not utilize that
same master/slave mechanic. Therefore, many places inside of
blockdev.c where we add and define new drives use incorrect math
for AHCI devices and try to place them on impossible buses.
Notably -hdb and -hdd would become inaccessible.

To remedy this, I added a new interface type, IF_AHCI. Corresponding
to this change, I modified the default machine properties for Q35
to use this interface as a default.

The changes appear to work well, but where I'd like some feedback
is what should happen if people do something like:

qemu -M q35 -drive if=ide,file=fedora.qcow2

The code as presented here is not going to look for or attempt to
connect IDE devices, because it is now looking for /AHCI/ devices.

At worst, this may break a few existing scripts, but I actually think
that since the if=ide,file=... shorthand never worked to begin with,
the impact might actually be minimal.

But since the legacy IDE interface of the ICH9 is as of yet unemulated,
the if=ide drives don't have a reasonable place to go yet. I am also
not sure what a reasonable way to handle people specifying BOTH
if=ide and if=ahci drives would be.

John Snow (4):
  blockdev: add if_get_max_devs
  blockdev: add IF_AHCI to support -cdrom and -hd[a-d]
  ide: update ide_drive_get to work with both PCI-IDE and AHCI
    interfaces
  ahci: implement -cdrom and -hd[a-d]

 blockdev.c                | 18 +++++++++++++++---
 hw/i386/pc_piix.c         |  2 +-
 hw/i386/pc_q35.c          |  4 ++++
 hw/ide/ahci.c             | 17 +++++++++++++++++
 hw/ide/ahci.h             |  2 ++
 hw/ide/core.c             | 11 +++++++----
 include/hw/ide.h          |  3 ++-
 include/sysemu/blockdev.h |  3 ++-
 8 files changed, 50 insertions(+), 10 deletions(-)

-- 
1.9.3

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-08-20  7:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-18 22:05 [Qemu-devel] [RFC 0/4] Adding -cdrom, -hd[abcd] and -drive file=... to Q35 John Snow
2014-08-18 22:05 ` [Qemu-devel] [RFC 1/4] blockdev: add if_get_max_devs John Snow
2014-08-18 22:05 ` [Qemu-devel] [RFC 2/4] blockdev: add IF_AHCI to support -cdrom and -hd[a-d] John Snow
2014-08-18 22:05 ` [Qemu-devel] [RFC 3/4] ide: update ide_drive_get to work with both PCI-IDE and AHCI interfaces John Snow
2014-08-18 22:05 ` [Qemu-devel] [RFC 4/4] ahci: implement -cdrom and -hd[a-d] John Snow
2014-08-19  8:05 ` [Qemu-devel] [RFC 0/4] Adding -cdrom, -hd[abcd] and -drive file=... to Q35 Markus Armbruster
2014-08-19 15:56   ` John Snow
2014-08-19 18:08     ` Markus Armbruster
2014-08-19 18:59       ` John Snow
2014-08-20  7:22         ` Markus Armbruster
2014-08-19 16:12 ` Dr. David Alan Gilbert
2014-08-19 16:31   ` John Snow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).