[libvirt] [PATCH] conf: Fix check for chardev source path
Andrea Bolognani
abologna at redhat.com
Fri Sep 7 15:15:12 UTC 2018
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
More information about the libvir-list
mailing list