Writing cleanup code for every variable in large-scale open-source projects makes the code difficult to comprehend. The cleanup tasks like releasing resources are necessary and without them, there may be leaks. GNU C provides a variable attribute cleanup that runs a specified function automatically when the associated variable goes out of scope. The aim of this project is to incorporate this cleanup functionality into the libvirt code base. Another aspect of this project will be to ensure that adding this functionality does not change the intended behaviour of the code. The deliverable will be an integration of cleanup code into the libvirt code base which does not interfere with the main logic, making the code more concise and comprehensible while maintaining intended functionality.



Sukrit Bhatnagar


  • Pavel Hrdina
  • Erik Skultety