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

2014-05-26 Thread Ján Tomko
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



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

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

2014-05-26 Thread hong-hua....@freescale.com
Hi Jan,

Thanks for comments. Could you please help review the v2 patches?

Best Regards,
Olivia

 -Original Message-
 From: Ján Tomko [mailto:jto...@redhat.com]
 Sent: Monday, May 26, 2014 7:37 PM
 To: Yin Olivia-R63875; libvir-list@redhat.com
 Subject: Re: [libvirt] [PATCH 2/3] qemu: Fix specifying char devs for PPC
 
 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


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


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

2014-05-22 Thread Olivia Yin
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(-)

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));
 }
-- 
1.8.5

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


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

2014-05-22 Thread Eric Blake
[meta-comment]

On 05/22/2014 04:55 AM, Olivia Yin wrote:

Your message came with deep threading (each message in the series in
reply to the previous).  Observe what happens to replies which are
threaded as typical in most mail clients (all replies to a given message
sorted by time received) - the replies get interleaved to the wrong patch:

0
+ 1
| + 2
| + Re: 1
|   + 3
|   + Re: 2
| + Re: 3
+ Re: 0

whereas we usually prefer shallow threading (the git send-email default,
each message in the series in reply only to the cover letter).  This
time, the replies are easier to spot:

0
+ 1
| + Re: 1
+ 2
| + Re: 2
+ 3
| + Re: 3
Re: 0

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

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

2014-05-22 Thread Eric Blake
[reposting to the list with permission]

On 05/22/2014 06:37 PM, hong-hua@freescale.com wrote:
 Hi Eric,
 
 Thanks for your comments.
 I also prefer the second reply threading.
  
 Exactly I use git send-email to post patches to this mailing list.
 $ git send-email -cover-letter.patch 
 0001-change-machine-name-ppce500v2-as-ppce500.patch 
 0002-qemu-Fix-specifying-char-devs-for-PPC.patch 
 0003-tests-add-test-case-for-serial-option-for-ppce500.patch 
 --to=libvir-list@redhat.com
 
 
 $ git config --global -l
 sendemail.smtpserver=remotesmtp.freescale.net
 sendemail.chainreplyto=true

This is the culprit.  Per 'git send-email --help', the git default of
sendemail.chainreplyto=false gives the style we prefer.

 sendemail.confirm=auto
 
 Is there any configuration for git to follow up?

Depends on whether you want to change the settings for all repositories
on your computer (~/.gitconfig, or 'git config --global') or just for
your copy of libvirt.git (libvirt/.git/config, or plain 'git config').

We also tend to avoid top-posting on the list.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list