[libvirt] Different approach to locking

Richard W.M. Jones rjones at redhat.com
Thu Nov 11 10:49:27 UTC 2010


I get the feeling that the locking manager is meant to be a
libvirt-internal API.  I'll throw out this idea instead: How about
making the concept of "reserving" a VM into a public libvirt API?

  /* Reserve 'dom'.
   *
   * flags:
   *   VIR_DOMAIN_RESERVE_READONLY: reserve for read-only access
   */
  int virDomainReserve (virDomainPtr dom, unsigned flags);

  /* Drop reservation of 'dom'.
   */
  int virDomainUnReserve (virDomainPtr dom);

The reservation would also be dropped when the current libvirt
connection is closed.

libvirt/libvirtd would acquire the locks on our behalf.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v




More information about the libvir-list mailing list