libvirt/src/qemu
Laine Stump c27b0bb171 qemu: fix handling of default/implicit devices for q35
This patch adds in special handling for a few devices that need to be
treated differently for q35 domains:

usb - there is no implicit/default usb controller for the q35
machinetype. This is done because normally the default usb controller
is added to a domain by just adding "-usb" to the qemu commandline,
and it's assumed that this will add a single piix3 usb1 controller at
slot 1 function 2. That's not what happens when the machinetype is
q35, though. Instead, adding -usb to the commandline adds 3 usb
(version 2) controllers to the domain at slot 0x1D.{1,2,7}. Rather
than having

  <controller type='usb' index='0'/>

translate into 3 separate devices on the PCI bus, it's cleaner to not
automatically add a default usb device; one can always be added
explicitly if desired. Or we may decide that on q35 machines, 3 usb
controllers will be automatically added when none is given. But for
this initial commit, at least we aren't locking ourselves into
something we later won't want.

video - qemu always initializes the primary video device immediately
after any integrated devices for the machinetype. Unless instructed
otherwise (by using "-device vga..." instead of "-vga" which libvirt
uses in many cases to work around deficiencies and bugs in various
qemu versions) qemu will always pick the first unused slot. In the
case of the "pc" machinetype and its derivatives, this is always slot
2, but on q35 machinetypes, the first free slot is slot 1 (since the
q35's integrated peripheral devices are placed in other slots,
e.g. slot 0x1f). In order to make the PCI address of the video device
predictable, that slot (1 or 2, depending on machinetype) is reserved
even when no video device has been specified.

sata - a q35 machine always has a sata controller implicitly added at
slot 0x1F, function 2. There is no way to avoid this controller, so we
always add it. Note that the xml2xml tests for the pcie-root and q35
cases were changed to use DO_TEST_DIFFERENT() so that we can check for
the sata controller being automatically added. This is especially
important because we can't check for it in the xml2argv output (it has
no effect on that output since it's an implicit device).

ide - q35 has no ide controllers.

isa and smbus controllers - these two are always present in a q35 (at
slot 0x1F functions 0 and 3) but we have no way of modelling them in
our config. We do need to reserve those functions so that the user
doesn't attempt to put anything else there though. (note that the "pc"
machine type also has an ISA controller, which we also ignore).
2013-08-05 15:47:49 -04:00
..
libvirtd_qemu.aug qemu: Add VNC WebSocket support 2013-05-15 09:48:05 +02:00
MIGRATION.txt qemu: Implement migration job phases 2011-07-27 08:45:09 -06:00
qemu_agent.c qemu_agent: Remove obvious comments 2013-07-31 14:25:43 +02:00
qemu_agent.h qemu_agent: Move updater function for VCPU hotplug into qemu_agent.c 2013-07-31 14:25:43 +02:00
qemu_bridge_filter.c virutil: Move string related functions to virstring.c 2013-05-02 16:56:55 +02:00
qemu_bridge_filter.h Replace 'struct qemud_driver *' with virQEMUDriverPtr 2012-11-28 18:17:25 +00:00
qemu_capabilities.c qemu: add dmi-to-pci-bridge controller 2013-08-05 15:40:49 -04:00
qemu_capabilities.h qemu: add dmi-to-pci-bridge controller 2013-08-05 15:40:49 -04:00
qemu_cgroup.c Fix crashing upgrading from older libvirts with running guests 2013-08-02 15:32:26 +01:00
qemu_cgroup.h Auto-detect existing cgroup placement 2013-07-23 22:46:31 +01:00
qemu_command.c qemu: fix handling of default/implicit devices for q35 2013-08-05 15:47:49 -04:00
qemu_command.h qemu: add pcie-root controller 2013-08-05 15:13:56 -04:00
qemu_conf.c Don't overwrite errors in qemuTranslateDiskSourcePool 2013-07-25 13:12:22 +02:00
qemu_conf.h qemu: Move close callbacks handling into util/virclosecallbacks.c 2013-07-18 14:16:53 +02:00
qemu_domain.c qemu: fix handling of default/implicit devices for q35 2013-08-05 15:47:49 -04:00
qemu_domain.h qemu: add helper functions for diskchain checking 2013-08-01 13:26:27 +08:00
qemu_driver.c qemu_agent: Move updater function for VCPU hotplug into qemu_agent.c 2013-07-31 14:25:43 +02:00
qemu_driver.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
qemu_hostdev.c pci: make virPCIDeviceReset more autonomous 2013-07-15 10:43:03 -04:00
qemu_hostdev.h qemu: Introduce activeScsiHostdevs list for scsi host devices 2013-05-13 21:26:06 +08:00
qemu_hotplug.c qemu: Emit VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED events 2013-07-18 15:28:45 +02:00
qemu_hotplug.h qemu: Remove devices only after DEVICE_DELETED event 2013-07-18 15:28:45 +02:00
qemu_migration.c Convert remainder of cgroups code to report errors 2013-07-22 13:09:58 +01:00
qemu_migration.h qemu: Move close callbacks handling into util/virclosecallbacks.c 2013-07-18 14:16:53 +02:00
qemu_monitor_json.c qemu: Introduce qemuMonitorGetDeviceAliases 2013-07-19 18:45:47 +02:00
qemu_monitor_json.h qemu: Introduce qemuMonitorGetDeviceAliases 2013-07-19 18:45:47 +02:00
qemu_monitor_text.c Convert 'int i' to 'size_t i' in src/qemu files 2013-07-10 17:55:15 +01:00
qemu_monitor_text.h qemu: Use bool instead of int in qemuMonitorSetCPU APIs 2013-06-07 15:57:03 +02:00
qemu_monitor.c Rename VIR_DOMAIN_PAUSED_GUEST_PANICKED to VIR_DOMAIN_PAUSED_CRASHED 2013-07-29 18:08:55 +01:00
qemu_monitor.h qemu: Introduce qemuMonitorGetDeviceAliases 2013-07-19 18:45:47 +02:00
qemu_process.c qemu: check presence of each disk and its backing file as well 2013-08-01 13:26:47 +08:00
qemu_process.h qemu: expose qemuProcessShutdownOrReboot() 2013-07-02 12:02:27 -06:00
qemu.conf qemu: Add VNC WebSocket support 2013-05-15 09:48:05 +02:00
test_libvirtd_qemu.aug.in qemu: Add VNC WebSocket support 2013-05-15 09:48:05 +02:00
THREADS.txt Remove qemuDriverLock from almost everywhere 2013-02-13 11:10:30 +00:00