mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Support leases in guest XML and lock manager
A lock manager may operate in various modes. The direct mode of
operation is to obtain locks based on the resources associated
with devices in the XML. The indirect mode is where the app
creating the domain provides explicit leases for each resource
that needs to be locked. This XML extension allows for listing
resources in the XML
<devices>
...
<lease>
<lockspace>somearea</lockspace>
<key>thequickbrownfoxjumpsoverthelazydog</key>
<target path='/some/lease/path' offset='23432'/>
</lease>
...
</devices>
The 'lockspace' is a unique identifier for the lockspace which
the lease is associated
The 'key' is a unique identifier for the resource associated
with the lease.
The 'target' is the file on disk where the leases are held.
* docs/schemas/domain.rng: Add lease schema
* src/conf/domain_conf.c, src/conf/domain_conf.h: parsing and
formatting for leases
* tests/qemuxml2argvdata/qemuxml2argv-lease.args,
tests/qemuxml2argvdata/qemuxml2argv-lease.xml,
tests/qemuxml2xmltest.c: Test XML handling for leases
This commit is contained in:
@@ -586,6 +586,29 @@
|
||||
<ref name="address"/>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
<define name="lease">
|
||||
<element name="lease">
|
||||
<interleave>
|
||||
<element name="lockspace">
|
||||
<text/>
|
||||
</element>
|
||||
<element name="key">
|
||||
<text/>
|
||||
</element>
|
||||
<element name="target">
|
||||
<attribute name="path">
|
||||
<text/>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name="offset">
|
||||
<ref name="unsignedInt"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</element>
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
<!--
|
||||
A disk description can be either of type file or block
|
||||
The name of the attribute on the source element depends on the type
|
||||
@@ -1962,6 +1985,7 @@
|
||||
<choice>
|
||||
<ref name="disk"/>
|
||||
<ref name="controller"/>
|
||||
<ref name="lease"/>
|
||||
<ref name="filesystem"/>
|
||||
<ref name="interface"/>
|
||||
<ref name="input"/>
|
||||
|
||||
Reference in New Issue
Block a user