[Qemu-devel] [PATCH v2 03/21] xen: use a better chardev type check

Marc-André Lureau posted 21 patches 8 years, 4 months ago
[Qemu-devel] [PATCH v2 03/21] xen: use a better chardev type check
Posted by Marc-André Lureau 8 years, 4 months ago
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 xen-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen-common.c b/xen-common.c
index fd2c92847e..d46685ef4e 100644
--- a/xen-common.c
+++ b/xen-common.c
@@ -34,7 +34,7 @@ static int store_dev_info(int domid, Chardev *cs, const char *string)
     int ret = -1;
 
     /* Only continue if we're talking to a pty. */
-    if (strncmp(cs->filename, "pty:", 4)) {
+    if (!CHARDEV_IS_PTY(cs)) {
         return 0;
     }
     pts = cs->filename + 4;
-- 
2.12.0.rc2.3.gc93709801


Re: [Qemu-devel] [PATCH v2 03/21] xen: use a better chardev type check
Posted by Eric Blake 8 years, 4 months ago
On 02/27/2017 07:41 AM, Marc-André Lureau wrote:
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  xen-common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/xen-common.c b/xen-common.c
> index fd2c92847e..d46685ef4e 100644
> --- a/xen-common.c
> +++ b/xen-common.c
> @@ -34,7 +34,7 @@ static int store_dev_info(int domid, Chardev *cs, const char *string)
>      int ret = -1;
>  
>      /* Only continue if we're talking to a pty. */
> -    if (strncmp(cs->filename, "pty:", 4)) {
> +    if (!CHARDEV_IS_PTY(cs)) {
>          return 0;
>      }
>      pts = cs->filename + 4;
> 

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