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

[libvirt] Different approach to locking



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


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