libvirt/tests/qemudomainsnapshotxml2xmlin/disk_snapshot.xml

35 lines
1.1 KiB
XML
Raw Normal View History

<domainsnapshot>
<name>my snap name</name>
<description>!@#$%^</description>
<disks>
snapshot: also support disks by path I got confused when 'virsh domblkinfo dom disk' required the path to a disk (which can be ambiguous, since a single file can back multiple disks), rather than the unambiguous target device name that I was using in disk snapshots. So, in true developer fashion, I went for the best of both worlds - all interfaces that operate on a disk (aka block) now accept either the target name or the unambiguous path to the backing file used by the disk. * src/conf/domain_conf.h (virDomainDiskIndexByName): Add parameter. (virDomainDiskPathByName): New prototype. * src/libvirt_private.syms (domain_conf.h): Export it. * src/conf/domain_conf.c (virDomainDiskIndexByName): Also allow searching by path, and decide whether ambiguity is okay. (virDomainDiskPathByName): New function. (virDomainDiskRemoveByName, virDomainSnapshotAlignDisks): Update callers. * src/qemu/qemu_driver.c (qemudDomainBlockPeek) (qemuDomainAttachDeviceConfig, qemuDomainUpdateDeviceConfig) (qemuDomainGetBlockInfo, qemuDiskPathToAlias): Likewise. * src/qemu/qemu_process.c (qemuProcessFindDomainDiskByPath): Likewise. * src/libxl/libxl_driver.c (libxlDomainAttachDeviceDiskLive) (libxlDomainDetachDeviceDiskLive, libxlDomainAttachDeviceConfig) (libxlDomainUpdateDeviceConfig): Likewise. * src/uml/uml_driver.c (umlDomainBlockPeek): Likewise. * src/xen/xend_internal.c (xenDaemonDomainBlockPeek): Likewise. * docs/formatsnapshot.html.in: Update documentation. * tools/virsh.pod (domblkstat, domblkinfo): Likewise. * docs/schemas/domaincommon.rng (diskTarget): Tighten pattern on disk targets. * docs/schemas/domainsnapshot.rng (disksnapshot): Update to match. * tests/domainsnapshotxml2xmlin/disk_snapshot.xml: Update test.
2011-08-20 02:38:36 +00:00
<disk name='/dev/HostVG/QEMUGuest1'/>
<disk name='hdb' snapshot='no'/>
<disk name='hdc' snapshot='internal'/>
<disk name='hdd' snapshot='external'>
<source/>
<driver type='qed'/>
</disk>
<disk name='hde' snapshot='external'>
<source file='/path/to/new'/>
</disk>
<disk name='hde' snapshot='external' type='file'>
<source file='/path/to/new2'/>
</disk>
<disk name='hdf' snapshot='external' type='block'>
<source dev='/path/to/new3'/>
</disk>
<disk name='hdg' snapshot='external' type='network'>
<source protocol='gluster' name='volume/path'>
<host name='host' port='1234'/>
</source>
</disk>
<disk name='hdh' snapshot='external' type='network'>
<source protocol='rbd' name='vol/name'>
<host name='host' port='1234'/>
<host name='host2' port='1234' transport='rdma'/>
<host name='host3' port='1234'/>
</source>
</disk>
</disks>
</domainsnapshot>