[libvirt] [PATCH] virsh: improve documentation
by Eric Blake
Document several missing commands. There's more work that could be
done, but incremental improvements is better than no patch at all.
* tools/virsh.pod (autostart, connect): Improve grammar.
(create): Improve example.
(domjobabort, domjobinfo, domxml-from-native, domxml-to-native):
Document.
(storage pool commands): New section.
---
tools/virsh.pod | 167 ++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 154 insertions(+), 13 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 62395d7..fdf687f 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -103,10 +103,12 @@ Will print the current directory.
=item B<connect> I<URI> optional I<--readonly>
-(Re)-Connect to the hypervisor. This is a build-in command after shell
-start up, and usually get an I<URI> parameter specifying how to connect
-to the hypervisor. The documentation page at L<http://libvirt.org/uri.html>
-list the values supported but the most common are:
+(Re)-Connect to the hypervisor. When the shell is first started, this
+is automatically run with the I<URI> parameter requested by the C<-c>
+option on the command line. The I<URI> parameter specifies how to
+connect to the hypervisor. The documentation page at
+L<http://libvirt.org/uri.html> list the values supported, but the most
+common are:
=over 4
@@ -116,11 +118,11 @@ this is used to connect to the local Xen hypervisor, this is the default
=item qemu:///system
-allow to connect locally as root to the daemon supervising QEmu and KVM domains
+connect locally as root to the daemon supervising QEmu and KVM domains
=item qemu:///session
-allow to connect locally as a normal user to his own set of QEmu and KVM domains
+connect locally as a normal user to his own set of QEmu and KVM domains
=item lxc:///
@@ -252,7 +254,7 @@ I<domain-id> can be specified as an short integer, a name or a full UUID.
Configure a domain to be automatically started at boot.
-The option I<--disable> disable autostarting.
+The option I<--disable> disables autostarting.
=item B<console> I<domain-id>
@@ -260,11 +262,15 @@ Connect the virtual serial console for the guest.
=item B<create> I<FILE>
-Create a domain from an XML <file>. An easy way to create the XML <file> is to use the B<dumpxml> command to obtain the definition of a pre-existing guest.
+Create a domain from an XML <file>. An easy way to create the XML
+<file> is to use the B<dumpxml> command to obtain the definition of a
+pre-existing guest.
B<Example>
-virsh dumpxml <domain-id> > file.
+virsh dumpxml <domain-id> >
+edit file
+virsh create < file
=item B<define> I<FILE>
@@ -306,6 +312,14 @@ Convert a domain name (or UUID) to a domain id
Returns basic information about the domain.
+=item B<domjobabort I<domain-id-or-uuid>
+
+Abort the currently running domain job.
+
+=item B<domjobinfo> I<domain-id-or-uuid>
+
+Returns information about jobs running on a domain.
+
=item B<domname> I<domain-id-or-uuid>
Convert a domain Id (or UUID) to domain name
@@ -314,13 +328,24 @@ Convert a domain Id (or UUID) to domain name
Returns state about a running domain.
+=item B<domxml-from-native> I<format> I<config>
+
+Convert the file I<config> in the native guest configuration format
+named by I<format> to a domain XML format.
+
+=item B<domxml-to-native> I<format> I<xml>
+
+Convert the file I<xml> in domain XML format to the native guest
+configuration format named by I<format>.
+
=item B<dump> I<domain-id> I<corefilepath>
Dumps the core of a domain to a file for analysis.
=item B<dumpxml> I<domain-id>
-Output the domain information as an XML dump to stdout, this format can be used by the B<create> command.
+Output the domain information as an XML dump to stdout, this format
+can be used by the B<create> command.
=item B<edit> I<domain-id>
@@ -566,7 +591,7 @@ Edit the XML configuration file for a network.
This is equivalent to:
virsh net-dumpxml network > network.xml
edit network.xml
- virsh define network.xml
+ virsh net-define network.xml
except that it does some error checking.
The editor used can be supplied by the C<$VISUAL> or C<$EDITOR> environment
@@ -596,6 +621,122 @@ Convert a network name to network UUID.
=back
+=head1 STORAGE POOL COMMANDS
+
+The following commands manipulate storage pools. Libvirt has the
+capability to manage various storage solutions, including files, raw
+partitions, and domain-specific formats, used to provide the storage
+volumes visible as devices within virtual machines. For more detailed
+information about this feature, see the documentation at
+L<http://libvirt.org/formatstorage.html> . A lot of the commands for
+pools are similar to the ones used for domains.
+
+=over 4
+
+=item B<find-storage-pool-sources> I<type> optional I<srcSpec>
+
+Returns XML describing all storage pools of a given I<type> that could
+be found. If I<srcSpec> is provided, it is a file that contains XML
+to further restrict the query for pools.
+
+=item B<find-storage-pool-sources> I<type> optional I<host> I<port>
+
+Returns XML describing all storage pools of a given I<type> that could
+be found. If I<host> and I<port> are provided, they control where the
+query is performed.
+
+=item B<pool-autostart> I<pool-or-uuid> optional I<--disable>
+
+Configure whether I<pool> should automatically start at boot.
+
+=item B<pool-build> I<pool-or-uuid>
+
+Build a given pool.
+
+=item B<pool-create> I<file>
+
+Create and start a pool object from the XML I<file>.
+
+=item B<pool-create-as> I<name> I<--print-xml> I<type> optional I<source-host>
+I<source-path> I<source-dev> I<source-name> <target>
+
+Create and start a pool object I<name> from the raw parameters. If
+I<--print-xml> is specified, then print the XML of the pool object
+without creating the pool. Otherwise, the pool has the specified
+I<type>.
+
+=item B<pool-define> I<file>
+
+Create, but do not start, a pool object from the XML I<file>.
+
+=item B<pool-define-as> I<name> I<--print-xml> I<type> optional I<source-host>
+I<source-path> I<source-dev> I<source-name> <target>
+
+Create, but do not start, a pool object I<name> from the raw parameters. If
+I<--print-xml> is specified, then print the XML of the pool object
+without defining the pool. Otherwise, the pool has the specified
+I<type>.
+
+=item B<pool-destroy> I<pool-or-uuid>
+
+Destroy a given I<pool> object. Libvirt will no longer manage the
+storage described by the pool object, but the raw data contained in
+the pool is not changed, and can be later recovered with
+B<pool-create>.
+
+=item B<pool-delete> I<pool-or-uuid>
+
+Destroy the resources used by a given I<pool> object. This operation
+is non-recoverable. The I<pool> object will still exist after this
+command.
+
+=item B<pool-dumpxml> I<pool-or-uuid>
+
+Returns the XML information about the I<pool> object.
+
+=item B<pool-edit> I<pool-or-uuid>
+
+Edit the XML configuration file for a storage pool.
+
+This is equivalent to:
+ virsh pool-dumpxml pool > pool.xml
+ edit pool.xml
+ virsh pool-define pool.xml
+except that it does some error checking.
+
+The editor used can be supplied by the C<$VISUAL> or C<$EDITOR> environment
+variables, and defaults to C<vi>.
+
+=item B<pool-info> I<pool-or-uuid>
+
+Returns basic information about the I<pool> object.
+
+=item B<pool-list> optional I<--inactive> I<--all>
+
+List pool objects known to libvirt. By default, only pools in use by
+active domains are listed; I<--inactive> lists just the inactive
+pools, and I<--all> lists all pools.
+
+=item B<pool-name> I<uuid>
+
+Convert the I<uuid> to a pool name.
+
+=item B<pool-refresh> I<pool-or-uuid>
+
+Refresh the list of volumes contained in I<pool>.
+
+=item B<pool-start> I<pool-or-uuid>
+
+Start the storage I<pool>, which is previously defined but inactive.
+
+=item B<pool-undefine> I<pool-or-uuid>
+
+Undefine the configuration for an inactive I<pool>.
+
+=item B<pool-uuid> I<pool>
+
+Returns the UUID of the named I<pool>.
+
=head1 SECRET COMMMANDS
The following commands manipulate "secrets" (e.g. passwords, passphrases and
@@ -653,11 +794,11 @@ format as accepted by the B<connect> option.
=item VISUAL
-The editor to use by the B<edit> and B<net-edit> options.
+The editor to use by the B<edit> and related options.
=item EDITOR
-The editor to use by the B<edit> and B<net-edit> options, if C<VISUAL>
+The editor to use by the B<edit> and related options, if C<VISUAL>
is not set.
=item LIBVIRT_DEBUG=LEVEL
--
1.6.6.1
14 years, 7 months
[libvirt] [PATCH] Clarify an error message in setmem.
by Chris Lalancette
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
tools/virsh.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index ad64bc0..d241fa0 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -2407,7 +2407,8 @@ cmdSetmem(vshControl *ctl, const vshCmd *cmd)
if (kilobytes > info.maxMem) {
virDomainFree(dom);
- vshError(ctl, _("Invalid value of %d for memory size"), kilobytes);
+ vshError(ctl, _("Requested memory size %d kb is larger than maximum of %lu kb"),
+ kilobytes, info.maxMem);
return FALSE;
}
--
1.6.6.1
14 years, 7 months
[libvirt] [PATCH] Fix up comments for isEncrypted, isSecure, domainIsActive, and domainIsPersistent.
by Chris Lalancette
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
src/lxc/lxc_driver.c | 8 ++++----
src/opennebula/one_driver.c | 4 ++--
src/phyp/phyp_driver.c | 4 ++--
src/qemu/qemu_driver.c | 8 ++++----
src/uml/uml_driver.c | 8 ++++----
src/vbox/vbox_tmpl.c | 8 ++++----
src/xen/xen_driver.c | 8 ++++----
7 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index b5d422c..c6b652d 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -2527,10 +2527,10 @@ static virDriver lxcDriver = {
NULL, /* nodeDeviceReAttach */
NULL, /* nodeDeviceReset */
NULL, /* domainMigratePrepareTunnel */
- lxcIsEncrypted,
- lxcIsSecure,
- lxcDomainIsActive,
- lxcDomainIsPersistent,
+ lxcIsEncrypted, /* isEncrypted */
+ lxcIsSecure, /* isSecure */
+ lxcDomainIsActive, /* domainIsActive */
+ lxcDomainIsPersistent, /* domainIsPersistent */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */
diff --git a/src/opennebula/one_driver.c b/src/opennebula/one_driver.c
index 4554d95..0d80d1f 100644
--- a/src/opennebula/one_driver.c
+++ b/src/opennebula/one_driver.c
@@ -781,8 +781,8 @@ static virDriver oneDriver = {
NULL, /* nodeDeviceReAttach; */
NULL, /* nodeDeviceReset; */
NULL, /* domainMigratePrepareTunnel */
- oneIsEncrypted,
- oneIsSecure,
+ oneIsEncrypted, /* isEncrypted */
+ oneIsSecure, /* isSecure */
NULL, /* domainIsActive */
NULL, /* domainIsPersistent */
NULL, /* cpuCompare */
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index 28e17ff..b712d0a 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -1640,8 +1640,8 @@ virDriver phypDriver = {
NULL, /* nodeDeviceReAttach */
NULL, /* nodeDeviceReset */
NULL, /* domainMigratePrepareTunnel */
- phypIsEncrypted,
- phypIsSecure,
+ phypIsEncrypted, /* isEncrypted */
+ phypIsSecure, /* isSecure */
NULL, /* domainIsActive */
NULL, /* domainIsPersistent */
NULL, /* cpuCompare */
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a87b974..bc94ce6 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -11325,10 +11325,10 @@ static virDriver qemuDriver = {
qemudNodeDeviceReAttach, /* nodeDeviceReAttach */
qemudNodeDeviceReset, /* nodeDeviceReset */
qemudDomainMigratePrepareTunnel, /* domainMigratePrepareTunnel */
- qemuIsEncrypted,
- qemuIsSecure,
- qemuDomainIsActive,
- qemuDomainIsPersistent,
+ qemuIsEncrypted, /* isEncrypted */
+ qemuIsSecure, /* isSecure */
+ qemuDomainIsActive, /* domainIsActive */
+ qemuDomainIsPersistent, /* domainIsPersistent */
qemuCPUCompare, /* cpuCompare */
qemuCPUBaseline, /* cpuBaseline */
qemuDomainGetJobInfo, /* domainGetJobInfo */
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index dfa5de5..0179b2e 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -1926,10 +1926,10 @@ static virDriver umlDriver = {
NULL, /* nodeDeviceReAttach */
NULL, /* nodeDeviceReset */
NULL, /* domainMigratePrepareTunnel */
- umlIsEncrypted,
- umlIsSecure,
- umlDomainIsActive,
- umlDomainIsPersistent,
+ umlIsEncrypted, /* isEncrypted */
+ umlIsSecure, /* isSecure */
+ umlDomainIsActive, /* domainIsActive */
+ umlDomainIsPersistent, /* domainIsPersistent */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 62fd8e1..4b00a80 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -8138,10 +8138,10 @@ virDriver NAME(Driver) = {
NULL, /* nodeDeviceReAttach */
NULL, /* nodeDeviceReset */
NULL, /* domainMigratePrepareTunnel */
- vboxIsEncrypted,
- vboxIsSecure,
- vboxDomainIsActive,
- vboxDomainIsPersistent,
+ vboxIsEncrypted, /* isEncrypted */
+ vboxIsSecure, /* isSecure */
+ vboxDomainIsActive, /* domainIsActive */
+ vboxDomainIsPersistent, /* domainIsPersistent */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 7c4eb5e..0835406 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -1969,10 +1969,10 @@ static virDriver xenUnifiedDriver = {
xenUnifiedNodeDeviceReAttach, /* nodeDeviceReAttach */
xenUnifiedNodeDeviceReset, /* nodeDeviceReset */
NULL, /* domainMigratePrepareTunnel */
- xenUnifiedIsEncrypted,
- xenUnifiedIsSecure,
- xenUnifiedDomainIsActive,
- xenUnifiedDomainisPersistent,
+ xenUnifiedIsEncrypted, /* isEncrypted */
+ xenUnifiedIsSecure, /* isSecure */
+ xenUnifiedDomainIsActive, /* domainIsActive */
+ xenUnifiedDomainisPersistent, /* domainIsPersistent */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */
--
1.6.6.1
14 years, 7 months
[libvirt] [PATCH] Document snapshot virsh commands in the man page.
by Chris Lalancette
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
tools/virsh.pod | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 62395d7..9e2c3e5 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -639,6 +639,55 @@ Output a list of UUIDs of known secrets to stdout.
=back
+=head1 SNAPSHOT COMMMANDS
+
+The following commands manipulate domain snapshots. Snapshots take the
+disk, memory, and device state of a domain at a point-of-time, and save it
+for future use. They have many uses, from saving a "clean" copy of an OS
+image to saving a domain's state before a potentially destructive operation.
+Snapshots are identified with a unique name. See
+L<http://libvirt.org/formatsnapshot.html> for documentation of the XML format
+used to represent properties of snapshots.
+
+=over 4
+
+=item B<snapshot-create> I<domain> I<xmlfile>
+
+Create a snapshot for domain I<domain> with the properties specified in
+I<xmlfile>. The only properties settable for a domain snapshot are the
+<name> and <description>; the rest of the fields are ignored, and
+automatically filled in by libvirt. If I<xmlfile> is completely ommitted,
+then libvirt will choose a value for all fields.
+
+=item B<snapshot-current> I<domain>
+
+Output the snapshot XML for the domain's current snapshot (if any).
+
+=item B<snapshot-list> I<domain>
+
+List all of the available snapshots for the given domain.
+
+=item B<snapshot-dumpxml> I<domain> I<snapshot>
+
+Output the snapshot XML for the domain's snapshot named I<snapshot>.
+
+=item B<revert-to-snapshot> I<domain> I<snapshot>
+
+Revert the given domain to the snapshot specified by I<snapshot>. Be aware
+that this is a destructive action; any changes in the domain since the
+snapshot is taken will be lost. Also note that the state of the domain after
+revert-to-snapshot is complete will be the state of the domain at the time
+the original snapshot was taken.
+
+=item B<snapshot-delete> I<domain> I<snapshot> I<--children>
+
+Delete the snapshot for the domain named I<snapshot>. If this snapshot
+has child snapshots, changes from this snapshot will be merged into the
+children. If I<--children> is passed, then delete this snapshot and any
+children of this snapshot.
+
+=back
+
=head1 ENVIRONMENT
The following environment variables can be set to alter the behaviour
--
1.6.6.1
14 years, 7 months
[libvirt] [PATCH] Better error reporting in virsh.
by Chris Lalancette
When hitting failures in virsh, a common idiom is
to jump to a cleanup label, free some resources, and
then return a FALSE error code to vshCommandRun.
In theory, vshCommandRun is then supposed to print
out the last error. The problem is that many of
the cleanup paths have library calls to free resources,
and all of those library calls clear out the last error.
This is leading to situations where no error is being
reported at all.
This patch remedies the situation somewhat by
printing out the errors inside the command methods
themselves when we know it will go through a cleanup
path that will lose the error.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
tools/virsh.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index d241fa0..aaae7ca 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -2623,9 +2623,8 @@ cmdDomXMLFromNative(vshControl *ctl, const vshCmd *cmd)
format = vshCommandOptString(cmd, "format", NULL);
configFile = vshCommandOptString(cmd, "config", NULL);
- if (virFileReadAll(configFile, 1024*1024, &configData) < 0) {
+ if (virFileReadAll(configFile, 1024*1024, &configData) < 0)
return FALSE;
- }
xmlData = virConnectDomainXMLFromNative(ctl->conn, format, configData, flags);
if (xmlData != NULL) {
@@ -2669,9 +2668,8 @@ cmdDomXMLToNative(vshControl *ctl, const vshCmd *cmd)
format = vshCommandOptString(cmd, "format", NULL);
xmlFile = vshCommandOptString(cmd, "xml", NULL);
- if (virFileReadAll(xmlFile, 1024*1024, &xmlData) < 0) {
+ if (virFileReadAll(xmlFile, 1024*1024, &xmlData) < 0)
return FALSE;
- }
configData = virConnectDomainXMLToNative(ctl->conn, format, xmlData, flags);
if (configData != NULL) {
@@ -4330,9 +4328,8 @@ cmdNodeDeviceCreate(vshControl *ctl, const vshCmd *cmd)
return FALSE;
}
- if (virFileReadAll(from, VIRSH_MAX_XML_FILE, &buffer) < 0) {
+ if (virFileReadAll(from, VIRSH_MAX_XML_FILE, &buffer) < 0)
return FALSE;
- }
dev = virNodeDeviceCreateXML(ctl->conn, buffer, 0);
VIR_FREE(buffer);
@@ -5427,6 +5424,7 @@ cmdVolCreate(vshControl *ctl, const vshCmd *cmd)
}
if (virFileReadAll(from, VIRSH_MAX_XML_FILE, &buffer) < 0) {
+ virshReportError(ctl);
virStoragePoolFree(pool);
return FALSE;
}
@@ -5488,6 +5486,7 @@ cmdVolCreateFrom(vshControl *ctl, const vshCmd *cmd)
goto cleanup;
if (virFileReadAll(from, VIRSH_MAX_XML_FILE, &buffer) < 0) {
+ virshReportError(ctl);
goto cleanup;
}
@@ -6928,6 +6927,7 @@ cmdAttachDevice(vshControl *ctl, const vshCmd *cmd)
}
if (virFileReadAll(from, VIRSH_MAX_XML_FILE, &buffer) < 0) {
+ virshReportError(ctl);
virDomainFree(dom);
return FALSE;
}
@@ -6995,6 +6995,7 @@ cmdDetachDevice(vshControl *ctl, const vshCmd *cmd)
}
if (virFileReadAll(from, VIRSH_MAX_XML_FILE, &buffer) < 0) {
+ virshReportError(ctl);
virDomainFree(dom);
return FALSE;
}
@@ -7062,6 +7063,7 @@ cmdUpdateDevice(vshControl *ctl, const vshCmd *cmd)
}
if (virFileReadAll(from, VIRSH_MAX_XML_FILE, &buffer) < 0) {
+ virshReportError(ctl);
virDomainFree(dom);
return FALSE;
}
--
1.6.6.1
14 years, 7 months
[libvirt] [PATCH] Website documentation for the snapshot XML.
by Chris Lalancette
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
docs/formatsnapshot.html.in | 72 +++++++++++++++++++++++++++++++++++++++++++
docs/sitemap.html.in | 4 ++
2 files changed, 76 insertions(+), 0 deletions(-)
create mode 100644 docs/formatsnapshot.html.in
diff --git a/docs/formatsnapshot.html.in b/docs/formatsnapshot.html.in
new file mode 100644
index 0000000..fa007ea
--- /dev/null
+++ b/docs/formatsnapshot.html.in
@@ -0,0 +1,72 @@
+<html>
+ <body>
+ <h1>Snapshot XML format</h1>
+
+ <ul id="toc"></ul>
+
+ <h2><a name="SnapshotAttributes">Snapshot XML</a></h2>
+
+ <p>
+ Attributes of libvirt snapshots are stored as child elements of
+ the <code>domainsnapshot</code> element. At snapshot creation
+ time, only the <code>name</code> and <code>description</code>
+ elements are settable; the rest of the fields are informational
+ (and readonly) and will be filled in by libvirt when the
+ snapshot is created.
+ </p>
+ <p>
+ The top-level <code>domainsnapshot</code> element may contain
+ the following elements:
+ </p>
+ <dl>
+ <dt><code>name</code></dt>
+ <dd>The name for this snapshot. If the name is specified when
+ initially creating the snapshot, then the snapshot will have
+ that particular name. If the name is omitted when initially
+ creating the snapshot, then libvirt will make up a name for the snapshot.
+ </dd>
+ <dt><code>description</code></dt>
+ <dd>A human-readable description of the snapshot. If the
+ description is omitted when initially creating the snapshot,
+ then this field will be empty.
+ </dd>
+ <dt><code>creationTime</code></dt>
+ <dd>The time this snapshot was created. The time is specified
+ in seconds since the Epoch (i.e. Unix time). Readonly.
+ </dd>
+ <dt><code>state</code></dt>
+ <dd>The state of the domain at the time this snapshot was
+ taken. When the domain is reverted to this snapshot, the domain's state
+ will be set to whatever is in this field. Readonly.
+ </dd>
+ <dt><code>parent</code></dt>
+ <dd>The parent of this snapshot. This element contains exactly
+ one child element, name. This specifies the name of the parent
+ snapshot of this snapshot, and is used to represent trees of
+ snapshots. Readonly.
+ </dd>
+ <dt><code>domain</code></dt>
+ <dd>The domain that this snapshot was taken against. This
+ element contains exactly one child element, uuid. This
+ specifies the uuid of the domain that this snapshot was taken
+ against. Readonly.
+ </dd>
+ </dl>
+
+ <h2><a name="example">Example</a></h2>
+
+ <pre>
+ <domainsnapshot>
+ <name>os-updates</name>
+ <description>Snapshot of OS install and updates</description>
+ <state>running</state>
+ <creationTime>1270477159</creationTime>
+ <parent>
+ <name>bare-os-install</name>
+ </parent>
+ <domain>
+ <uuid>93a5c045-6457-2c09-e56c-927cdf34e178</uuid>
+ </domain>
+ </domainsnapshot></pre>
+ </body>
+</html>
diff --git a/docs/sitemap.html.in b/docs/sitemap.html.in
index 76d8faa..ae2bfde 100644
--- a/docs/sitemap.html.in
+++ b/docs/sitemap.html.in
@@ -114,6 +114,10 @@
<a href="formatsecret.html">Secrets</a>
<span>The secret XML format</span>
</li>
+ <li>
+ <a href="formatsnapshot.html">Secrets</a>
+ <span>The snapshot XML format</span>
+ </li>
</ul>
</li>
<li>
--
1.6.6.1
14 years, 7 months
[libvirt] [PATCH] Increase the number of available VNC ports.
by Chris Lalancette
When starting up qemu VNC autoport guests, we were
only looking through ports 5900 to 6000, meaning we
were limited to 100 total clients. Increase that
limit to 65535 (the last available port), so we can
have up to 59635 VNC autoport guests.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
src/qemu/qemu_driver.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index bc94ce6..ce43fd3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2598,7 +2598,7 @@ qemuInitPCIAddresses(struct qemud_driver *driver,
static int qemudNextFreeVNCPort(struct qemud_driver *driver ATTRIBUTE_UNUSED) {
int i;
- for (i = 5900 ; i < 6000 ; i++) {
+ for (i = 5900 ; i < 65535 ; i++) {
int fd;
int reuse = 1;
struct sockaddr_in addr;
--
1.6.6.1
14 years, 7 months
[libvirt] [PATCH] nwfilter: RHEL 5 gcc fixes
by Stefan Berger
This patch fixes some compilation issues for the RHEL5 build. I am also removing the IPV6 constant where it appears in the wrong place.
Seems like a new bad thing to rely on the compiler to tell about potentially uninitialized vars...
Signed-off-by; Stefan Berger <stefanb(a)us.ibm.com>
---
src/conf/nwfilter_conf.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: libvirt-acl/src/conf/nwfilter_conf.c
===================================================================
--- libvirt-acl.orig/src/conf/nwfilter_conf.c
+++ libvirt-acl/src/conf/nwfilter_conf.c
@@ -392,7 +392,9 @@ struct _virXMLAttr2Struct
static const struct int_map macProtoMap[] = {
INTMAP_ENTRY(ETHERTYPE_ARP , "arp"),
INTMAP_ENTRY(ETHERTYPE_IP , "ipv4"),
+#ifdef ETHERTYPE_IPV6
INTMAP_ENTRY(ETHERTYPE_IPV6, "ipv6"),
+#endif
INTMAP_ENTRY_LAST
};
@@ -547,7 +549,6 @@ static const struct int_map ipProtoMap[]
#ifdef IPPROTO_SCTP
INTMAP_ENTRY(IPPROTO_SCTP, "sctp"),
#endif
- INTMAP_ENTRY(IPPROTO_IPV6, "ipv6"),
INTMAP_ENTRY(IPPROTO_ICMPV6, "icmpv6"),
INTMAP_ENTRY_LAST
};
@@ -1124,7 +1125,7 @@ virNWFilterRuleDetailsParse(xmlNodePtr n
nwItemDesc *item;
int int_val;
unsigned int uint_val;
- void *data_ptr, *storage_ptr;
+ void *data_ptr = NULL, *storage_ptr;
valueValidator validator;
char *match = virXMLPropString(node, "match");
nwIPAddress ipaddr;
@@ -1550,7 +1551,7 @@ virNWFilterRuleParse(xmlNodePtr node)
char *direction;
char *prio;
int found;
- int found_i;
+ int found_i = 0;
unsigned int priority;
xmlNodePtr cur;
14 years, 7 months
[libvirt] [PATCH] Fix compiler warning about unused conn parameter
by Matthias Bolte
This only affects builds without NUMA support.
---
I just pushed this patch.
src/nodeinfo.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 402a6b7..4d7fac1 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -450,7 +450,7 @@ int nodeCapsInitNUMA(virCapsPtr caps ATTRIBUTE_UNUSED) {
return 0;
}
-int nodeGetCellsFreeMemory(virConnectPtr conn,
+int nodeGetCellsFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED,
unsigned long long *freeMems ATTRIBUTE_UNUSED,
int startCell ATTRIBUTE_UNUSED,
int maxCells ATTRIBUTE_UNUSED)
@@ -460,7 +460,7 @@ int nodeGetCellsFreeMemory(virConnectPtr conn,
return -1;
}
-unsigned long long nodeGetFreeMemory(virConnectPtr conn)
+unsigned long long nodeGetFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED)
{
nodeReportError(VIR_ERR_NO_SUPPORT, "%s",
_("NUMA memory information not available on this platform"));
--
1.6.3.3
14 years, 7 months
[libvirt] Sys::Virt Perl bindings - calling newSVpv with unsafe length
by Richard W.M. Jones
Dan,
After tracking down a very obscure bug in hivex & libguestfs Perl
bindings, I started looking for places where we call newSVpv with a
variable length argument that could be zero. In such cases, one
should call newSVpvn instead, otherwise Perl will try to use strlen()
to calculate the length of the data buffer when length is passed in as
zero [I'm sure you are aware of this already].
There seems to be one such case in the Sys::Virt bindings:
http://cpansearch.perl.org/src/DANBERR/Sys-Virt-0.2.3/Virt.xs
CODE:
if ((bytes = virSecretGetValue(sec, &len, flags)) == NULL) {
_croak_error(virConnGetLastError(virSecretGetConnect(sec)));
}
RETVAL = newSVpv((char*)bytes, len);
Maybe 'len' can never be zero here, but I think it's safer to turn
this into a call to newSVpvn anyway.
Also, if you look at the source to newSVpv:
http://github.com/mirrors/perl/blob/blead/sv.c#L7752
You'll see there is an extra test, not present with newSVpvn. So it's
better to always call newSVpvn wherever there is a constant-sized
buffer, eg in code like this:
if ((virDomainGetUUID(dom, rawuuid)) < 0) {
_croak_error(virConnGetLastError(virDomainGetConnect(dom)));
}
RETVAL = newSVpv((char*)rawuuid, sizeof(rawuuid));
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
14 years, 7 months