All of lore.kernel.org
 help / color / mirror / Atom feed
* vhost-user deconnection bug
@ 2015-02-26 15:28 Benoît Canet
  0 siblings, 0 replies; only message in thread
From: Benoît Canet @ 2015-02-26 15:28 UTC (permalink / raw)
  To: huawei.xie-ral2JQCrhuEAvxtiuMwx3w


Hi Xie,

I connected a QEMU from git master with the vhost-user from git master
and noticed the following bug.

In the following code:

void                                                                            
user_destroy_device(struct vhost_device_ctx ctx)                                
{                                                                               
        struct virtio_net *dev = get_device(ctx);                               
                                                                                
        if (dev && (dev->flags & VIRTIO_DEV_RUNNING))                         
                notify_ops->destroy_device(dev);                                
                                                                                
        if (dev && dev->mem) {                                                  
                free_mem_region(dev);                                           
                free(dev->mem);                                                 
                dev->mem = NULL;                                                
        }                                                                       
}

The if (dev && (dev->flags & VIRTIO_DEV_RUNNING)) is evaluated false
and notify_ops->destroy_device(dev); is not called when QEMU terminate
and provocate the deconnexion.

As a consequence any piece of code busy polling or bursting on
the vhost-user device will segfault since it will not be notified
of the deconnexion.

By the way VIRTIO_DEV_RUNNING does not seem to be set anywhere.

Best regards

Benoît                      

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-26 15:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-26 15:28 vhost-user deconnection bug Benoît Canet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.