I use the code below:

import libvirt
auth = [[libvirt.VIR_CRED_AUTHNAME,libvirt.VIR_CRED_NOECHOPROMPT],'root',None]
conn = libvirt.openAuth("qemu:///system",auth,0)
with open("/root/cflinux.xml") as f:
     xml=f.read()
domain = conn.defineXML(xml)
domain.createWithFlags(0)


and report the error:

libvir: Security Labeling error : internal error cannot load AppArmor profile 'libvirt-f0655289-318d-4aa7-b87a-6ce7cdead4ee'
Traceback (most recent call last):
  File "a.py", line 7, in <module>
    domain.createWithFlags(0)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 581, in createWithFlags
    if ret == -1: raise libvirtError ('virDomainCreateWithFlags() failed', dom=self)
libvirt.libvirtError: internal error cannot load AppArmor profile 'libvirt-f0655289-318d-4aa7-b87a-6ce7cdead4ee'


who can help me fix the error?What may cause the error?

Thanks.

--
ÓŁ±¦±¦: http://www.xuanmingyi.com