- 11 7月, 2019 1 次提交
-
-
由 Eric Blake 提交于
We've been doing a terrible job of performing XML validation in our various API that parse XML with a corresponding schema (we started with domains back in commit dd69a14f, v1.2.12, but didn't catch all domain-related APIs, didn't document the use of the flag, and didn't cover other XML). New APIs (like checkpoints) should do the validation unconditionally, but it doesn't hurt to continue retrofitting existing APIs to at least allow the option. While there are many APIs that could be improved, this patch focuses on wiring up a new snapshot XML creation flag through all the hypervisors that support snapshots, as well as exposing it in 'virsh snapshot-create'. For 'virsh snapshot-create-as', we blindly set the flag without a command-line option, since the XML we create from the command line should generally always comply (note that validation might cause failures where it used to succeed, such as if we tighten the RNG to reject a name of '../\n'); but blindly passing the flag means we also have to add in fallback code to disable validation if the server is too old to understand the flag. Signed-off-by: NEric Blake <eblake@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
- 27 3月, 2019 1 次提交
-
-
由 Eric Blake 提交于
Since I was copying this text to form checkpoint XML and API documentation, I might as well make improvements along the way. Most of these changes are based on reviews of the checkpoint docs. Among other things: grammar tweaks, point to a single source of documentation rather than repeating verbosity, reword things for easier legibility. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 15 3月, 2019 1 次提交
-
-
由 Eric Blake 提交于
Based on recent list questions about the proposed addition of virDomainCheckpointCreateXML(REDEFINE), it is worth adding some clarification to the existing snapshot redefine documentation that is serving as the basis for checkpoints. Normal snapshot creation requires very few elements from the user XML (libvirt can pick sane defaults for items that are omitted, and many fields, including <domain>, are documented as readonly output fields ignored on input, produced by drivers that track it). But during REDEFINE, the API wants the complete XML produced by an earlier virDomainSnapshotGetXMLDesc; as the domain definition has likely changed since the snapshot was first created, libvirt is unable to recreate a <domain> sub-element that matches the original output representing the domain state at the time the snapshot was first created. In fact, reverting without a <domain> sub-element is risky enough that we had to add a FORCE flag for virDomainSnapshotRevert(). In short, we only support omitting domain for qemu because of backwards-compatibility to snapshots created before 0.9.5 started capturing <domain>; even though there are other drivers like vbox that do not output <domain> because they have other reliable ways to revert. And based on the confusion caused when omitting <domain> from snapshot XML, the initial design for checkpoints in later patches will make <domain> a mandatory element during its REDEFINE. [Side note: the fact that <domain> can appear in <domainsnapshot> is a reason we cannot add a new API for a bulk listing or redefine of all snapshots of a single domain in one XML call (for example, a 1M <domain> XML * 16 snapshots explodes into 16M in a bulk form, which gets difficult to send over RPC). Perhaps we could add a flag to request that the <domain> sub-element be omitted on output, but such output is no longer suitable for sane REDEFINE input.] Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 14 3月, 2019 1 次提交
-
-
由 Eric Blake 提交于
We copy-and-paste a lot of our docs, as evidenced by the number of *GetXMLDesc() functions which had the same unusual indentation and missing capital in the second sentence of the returns paragraph. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 13 3月, 2019 1 次提交
-
-
由 Eric Blake 提交于
When using virDomainSnapshotCreateXML with the REDEFINE flag on multiple snapshot metadata XML descriptions, we require that a child cannot be redefined before its parent. Since libvirt already tracks a DAG, it is more convenient if we can ensure that virDomainListAllSnapshots() and friends have a way to return data in an order that we can directly reuse, rather than having to post-process the data ourselves to reconstruct the DAG. Add VIR_DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL as our new guarantee (well, a guarantee at the time of the API call conclusion; there's always a possible TOCTTOU race where someone redefining snapshots in between the API results and the client actually using the list might render the list out-of-date). Four listing APIs are directly benefitted by the new flag; additionally, since we document that the older racy ListNames interfaces should be sized by using the same flags on their Num counterparts, the Num interfaces must document when they accept (and ignore) the flag. We could have supported the new flag just for the ListAll APIs (to discourage people from using the older racy Num/ListNames APIs), but it feels weird to special-case this flag value as being applicable to only a subset of the API while all other List-related flags are trivially applicable to all 6. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 08 3月, 2019 1 次提交
-
-
由 Eric Blake 提交于
Fix an incorrect @xmlDesc comment, as well as adding more details about which XML element should be root. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 27 2月, 2019 1 次提交
-
-
由 Eric Blake 提交于
Upcoming patches plan to introduce virDomainCheckpointPtr as a new object for use in incremental backups, along with documentation on how incremental backups differ from snapshots. But first, we need to rename any existing mention of a 'system checkpoint' to instead be a 'full system snapshot', so that we aren't overloading the term checkpoint. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 20 2月, 2019 1 次提交
-
-
由 Eric Blake 提交于
Commit f609cb85 (0.9.5) introduced virDomainSnapshotGetXMLDesc()'s use of @flags as a subset of virDomainXMLFlags, documenting that 2 of the 3 flags defined at the time would never be valid. Later, commit 28f8dfdc (1.0.0) introduced a new flag, VIR_DOMAIN_XML_MIGRATABLE, but did not adjust the snapshot documentation to declare it as invalid. However, since the flag is not accepted as valid by any of the drivers (remote is just passthrough; esx and vbox don't support flags; qemu, test, and vz only support VIR_DOMAIN_XML_SECURE), and it is unlikely that the domain state saved off during a snapshot creation needs to be migration-friendly (as the snapshot is not the source of a migration), it is easier to just define an explicit set of supported flags directly related to the snapshot API rather than trying to borrow from domain API, and risking confusion if even more domain flags are added later (in fact, I have an upcoming patch that plans to add a new flag to virDomainGetXMLDesc that makes no sense for snapshots). There is no API or ABI impact (since we purposefully used unsigned int rather than an enum type in public API, and since the new flag name carries the same value as the reused name). Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 18 4月, 2018 1 次提交
-
-
由 Michal Privoznik 提交于
Whenever we declare a new object the first member of the struct has to be virObject (or any other member of that family). Now, up until now we did not care about the name of the struct member. But lets unify it so that we can do some checks at compile time later. The unified name is 'parent'. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 25 9月, 2017 1 次提交
-
-
由 Daniel P. Berrange 提交于
Seeing a log message saying 'flags=93' is ambiguous & confusing unless you happen to know that libvirt always prints flags as hex. Change our debug messages so that they always add a '0x' prefix when printing flags, and '0' prefix when printing mode. A few other misc places gain a '0x' prefix in error messages too. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 07 8月, 2017 1 次提交
-
-
由 Daniel P. Berrange 提交于
The API docs for the various vir$OBJECTGetConnect functions contain a warning WARNING: When writing libvirt bindings in other languages, do not use this function. Instead, store the connection and the domain object together. There is no reason why language bindings should not use this method, and indeed the Perl, Python, and Go bindings all use these methods. This warning was originally added back in commit 3edb4bc9 Author: Daniel Veillard <veillard@redhat.com> Date: Tue Jul 24 15:32:55 2007 +0000 * libvirt.spec.in NEWS docs/* po/*: preparing release 0.3.1 * src/libvirt.c python/generator.py: some cleanup and warnings from Richard W.M. Jones IIUC, the rational was that these APIs do not need to be directly exposed to the non-C language, as the language can expose the same concept itself by storing the original virConnectPtr object alongside the virDomainPtr. There's no reason to mandate such an approach though - it is valid for languages to expose this directly if that suits their needs better. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 30 6月, 2015 1 次提交
-
-
由 Andrea Bolognani 提交于
-
- 04 5月, 2015 2 次提交
-
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 14 4月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
When creating a snapshot with _REUSE_EXTERNAL when the pre-created image does not directly link to the current active layer libvirt would re-detect the backing chain incorrectly and it would not match with qemu's view. Since the configuration is an operator mistake, document that only the top layer image gets inserted.
-
- 03 4月, 2015 1 次提交
-
-
由 Noella Ashu 提交于
The error output of snapshot-revert should be more friendly. There is no need to show virDomainRevertToSnapshot to user. virReportError already includes __FUNCTION__ information in a separate member of the struct, so repeating it in the message is redundant and leads to situations where higher level code ends up reporting the lower level name. We correctly converted the error output making it more succinct and user-friendly. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1086726
-
- 24 10月, 2014 1 次提交
-
-
由 Daniel P. Berrange 提交于
Introduce a src/libvirt-domain-snapshot.c file to hold all the methods related to the virDomainSnapshot type.
-