Skip to content
  • Kevin Wolf's avatar
    vdpa-dev: Fix initialisation order to restore VDUSE compatibility · 2c66de61
    Kevin Wolf authored
    VDUSE requires that virtqueues are first enabled before the DRIVER_OK
    status flag is set; with the current API of the kernel module, it is
    impossible to enable the opposite order in our block export code because
    userspace is not notified when a virtqueue is enabled.
    
    This requirement also mathces the normal initialisation order as done by
    the generic vhost code in QEMU. However, commit 6c482547 accidentally
    changed the order for vdpa-dev and broke access to VDUSE devices with
    this.
    
    This changes vdpa-dev to use the normal order again and use the standard
    vhost callback .vhost_set_vring_enable for this. VDUSE devices can be
    used with vdpa-dev again after this fix.
    
    vhost_net intentionally avoided enabling the vrings for vdpa and does
    this manually later while it does enable them for other vhost backends.
    Reflect this in the vhost_net code and return early for vdpa, so that
    the behaviour doesn't change for this device.
    
    Cc: qemu-stable@nongnu...
    2c66de61