File: snapshot.py

package info (click to toggle)
virt-manager 1%3A5.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 20,200 kB
  • sloc: python: 44,538; xml: 28,397; makefile: 17; sh: 6
file content (31 lines) | stat: -rw-r--r-- 964 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#
# Copyright 2013-2014 Red Hat, Inc.
#
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.

from .devices.disk import _DiskSource
from .xmlbuilder import XMLBuilder, XMLChildProperty, XMLProperty


class _SnapshotDisk(XMLBuilder):
    XML_NAME = "disk"
    name = XMLProperty("./@name")
    snapshot = XMLProperty("./@snapshot")
    source = XMLChildProperty(_DiskSource, is_single=True)


class DomainSnapshot(XMLBuilder):
    XML_NAME = "domainsnapshot"
    _XML_PROP_ORDER = ["name", "description", "creationTime"]

    name = XMLProperty("./name")
    description = XMLProperty("./description")
    state = XMLProperty("./state")
    creationTime = XMLProperty("./creationTime", is_int=True)
    parent = XMLProperty("./parent/name")

    memory_type = XMLProperty("./memory/@snapshot")
    memory_file = XMLProperty("./memory/@file")

    disks = XMLChildProperty(_SnapshotDisk, relative_xpath="./disks")