Re: [PATCH] conf: Fix check for chardev source path

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

 



On Fri, 2018-09-07 at 17:03 +0200, Ján Tomko wrote:
> On Fri, Sep 07, 2018 at 01:06:39PM +0200, Andrea Bolognani wrote:
> >         if (!def->data.nix.path &&
> >             (!chr_def ||
> > +             chr_def->deviceType != VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL ||
> > +             (chr_def->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
> > +              chr_def->targetType != VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_XEN &&
> >               chr_def->targetType != VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO))) {
> 
> Consider:
>             !(chr_def &&
>               chr_def->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
>               (chr_def->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_XEN ||
>                chr_def->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO))) {

Both make my brain hurt, but yours is a bit shorter so I guess
I'll go with that one :)

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