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.
Go to file
Daniel P. Berrangé 7cb03e6a28 rpc: fix race in waking up client event loop
The first thread to issue a client RPC request will own the event
loop execution, sitting in the virNetClientIOEventLoop function.

It releases the client lock while running:

   virNetClientUnlock()
   g_main_loop_run()
   virNetClientLock()

If a second thread arrives with an RPC request, it will queue it
for the first thread to process. To inform the first thread that
there's a new request it calls g_main_loop_quit() to break it out
of the main loop.

This works if the first thread is in g_main_loop_run() at that
time. There is a small window of opportunity, however, where
the first thread has released the client lock, but not yet got
into g_main_loop_run(). If that happens, the wakeup from the
second thread is lost.

This patch deals with that by changing the way the wakeup is
performed. Instead of directly calling g_main_loop_quit(), the
second thread creates an idle source to run the quit function
from within the first thread. This guarantees that the first
thread will see the wakeup.

Tested by: Fima Shevrin <efim.shevrin@virtuozzo.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-01-09 11:58:41 +00:00
.ctags.d
.github/workflows
.gitlab/issue_templates
build-aux syntax-check: Forbid use of qsort() 2023-11-24 09:53:14 +01:00
ci ci: Add notes for integration jobs 2024-01-09 09:45:49 +01:00
docs conf: Add possibility to configure multiple iothreads per disk 2024-01-08 09:27:31 +01:00
examples examples: Fix printf format string in event-test.c 2023-10-20 10:22:34 +02:00
include virDomainBlockResize: Introduce VIR_DOMAIN_BLOCK_RESIZE_CAPACITY 2023-12-14 16:09:05 +01:00
po po: Refresh potfile for v10.0.0 2024-01-09 12:07:20 +01:00
scripts rpcgen: Skip generator tests on macOS 2023-12-01 13:50:19 +01:00
src rpc: fix race in waking up client event loop 2024-01-09 11:58:41 +00:00
subprojects Move src/keycodemapdb -> subprojects/keycodemapdb 2023-04-17 15:02:38 +02:00
tests tests: Add capabilities for QEMU 8.2.0 on aarch64 2024-01-09 09:36:52 +01:00
tools conf: move/rename hostdev PCI driver type enum to device_conf.h 2024-01-07 23:57:09 -05:00
.ctags
.dir-locals.el
.editorconfig
.gitattributes
.gitignore
.gitlab-ci.yml ci: Build RPMs on MinGW 2023-11-23 18:32:03 +01:00
.gitmodules Move src/keycodemapdb -> subprojects/keycodemapdb 2023-04-17 15:02:38 +02:00
.gitpublish gitpublish: Tweak prefix 2023-12-05 11:48:28 +01:00
.mailmap
AUTHORS.rst.in
config.h
configmake.h.in
CONTRIBUTING.rst
COPYING
COPYING.LESSER
gitdm.config
libvirt-admin.pc.in
libvirt-lxc.pc.in
libvirt-qemu.pc.in
libvirt.pc.in
libvirt.spec.in libvirt.spec: Fix nbdkit selection logic on mingw and old rhel 2024-01-05 11:08:41 +01:00
meson_options.txt qemu: add runtime config option for nbdkit 2024-01-04 14:34:40 -06:00
meson.build qemu: add runtime config option for nbdkit 2024-01-04 14:34:40 -06:00
NEWS.rst NEWS: Mention postcopy-preempt migration capability 2024-01-08 22:51:57 +01:00
README.rst docs: update docs pointing to old mailing list addrs 2023-10-31 10:04:27 +00:00
run.in run: add ability to set selinux context 2023-08-23 14:22:36 -05:00

GitLab CI Build Status

CII Best Practices

Translation status

Libvirt API for virtualization

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.

For some of these hypervisors, it provides a stateful management daemon which runs on the virtualization host allowing access to the API both by non-privileged local users and remote users.

Layered packages provide bindings of the libvirt C API into other languages including Python, Perl, PHP, Go, Java, OCaml, as well as mappings into object systems such as GObject, CIM and SNMP.

Further information about the libvirt project can be found on the website:

https://libvirt.org

License

The libvirt C API is distributed under the terms of GNU Lesser General Public License, version 2.1 (or later). Some parts of the code that are not part of the C library may have the more restrictive GNU General Public License, version 2.0 (or later). See the files COPYING.LESSER and COPYING for full license terms & conditions.

Installation

Instructions on building and installing libvirt can be found on the website:

https://libvirt.org/compiling.html

Contributing

The libvirt project welcomes contributions in many ways. For most components the best way to contribute is to send patches to the primary development mailing list. Further guidance on this can be found on the website:

https://libvirt.org/contribute.html

Contact

The libvirt project has two primary mailing lists:

Further details on contacting the project are available on the website:

https://libvirt.org/contact.html