Public bug reported:

Forked from bug 1815910 as it is a different kind of problem and also a
different fix.

FYI: this works just fine when defined at the time the guest starts.
libvirt mediates the access and passes an FD that at the time qemu can open and 
use.
Only later on when hot-plugging this occurs.

#1 prepare a scsi device to pass
$ sudo modprobe vhost-scsi
$ sudo targetcli backstores/block create name=disk1 
dev=/dev/disk/by-path/ccw-0.0.e000-fc-0x50050763060b16b6-lun-0x4024400a00000000
$ sudo targetcli vhost/ create 50014059de6fba4f
$ sudo targetcli vhost/naa.50014059de6fba4f/tpg1/luns create 
/backstores/block/disk1

#2 describe the device to attach for libvirt
$ cat vhost-scsi.xml
    <hostdev mode='subsystem' type='scsi_host' managed='no'>
      <source protocol='vhost' wwpn='naa.50014059de6fba4f'/>
    </hostdev>

#3 do the hotplug
$ virsh attach-device disco-vhost vhost-scsi.xml
error: Failed to attach device from vhost-scsi.xml
error: internal error: cannot update AppArmor profile 
'libvirt-9518e35c-c5ab-4d14-9204-003923544936'

When debugging this we see as expected triggers an error in virt-aa-helper:
/usr/lib/libvirt/virt-aa-helper -r -u 
libvirt-9518e35c-c5ab-4d14-9204-003923544936 -F 
/sys/kernel/config/target/vhost//naa.50014059de6fba4f
unexpected exit status 1
  virt-aa-helper: error: /sys/kernel/config/target/vhost//naa.50014059de6fba4f
  virt-aa-helper: error: skipped restricted file
  virt-aa-helper: error: invalid VM definition

** Affects: libvirt (Ubuntu)
     Importance: Undecided
         Status: Triaged

** Changed in: libvirt (Ubuntu)
       Status: New => Triaged

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1829223

Title:
  vhost-scsi triggers virt-aa-helper error

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1829223/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to