Re: [PATCH v2 23/25] qemu: Support virtio-serial controller model=virtio-{non-}transitional

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

 



On Tue, 2019-01-29 at 15:53 +0100, Andrea Bolognani wrote:
> On Wed, 2019-01-23 at 16:32 -0500, Cole Robinson wrote:
> [...]
> > @@ -525,11 +525,21 @@ qemuBuildVirtioDevStr(virBufferPtr buf,
> >              ntmodel_cap = QEMU_CAPS_DEVICE_VIRTIO_INPUT_HOST_PCI_NON_TRANSITIONAL;
> >              break;
> >  
> > +        case VIR_DOMAIN_DEVICE_CONTROLLER:
> > +            if (device.data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL) {
> > +                has_tmodel = device.data.controller->model == VIR_DOMAIN_CONTROLLER_MODEL_VIRTIO_SERIAL_VIRTIO_TRANSITIONAL;
> > +                has_ntmodel = device.data.controller->model == VIR_DOMAIN_CONTROLLER_MODEL_VIRTIO_SERIAL_VIRTIO_NON_TRANSITIONAL;
> > +                tmodel_cap = QEMU_CAPS_DEVICE_VIRTIO_SERIAL_PCI_TRANSITIONAL;
> > +                ntmodel_cap = QEMU_CAPS_DEVICE_VIRTIO_SERIAL_PCI_NON_TRANSITIONAL;
> > +            } else {
> > +                return 0;
> > +            }
> 
> Please invert this, same as for hostdevs and input devices, so that
> it looks like
> 
>   case VIR_DOMAIN_DEVICE_CONTROLLER:
>       if (device.data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL)
>           return 0;
>       ...

Oh, I see now that you add another branch in the following commit,
which of course makes the above not applicable.

You can either leave it as is or turn it into a switch statement,
the latter being my personal preference.

-- 
Andrea Bolognani / Red Hat / Virtualization

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

  Powered by Linux