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