On 12/08/2014 03:50 AM, Peter Krempa wrote: > On 12/06/14 09:14, Eric Blake wrote: >> qemuDomainGetStatsBlock() could leak a stats hash table if it >> encountered OOM while populating the virTypedParameters. >> Oddly, the fix doesn't even touch qemuDomainGetStatsBlock :) >> + cleanup: > > With this change qemuDomainGetStatsInterface will return success even in > case when the OOM occurred. You need to add a 'ret' variable set to -1 > and set it to 0 just before cleanup, so that the error gets propagated. Oh right :) > > ACK if you keep reporting the error in OOM case in > qemuDomainGetStatsInterface() Done and pushed: diff --git i/src/qemu/qemu_driver.c w/src/qemu/qemu_driver.c index a7b208f..ed8e140 100644 --- i/src/qemu/qemu_driver.c +++ w/src/qemu/qemu_driver.c @@ -18409,6 +18409,7 @@ qemuDomainGetStatsInterface(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, { size_t i; struct _virDomainInterfaceStats tmp; + int ret = -1; if (!virDomainObjIsActive(dom)) return 0; @@ -18448,8 +18449,9 @@ qemuDomainGetStatsInterface(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, "tx.drop", tmp.tx_drop); } + ret = 0; cleanup: - return 0; + return ret; } #undef QEMU_ADD_NET_PARAM -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list