[libvirt] [PATCH 2/3] qemu: Fix specifying char devs for PPC

Ján Tomko jtomko at redhat.com
Mon May 26 11:37:18 UTC 2014


On 05/22/2014 12:55 PM, Olivia Yin wrote:
> QEMU ppce500 board uses the old style -serial options.
> 
> Other PPC boards don't give any way to explicitly wire in a -chardev
> except pseries which uses -device spapr-vty with -chardev.
> ---
>  src/qemu/qemu_capabilities.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 

I think this would be easier to read as:

if (arch == ARM) {
   /* arm-specific code */
} else if (arch == PPC) {
   /* ppc-specific code */
}

return true;

> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 03d8842..1cc37ad 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -3466,13 +3466,17 @@ virQEMUCapsSupportsChardev(virDomainDefPtr def,
>          !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE))
>          return false;
>  
> -    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)
> +         && (def->os.arch != VIR_ARCH_PPC) && (def->os.arch != VIR_ARCH_PPC64))
>          return true;
>  
>      /* This may not be true for all ARM machine types, but at least
>       * the only supported non-virtio serial devices of vexpress and versatile
> -     * don't have the -chardev property wired up. */
> +     * don't have the -chardev property wired up.
> +     * For PPC machines, only pseries need -device spapr-vty with -chardev */
>      return (chr->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO ||
>              (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE &&
> -             chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO));
> +             chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO) ||
> +            (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
> +             chr->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO));
>  }
> 

Jan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140526/22fe84c7/attachment-0001.sig>


More information about the libvir-list mailing list