[libvirt] [PATCH 02/12] qemu: caps: Tweak arm conditional in SupportsChardev
Andrea Bolognani
abologna at redhat.com
Fri Jul 7 11:18:26 UTC 2017
On Mon, 2017-06-26 at 14:01 -0400, Cole Robinson wrote:
> @@ -5568,17 +5568,22 @@ virQEMUCapsSupportsChardev(const virDomainDef *def,
> if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
> chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO)
> return false;
> + return true;
This is unnecessary, since the last statement causes the
function to return 'true' in any case.
> }
>
> - if ((def->os.arch != VIR_ARCH_ARMV7L) && (def->os.arch != VIR_ARCH_AARCH64))
> + if ((def->os.arch == VIR_ARCH_ARMV7L) ||
> + (def->os.arch == VIR_ARCH_AARCH64)) {
You can keep the condition on a single line, and drop
the pointless parentheses while you're at it.
> + /* TARGET_TYPE_ISA here really means 'the default', which we
> + treat as whatever the built in platform serial device is on.
> + And for platform devices we can't use -chardev */
Very minor thing, but usually all lines in a multi-line
comments start with an asterisk.
> + if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
> + chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA)
> + return false;
> +
> return true;
This return statement can be left out like the one I
commented on above.
Reviewed-by: Andrea Bolognani <abologna at redhat.com>
--
Andrea Bolognani / Red Hat / Virtualization
More information about the libvir-list
mailing list