Difference between revisions of "BiteSizedTasks"

From Libvirt Wiki
Jump to: navigation, search
(Move validation checks out of domain XML parsing)
 
Line 1: Line 1:
 
This page tracks introductory tasks for new libvirt contributors. Code cleanups, bugs, and small features are listed with difficulty ranging from trivial to intermediate.
 
This page tracks introductory tasks for new libvirt contributors. Code cleanups, bugs, and small features are listed with difficulty ranging from trivial to intermediate.
 
 
== Beginner tasks ==
 
  
 
These tasks are good first introductions to libvirt code. You will be required to get things building and make sure the test suite passes, but not necessarily need to understand the details of what libvirt is doing. Mostly these are following existing example changes that are already in the code. Contact the listed mentor with any questions
 
These tasks are good first introductions to libvirt code. You will be required to get things building and make sure the test suite passes, but not necessarily need to understand the details of what libvirt is doing. Mostly these are following existing example changes that are already in the code. Contact the listed mentor with any questions
  
== Slightly-less-beginner tasks ==
+
These tasks are all tracked as [https://gitlab.com/libvirt/libvirt/-/issues?label_name=bitesizedtask issues with the bitesizedtask tag]
 
 
These tasks are slightly more involved than the beginner tasks, but still don't require extensive libvirt knowledge. If any of the beginner tasks seem too simple, maybe try one of these. Talk with the listed mentor if you have questions.
 
 
 
=== Move default Input bus logic to PostParse handling ===
 
 
 
Mentor: Cole Robinson <crobinso@redhat.com>
 
 
 
Similar to what was started with default video model logic in these commits:
 
 
 
* https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=a2ca7ca52eb624883ac5a7e1d5deebb43981a410
 
* https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=29a90f071dd7c1764f82c7fcbfdded35d252b174
 
* https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=ef08a545388f388b7c76b99a3f3d2584daf05145
 
 
 
Break out the default bus setting logic from <code>virDomainInputDefParseXML</code> and move it to PostParse handling. Look for anything that sets a def->bus value in that function, it's grounds for removal
 
 
 
=== Add additional virsh command line completion functions ===
 
 
 
Mentor: Michal Privoznik <mprivozn@redhat.com>
 
 
 
Completers are small functions that are called from the virsh command line tool whenever the user started typing something and hit TAB TAB. Their purpose is to offer list of strings that suit entered input. If there is only one item on the list then it's entered in automatically. For instance:
 
 
 
<pre>virsh # dom<TAB><TAB>
 
domblkerror        domblkstat          domcontrol          domfsinfo ..
 
 
 
virsh # start --domain <TAB><TAB>
 
fedora      fedora.i686  freebsd      gentoo ...</pre>
 
 
 
Additional functions are needed to improve other commands.
 
 
 
An example patch:
 
* https://www.redhat.com/archives/libvir-list/2018-June/msg01672.html
 
A series of example patches:
 
* https://www.redhat.com/archives/libvir-list/2018-January/msg00436.html
 
 
 
== Bugs and feature requests from bugzilla (LibvirtFirstBug) ==
 
 
 
Some bugs in the libvirt bugzilla tracker are marked as good introductory bug reports or features for new contributors. These bugs have the 'LibvirtFirstBug' tag. Each bug report contains info and sample commits to point you in the right direction. You can open the list in your browser bugzilla [https://bugzilla.redhat.com/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=POST&bug_status=MODIFIED&classification=Community&f1=status_whiteboard&f2=component&list_id=4807856&o1=substring&o2=anywordssubstr&product=Virtualization%20Tools&query_format=advanced&v1=LibvirtFirstBug&v2=libvirt here].
 
 
 
<rss templatename="Template:RSSBugzillaTemplate" max=500>https://bugzilla.redhat.com/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=POST&bug_status=MODIFIED&classification=Community&f1=status_whiteboard&f2=component&list_id=4999130&o1=substring&o2=anywordssubstr&order=bug_id&product=Virtualization%20Tools&query_based_on=&query_format=advanced&v1=LibvirtFirstBug&v2=libvirt&ctype=atom</rss>
 
 
 
== Ongoing code transitions ==
 
 
 
=== GLib replacements ===
 
 
 
In 2019 libvirt began using GLib internally. We can use GLib APIs to drop some libvirt-specific code.
 
 
 
==== Path functions ====
 
 
 
Functions in <code>virfile.c</code> related to path handling can be replaced with [https://developer.gnome.org/glib/stable/glib-Miscellaneous-Utility-Functions.html g_path_* APIs]. The callers should be made to invoke the GLib APIS directly.
 
 
 
==== XAttr / ACLs ====
 
 
 
Replace <code>virfile.c</code> XAttr and ACL handling with [https://developer.gnome.org/gio/stable/gio-GFileAttribute.html GFileAttribute APIs]
 
 
 
==== Threads ====
 
 
 
The callers of the various <code>virMutex</code>, <code>virThread</code>, <code>virCond</code>, <code>virOnce</code>, etc APIs should be switched to use the GLib threading APIs.
 
 
 
=== g_autofree and g_autoptr usage ===
 
 
 
<code>g_autofree</code> is a feature provided by GLib and the C compiler which will free a variable when it goes out of scope.
 
<code>g_autoptr</code> works similarly, but it will call a custom registred <code>free</code> function instead.
 
 
 
We are slowly converting the code to use these new patterns. Any variable that is allocated and free'd within a single function can likely be converted to use <code>g_autofree</code> or <code>g_autoptr</code>. Similarly, any usage of <code>VIR_FREE</code> under a <code>cleanup:</code> can likely be converted.
 
 
 
* [https://www.redhat.com/archives/libvir-list/2019-October/msg01081.html Example series of g_autofree cleanups]
 
* [https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=ac89b0549ea9f3c75f2df8571f77bd39d8094dea Example registering a g_autoptr function]
 
* [https://www.redhat.com/archives/libvir-list/2019-October/msg01464.html Example g_autoptr code coversions]
 
 
 
=== virObject to GObject conversions ===
 
 
 
Our internal <code>virObject</code> implementation can be relatively easily replaced with GLib's <code>GObject</code>.
 
 
 
* Find <code>virObject</code> users by running: <code>git grep 'virObject parent'</code>
 
* Example conversion commit: https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=16121a88a7ef933220bcf9eff6575367278a06f7;hp=b74a95d6a2950a7b9168d772b49e07a5d20a3f63
 

Latest revision as of 15:17, 17 April 2020

This page tracks introductory tasks for new libvirt contributors. Code cleanups, bugs, and small features are listed with difficulty ranging from trivial to intermediate.

These tasks are good first introductions to libvirt code. You will be required to get things building and make sure the test suite passes, but not necessarily need to understand the details of what libvirt is doing. Mostly these are following existing example changes that are already in the code. Contact the listed mentor with any questions

These tasks are all tracked as issues with the bitesizedtask tag