[libvirt] [PATCH 3/3] Convert remainder of cgroups code to report errors

Eric Blake eblake at redhat.com
Fri Jul 19 15:51:03 UTC 2013


On 07/19/2013 08:54 AM, Daniel P. Berrange wrote:

>>>         rc = virCgroupAddTask(cgroup_vcpu, priv->vcpupids[i]);
>>>         if (rc < 0) {
>>>             virReportSystemError(-rc,
>>>                                  _("unable to add vcpu %zu task %d to
>>> cgroup"),
>>>                                  i, priv->vcpupids[i]);
>>>             goto cleanup;
>>>         }
>>>
>>> I didn't look elsewhere; all I needed was one counterexample to state
>>> your patch is incomplete until you audit all callers impacted by
>>> semantic changes.
>>
>> Fixed those.
> 
> This time with the diff attached.

> +++ b/src/qemu/qemu_cgroup.c

Still incomplete - you fixed virCgroupAddTask callers, but didn't audit
for others.  At least in this file, we have:

                rc = virCgroupAllowDevicePath(priv->cgroup, path,
                                              VIR_CGROUP_DEVICE_RW);
                virDomainAuditCgroupPath(vm, priv->cgroup,
                                         "allow", path, "rw", rc);
                if (rc < 0) {
                    virReportSystemError(-rc,
                                         _("Unable to allow access "
                                           "for device path %s"),
                                         path);

virDomainAuditCgroupPath() doesn't care if rc is -1 or -errno, but the
semantics of virCgroupAllowDevicePath changed, and the error message is
now wrong.

What you have looks okay to squash in, but I'm still worried that we
have more to scrub.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130719/5fc95b56/attachment-0001.sig>


More information about the libvir-list mailing list