mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
Libvirt provides a portable, long term stable C API for managing the
virtualization technologies provided by many operating systems. It
includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware
vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER
Hypervisor.
b670a41206
When the <driver> element (and its "name" attribute) was added to the domain XML's interface element, a "backend" enum was simply added to the toplevel of the virDomainNetDef struct. Ignoring the naming inconsistency ("name" vs. "backend"), this is fine when there's only a single item contained in the driver element of the XML, but doesn't scale well as we add more attributes that apply to the backend of the virtio-net driver, or add attributes applicable to other drivers. This patch changes virDomainNetDef in two ways: 1) Rename the item in the struct from "backend" to "name", so that it's the same in the XML and in the struct, hopefully avoiding confusion for someone unfamiliar with the function of the attribute. 2) Create a "driver" union within virDomainNetDef, and a "virtio" struct in that struct, which contains the "name" enum value. 3) Move around the virDomainNetParse and virDomainNetFormat functions to allow for simple plugin of new attributes without disturbing existing code. (you'll note that this results in a seemingly redundant if() in the format function, but that will no longer be the case as soon as a 2nd attribute is added). In the future, new attributes for the virtio driver backend can be added to the "virtio" struct, and any other network device backend that needs an attribute will have its own struct added to the "driver" union. |
||
---|---|---|
.gnulib@ecb020f2b0 | ||
daemon | ||
docs | ||
examples | ||
include | ||
m4 | ||
po | ||
python | ||
src | ||
tests | ||
tools | ||
.dir-locals.el | ||
.gitignore | ||
.gitmodules | ||
.mailmap | ||
.x-sc_avoid_ctype_macros | ||
.x-sc_avoid_if_before_free | ||
.x-sc_avoid_write | ||
.x-sc_bindtextdomain | ||
.x-sc_m4_quote_check | ||
.x-sc_po_check | ||
.x-sc_prohibit_always_true_header_tests | ||
.x-sc_prohibit_asprintf | ||
.x-sc_prohibit_close | ||
.x-sc_prohibit_empty_lines_at_EOF | ||
.x-sc_prohibit_fork_wrappers | ||
.x-sc_prohibit_gethostby | ||
.x-sc_prohibit_gethostname | ||
.x-sc_prohibit_gettext_noop | ||
.x-sc_prohibit_have_config_h | ||
.x-sc_prohibit_HAVE_MBRTOWC | ||
.x-sc_prohibit_nonreentrant | ||
.x-sc_prohibit_readlink | ||
.x-sc_prohibit_sprintf | ||
.x-sc_prohibit_strncpy | ||
.x-sc_prohibit_test_minus_ao | ||
.x-sc_prohibit_VIR_ERR_NO_MEMORY | ||
.x-sc_prohibit_xmlGetProp | ||
.x-sc_require_config_h | ||
.x-sc_require_config_h_first | ||
.x-sc_trailing_blank | ||
.x-sc_unmarked_diagnostics | ||
acinclude.m4 | ||
AUTHORS | ||
autobuild.sh | ||
autogen.sh | ||
bootstrap | ||
bootstrap.conf | ||
cfg.mk | ||
ChangeLog-old | ||
configure.ac | ||
COPYING.LIB | ||
HACKING | ||
libvirt.pc.in | ||
libvirt.spec.in | ||
Makefile.am | ||
Makefile.nonreentrant | ||
mingw32-libvirt.spec.in | ||
README | ||
README-hacking | ||
TODO |
LibVirt : simple API for virtualization Libvirt is a C toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes). It is free software available under the GNU Lesser General Public License. Virtualization of the Linux Operating System means the ability to run multiple instances of Operating Systems concurrently on a single hardware system where the basic resources are driven by a Linux instance. The library aim at providing long term stable C API initially for the Xen paravirtualization but should be able to integrate other virtualization mechanisms if needed. Daniel Veillard <veillard@redhat.com>