* [Qemu-devel] [PATCHv2] vhost-user: delete chardev on cleanup
@ 2017-01-24 19:02 Marc-André Lureau
2017-01-24 19:16 ` Eric Blake
0 siblings, 1 reply; 2+ messages in thread
From: Marc-André Lureau @ 2017-01-24 19:02 UTC (permalink / raw)
To: qemu-devel; +Cc: mst, Marc-André Lureau
Remove the chardev implicitely when cleaning up the netdev. This
prevents from reusing the chardev since it would be in an incorrect
state with the slave.
Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=1256618
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
net/vhost-user.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/vhost-user.c b/net/vhost-user.c
index 7aff77ee4a..179939f5c1 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -151,7 +151,10 @@ static void vhost_user_cleanup(NetClientState *nc)
s->vhost_net = NULL;
}
if (nc->queue_index == 0) {
+ CharDriverState *chr = qemu_chr_fe_get_driver(&s->chr);
+
qemu_chr_fe_deinit(&s->chr);
+ qemu_chr_delete(chr);
}
qemu_purge_queued_packets(nc);
--
2.11.0.295.gd7dffce1c
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCHv2] vhost-user: delete chardev on cleanup
2017-01-24 19:02 [Qemu-devel] [PATCHv2] vhost-user: delete chardev on cleanup Marc-André Lureau
@ 2017-01-24 19:16 ` Eric Blake
0 siblings, 0 replies; 2+ messages in thread
From: Eric Blake @ 2017-01-24 19:16 UTC (permalink / raw)
To: Marc-André Lureau, qemu-devel; +Cc: mst
[-- Attachment #1: Type: text/plain, Size: 1125 bytes --]
On 01/24/2017 01:02 PM, Marc-André Lureau wrote:
> Remove the chardev implicitely when cleaning up the netdev. This
s/implicitely/implicitly/
> prevents from reusing the chardev since it would be in an incorrect
> state with the slave.
>
> Fixes:
> https://bugzilla.redhat.com/show_bug.cgi?id=1256618
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> net/vhost-user.c | 3 +++
> 1 file changed, 3 insertions(+)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> diff --git a/net/vhost-user.c b/net/vhost-user.c
> index 7aff77ee4a..179939f5c1 100644
> --- a/net/vhost-user.c
> +++ b/net/vhost-user.c
> @@ -151,7 +151,10 @@ static void vhost_user_cleanup(NetClientState *nc)
> s->vhost_net = NULL;
> }
> if (nc->queue_index == 0) {
> + CharDriverState *chr = qemu_chr_fe_get_driver(&s->chr);
> +
> qemu_chr_fe_deinit(&s->chr);
> + qemu_chr_delete(chr);
> }
>
> qemu_purge_queued_packets(nc);
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-24 19:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-24 19:02 [Qemu-devel] [PATCHv2] vhost-user: delete chardev on cleanup Marc-André Lureau
2017-01-24 19:16 ` Eric Blake
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).