To clarify my earlier reply - my point is that in the following
method:
On Fri, Feb 08, 2013 at 06:32:22PM +0100, Viktor Mihajlovski wrote:
+/*
+ * Three steps populating CCW devnos
+ * 1. Allocate empty address set
+ * 2. Gather addresses with explicit devno
+ * 3. Assign defaults to the rest
+ */
+static int
+qemuDomainAssignS390Addresses(virDomainDefPtr def,
+ virQEMUCapsPtr qemuCaps,
+ virDomainObjPtr obj)
+{
+ int ret = -1;
+ qemuDomainCCWAddressSetPtr addrs = NULL;
+ qemuDomainObjPrivatePtr priv = NULL;
+
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW)) {
change this to
if (STREQ(def->os.machine), "virtio-s390-ccw") {
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("This QEMU does not support CCW addressing"));
}
... assign CCW based addresses ...
}
+ } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_S390)) {
+ /* deal with legacy virtio-s390 */
qemuDomainPrimeS390VirtioDevices(
def, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390);
+ }
+
This avoids need to pass machine type into the capabilities APIs at all.
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|