On Thu, Aug 29, 2019 at 10:08:22PM -0500, Eric Blake wrote:
Both plugin.c and filter.c add the same three fields on top of struct backend, and use very similar code in initializing them. Let's stop the duplication, by moving those three fields into struct backend, and creating a new backend.c for manipulating them. In turn, we can drop the backend->name() accessor in favor of just directly accessing the name field. This is a net reduction in lines of code (remember, the diffstat is also counting comment additions, including license boilerplate).
Yes, a quite reasonable simplification, ACK. I might have been tempted to save the static string "plugin" or "filter" in a new backend->type field on the basis that it would help a little with debugging and costs virtually nothing, but this is not essential. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/