Re: [PATCHv2 3/5] S390: QEMU driver support for CCW addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]