]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
conf: restrict external snapshots to backing store formats
authorEric Blake <eblake@redhat.com>
Mon, 14 Apr 2014 22:54:14 +0000 (16:54 -0600)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 15 Apr 2014 11:57:15 +0000 (13:57 +0200)
commitdb7d7c0ee8a1a6db2d81a71e10794bc5c597b301
treed1953a3cd8e7cb770220e3e5dac95c2643f9a454
parent4f596a070d7e5cb52d7908a03b414617f81fc517
conf: restrict external snapshots to backing store formats

Domain snapshots should only permit an external snapshot into
a storage format that permits a backing chain, since the new
snapshot file necessarily must be backed by the existing file.
The C code for the qemu driver is a little bit stricter in
currently enforcing only qcow2 or qed, but at the XML parser
level, including virt-xml-validate, it is fairly easy to
enforce that a user can't request a 'raw' external snapshot.

* docs/schemas/storagecommon.rng (storageFormat): Split out...
(storageFormatBacking): ...new sublist.
* docs/schemas/domainsnapshot.rng (disksnapshotdriver): Use new
type.
* src/util/virstoragefile.h (virStorageFileFormat): Rearrange for
easier code management.
* src/util/virstoragefile.c (virStorageFileFormat, fileTypeInfo):
Likewise.
* src/conf/snapshot_conf.c (virDomainSnapshotDiskDefParseXML): Use
new marker to limit selection of formats.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
docs/schemas/domainsnapshot.rng
docs/schemas/storagecommon.rng
src/conf/snapshot_conf.c
src/util/virstoragefile.c
src/util/virstoragefile.h