<div dir="ltr">I found the root cause myself.<div>The reason is that libvirt cgroup layout is changed after 1.0.5. So the new volume device is not added to running QEMU instances' devices.allow.</div><div><br></div><div>Then new question is that is there any libvirt parameter to make the device cgroup backwards compatible?</div><div><br></div><div><br></div><div><a href="https://libvirt.org/cgroups.html">https://libvirt.org/cgroups.html</a>.<br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 14, 2015 at 10:30 PM, Chengyuan Li <span dir="ltr"><<a href="mailto:chengyuanli@gmail.com" target="_blank">chengyuanli@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>My nova-compute nodes was running libvirt 0.9.13 and QEMU 1.0, after libvirt was upgraded to 1.2.2, the VMs launched by libvirt 0.9.13 can't attach volume any more, i.e. "nova volume-attach <vm-uuid> <volume-uuid>" doesn't work. But before the libvirt upgrade, the same VM can attach volume disk.</div><div><br></div><div>I did some debuging and find that, it failed in QEMU when try to open the volume device, and the return errno is EPERM. QEMU instances is running as user libvirt-qemu always, so is that possible some problem in Linux capabilites or libvirt apparmor?</div><div><br></div><div><br></div><div><br></div><div>-------------------------------------</div><div><div>int qemu_open(const char *name, int flags, ...)</div><div>{</div><div>    int ret;</div><div>    int mode = 0;</div><div>    long euid, egid;</div><div><br></div><div>    if (flags & O_CREAT) {</div><div>        va_list ap;</div><div><br></div><div>        va_start(ap, flags);</div><div>        mode = va_arg(ap, int);</div><div>        va_end(ap);</div><div>    }</div><div><br></div><div>    euid = (long)geteuid();</div><div>    egid = (long)getegid();</div><div>#ifdef O_CLOEXEC</div><div>    ret = open(name, flags | O_CLOEXEC, mode);<br></div><div>#else</div><div>    ret = open(name, flags, mode);<br></div><div>    if (ret >= 0) {</div><div>        qemu_set_cloexec(ret);</div><div>    }</div><div>#endif</div><div><br></div><div>    return ret;</div><div>}</div></div><div><br></div><div><br></div><div>Regards,</div><div>CY.</div></div>
</blockquote></div><br></div>