storage: Use qcow2 lazy_refcounts if supported

This commit is contained in:
Cole Robinson 2014-02-03 14:52:23 -05:00
parent 1ab206a3eb
commit cac593da8f
17 changed files with 56 additions and 2 deletions

View File

@ -9,5 +9,8 @@
<owner>10736</owner>
<group>10736</group>
</permissions>
<features>
<lazy_refcounts/>
</features>
</target>
</volume>

View File

@ -13,5 +13,9 @@
<owner>10736</owner>
<group>10736</group>
</permissions>
<compat>1.1</compat>
<features>
<lazy_refcounts/>
</features>
</target>
</volume>

View File

@ -9,5 +9,8 @@
<owner>10736</owner>
<group>10736</group>
</permissions>
<features>
<lazy_refcounts/>
</features>
</target>
</volume>

View File

@ -8,5 +8,8 @@
<owner>10736</owner>
<group>10736</group>
</permissions>
<features>
<lazy_refcounts/>
</features>
</target>
</volume>

View File

@ -9,5 +9,8 @@
<owner>10736</owner>
<group>10736</group>
</permissions>
<features>
<lazy_refcounts/>
</features>
</target>
</volume>

View File

@ -9,5 +9,8 @@
<owner>10736</owner>
<group>10736</group>
</permissions>
<features>
<lazy_refcounts/>
</features>
</target>
</volume>

View File

@ -13,5 +13,9 @@
<owner>10736</owner>
<group>10736</group>
</permissions>
<compat>1.1</compat>
<features>
<lazy_refcounts/>
</features>
</target>
</volume>

View File

@ -9,5 +9,8 @@
<owner>10736</owner>
<group>10736</group>
</permissions>
<features>
<lazy_refcounts/>
</features>
</target>
</volume>

View File

@ -8,5 +8,8 @@
<owner>10736</owner>
<group>10736</group>
</permissions>
<features>
<lazy_refcounts/>
</features>
</target>
</volume>

View File

@ -8,5 +8,8 @@
<owner>10736</owner>
<group>10736</group>
</permissions>
<features>
<lazy_refcounts/>
</features>
</target>
</volume>

View File

@ -9,5 +9,8 @@
<owner>10736</owner>
<group>10736</group>
</permissions>
<features>
<lazy_refcounts/>
</features>
</target>
</volume>

View File

@ -13,5 +13,9 @@
<owner>10736</owner>
<group>10736</group>
</permissions>
<compat>1.1</compat>
<features>
<lazy_refcounts/>
</features>
</target>
</volume>

View File

@ -9,5 +9,8 @@
<owner>10736</owner>
<group>10736</group>
</permissions>
<features>
<lazy_refcounts/>
</features>
</target>
</volume>

View File

@ -11,6 +11,9 @@
<label>foo.label</label>
</permissions>
<path>/foo/bar</path>
<features>
<lazy_refcounts/>
</features>
</target>
<backingStore>
<path>/my/backing</path>

View File

@ -1047,6 +1047,7 @@ class XMLParseTest(unittest.TestCase):
check("format", "raw", "qcow2")
check("target_path", None, "/foo/bar")
check("backing_store", "/foo/bar/baz", "/my/backing")
check("lazy_refcounts", False, True)
check = self._make_checker(vol.permissions)
check("mode", "0700", "0744")

View File

@ -595,6 +595,12 @@ class StorageVolume(_StorageObject):
target_path = XMLProperty("./target/path")
backing_store = XMLProperty("./backingStore/path")
def _lazy_refcounts_default_cb(self):
return self.conn.check_support(
self.conn.SUPPORT_CONN_QCOW2_LAZY_REFCOUNTS)
lazy_refcounts = XMLProperty("./target/features/lazy_refcounts",
is_bool=True, default_cb=_lazy_refcounts_default_cb)
######################
# Public API helpers #

View File

@ -292,8 +292,10 @@ SUPPORT_CONN_VIRTIO_CONSOLE = _make(drv_libvirt_version=[("qemu", 8003)])
SUPPORT_CONN_PANIC_DEVICE = _make(version=1002001,
drv_version=[("qemu", 1005000),
("test", 0)])
SUPPORT_CONN_PM_DISABLE = _make(version="10002", drv_version=[
("qemu", 1002000), ("test", 0)])
SUPPORT_CONN_PM_DISABLE = _make(version="10002",
drv_version=[("qemu", 1002000), ("test", 0)])
SUPPORT_CONN_QCOW2_LAZY_REFCOUNTS = _make(version="1001000",
drv_version=[("qemu", 1002000), ("test", 0)])
# Domain checks