aboutsummaryrefslogtreecommitdiff
path: root/net/vhost-user.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-06-20 15:02:40 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2016-06-29 14:03:47 +0200
commit6f1de6b70d857d5e316ae6fd908f52818b827b08 (patch)
tree1a0c8e85a0d1046373cdad821e9dda0025046be9 /net/vhost-user.c
parentb0585e7e07982daa578c3bfef7f6843c89f110a8 (diff)
downloadqemu-6f1de6b70d857d5e316ae6fd908f52818b827b08.zip
qemu-6f1de6b70d857d5e316ae6fd908f52818b827b08.tar.gz
qemu-6f1de6b70d857d5e316ae6fd908f52818b827b08.tar.bz2
char: change qemu_chr_fe_add_watch to return unsigned
g_source_attach can return any value between 1 and UINT_MAX if you let QEMU run long enough. However, qemu_chr_fe_add_watch can also return a negative errno value when the device is disconnected or does not support chr_add_watch. Change it to return zero to avoid overloading these values. Fix the cadence_uart which asserts in this case (easily obtained with "-serial pty"). Tested-by: Bret Ketchum <bcketchum@gmail.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'net/vhost-user.c')
-rw-r--r--net/vhost-user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/vhost-user.c b/net/vhost-user.c
index d72ce9b..636899a 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -22,7 +22,7 @@ typedef struct VhostUserState {
NetClientState nc;
CharDriverState *chr;
VHostNetState *vhost_net;
- int watch;
+ guint watch;
uint64_t acked_features;
} VhostUserState;