Skip to content
  • Daniil Tatianin's avatar
    8edd5673
    vhost-user-blk: dynamically resize config space based on features · 8edd5673
    Daniil Tatianin authored
    
    
    Make vhost-user-blk backwards compatible when migrating from older VMs
    running with modern features turned off, the same way it was done for
    virtio-blk in 20764be0 ("virtio-blk: set config size depending on the features enabled")
    
    It's currently impossible to migrate from an older VM with
    vhost-user-blk (with disable-legacy=off) because of errors like this:
    
    qemu-system-x86_64: get_pci_config_device: Bad config data: i=0x10 read: 41 device: 1 cmask: ff wmask: 80 w1cmask:0
    qemu-system-x86_64: Failed to load PCIDevice:config
    qemu-system-x86_64: Failed to load virtio-blk:virtio
    qemu-system-x86_64: error while loading state for instance 0x0 of device '0000:00:05.0:00.0:02.0/virtio-blk'
    qemu-system-x86_64: load of migration failed: Invalid argument
    
    This is caused by the newer (destination) VM requiring a bigger BAR0
    alignment because it has to cover a bigger configuration space, which
    isn't actually needed since those additional config fields are not
    active (write-zeroes/discard).
    
    Signed-off-by: default avatarDaniil Tatianin <d-tatianin@yandex-team.ru>
    Reviewed-by: default avatarRaphael Norwitz <raphael.norwitz@nutanix.com>
    Message-Id: <20220906073111.353245-6-d-tatianin@yandex-team.ru>
    Reviewed-by: default avatarRaphael Norwitz <raphael.norwitz@nutanix.com>
    Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    8edd5673
    vhost-user-blk: dynamically resize config space based on features
    Daniil Tatianin authored
    
    
    Make vhost-user-blk backwards compatible when migrating from older VMs
    running with modern features turned off, the same way it was done for
    virtio-blk in 20764be0 ("virtio-blk: set config size depending on the features enabled")
    
    It's currently impossible to migrate from an older VM with
    vhost-user-blk (with disable-legacy=off) because of errors like this:
    
    qemu-system-x86_64: get_pci_config_device: Bad config data: i=0x10 read: 41 device: 1 cmask: ff wmask: 80 w1cmask:0
    qemu-system-x86_64: Failed to load PCIDevice:config
    qemu-system-x86_64: Failed to load virtio-blk:virtio
    qemu-system-x86_64: error while loading state for instance 0x0 of device '0000:00:05.0:00.0:02.0/virtio-blk'
    qemu-system-x86_64: load of migration failed: Invalid argument
    
    This is caused by the newer (destination) VM requiring a bigger BAR0
    alignment because it has to cover a bigger configuration space, which
    isn't actually needed since those additional config fields are not
    active (write-zeroes/discard).
    
    Signed-off-by: default avatarDaniil Tatianin <d-tatianin@yandex-team.ru>
    Reviewed-by: default avatarRaphael Norwitz <raphael.norwitz@nutanix.com>
    Message-Id: <20220906073111.353245-6-d-tatianin@yandex-team.ru>
    Reviewed-by: default avatarRaphael Norwitz <raphael.norwitz@nutanix.com>
    Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Loading