Re: Designing libvirt client

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/14/2013 06:17 PM, arvind viswanathan wrote:
> Hi,
> I have a VMM application using a homegrown client for communicating with
> hypervisor.
> I am planning to migrate to libvirt because of the blocking nature of the
> calls.
> After going over the architecture, I would like to have a few doubts
> clarified
> 1) Should my application be necessarily multi-threaded in order to make use
> of the non-blocking calls in libvirt. [Are overlapping methods mainly used
> by multithreaded clients].

That's up to you; but virsh is our canonical example, and it is
multi-threaded in order to allow Ctrl-C to interrupt long-running tasks
cleanly.

> 2) I was wondering if there was any way to provide a callback along with
> the methods  to achieve non-blocking.[My application has event library so
> it can receive events]

Yes, the event API requires that you register a callback to be invoked
any time you want to receive notifications of events.  You don't have to
use events, but if you do, the examples/domain-events/ directory in
libvirt.git shows how to use them in both C and Python bindings.

> 3) Is the libvirt RPC client multi-threaded. [i.e., does it internally use
> multiple threads to dispatch requests to server and return response to the
> application]

Yes, and the number of worker threads is configured by
/etc/libvirt/libvirtd.conf max_workers.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users

[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux