- 14 3月, 2014 1 次提交
-
-
由 Laine Stump 提交于
Many of the domain xml format functions (including all of the device format functions) had hard-coded spaces, which made for incorrect indentation when those functions were called in a different context (for example, commit 2122cf39 added <interface> XML into the document provided to a network hook script, and in this case it should have been indented by 2 spaces, but was instead indented by 6 spaces). To make it possible to insert a properly indented device anywhere into an XML document, this patch removes hardcoded spaces from the formatting functions, and calls virBufferAdjustIndent() at appropriate places instead. (a regex search of domain_conf.c was done to assure that all occurrences of hardcoded spaces were removed). virDomainDiskSourceDefFormatInternal() is also called from snapshot_conf.c, so two virBufferAdjustIndent() calls were temporarily added around that call - those functions will have hardcoded spaces removed in a separate patch. This could cause some conflicts when backporting future changes to the formatting functions to older branches, but fortunately the changes are almost all trivial, so conflict resolution will be obvious.
-
- 14 2月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
All the data for getting the actual type is present in the snapshot config. There is no need to have this function private to the qemu driver and it will be re-used later in other parts of libvirt
-
- 29 1月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
Add support for specifying various types when doing snapshots. This will later allow to do snapshots on network backed volumes. Disks of type 'volume' are not supported by snapshots (yet). Also amend the test suite to check parsing of the various new disk types that can now be specified.
-
- 16 1月, 2014 1 次提交
-
-
由 Christophe Fergeau 提交于
Currently, during XML parsing, when a call to a FromString() function to get an enum value fails, the error which is reported is either VIR_ERR_CONFIG_UNSUPPORTED, VIR_ERR_INTERNAL_ERROR or VIR_ERR_XML_ERROR. This commit makes such conversion failures consistently return VIR_ERR_CONFIG_UNSUPPORTED.
-
- 06 12月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
When changing the parsing and formatting functions in commit 43f2ccdc I forgot to update the qemu disk alignment function for snapshots that automatically adds snapshot configs for disks that were not mentioned in the XML. The function allocated a new disk snapshot definition but did not correctly initialize the snapshot disk source type variable. This resulted into the disks considered as block devices and invalid XML was generated. Reported by John Ferlan.
-
- 02 12月, 2013 2 次提交
-
-
由 Peter Krempa 提交于
Consider the following valid snapshot XML as the <driver> element is allowed to be empty in the domainsnapshot.rng schema: $ cat snap.xml <domainsnapshot> <disks> <disk name='vda' snapshot='external'> <source file='/tmp/foo'/> <driver/> </disk> </disks> </domainsnapshot> produces the following error: $ virsh snapshot-create domain snap.xml error: internal error: unknown disk snapshot driver '(null)' The driver type is parsed as NULL from the XML as the attribute is not present and then directly used to produce the error message. With this patch the attempt to parse the driver type is skipped if not present to avoid changing the schema to forbid the empty driver element.
-
由 Peter Krempa 提交于
Disk source elements for snapshots were using separate code from our config parser. As snapshots can be stored on more than just regular files, we will need the universal parser to allow us to expose a variety of snapshot disk targets. This patch reuses the config parsers and formatters to do the job. This initial support only changes the code without any visible XML change.
-
- 15 10月, 2013 1 次提交
-
-
由 Eric Blake 提交于
'const fooPtr' is the same as 'foo * const' (the pointer won't change, but it's contents can). But in general, if an interface is trying to be const-correct, it should be using 'const foo *' (the pointer is to data that can't be changed). Fix up remaining offenders in src/conf, and their fallout. * src/conf/snapshot_conf.h (virDomainSnapshotAssignDef) (virDomainSnapshotFindByName): Drop attempt at const. * src/conf/interface_conf.h (virInterfaceObjIsActive) (virInterfaceDefFormat): Use intended type. (virInterfaceFindByMACString, virInterfaceFindByName) (virInterfaceAssignDef, virInterfaceRemove): Drop attempt at const. * src/conf/network_conf.h (virNetworkObjIsActive) (virNetworkDefFormat, virNetworkDefForwardIf) (virNetworkDefGetIpByIndex, virNetworkIpDefPrefix) (virNetworkIpDefNetmask): Use intended type. (virNetworkFindByUUID, virNetworkFindByName, virNetworkAssignDef) (virNetworkObjAssignDef, virNetworkRemoveInactive) (virNetworkBridgeInUse, virNetworkSetBridgeName) (virNetworkAllocateBridge): Drop attempt at const. * src/conf/netdev_vlan_conf.h (virNetDevVlanFormat): Make const-correct. * src/conf/node_device_conf.h (virNodeDeviceHasCap) (virNodeDeviceDefFormat): Use intended type. (virNodeDeviceFindByName, virNodeDeviceFindBySysfsPath) (virNodeDeviceAssignDef, virNodeDeviceObjRemove) (virNodeDeviceGetParentHost): Drop attempt at const. * src/conf/secret_conf.h (virSecretDefFormat): Use intended type. * src/conf/snapshot_conf.c (virDomainSnapshotAssignDef) (virDomainSnapshotFindByName): Fix fallout. * src/conf/interface_conf.c (virInterfaceBridgeDefFormat) (virInterfaceBondDefFormat, virInterfaceVlanDefFormat) (virInterfaceProtocolDefFormat, virInterfaceDefDevFormat) (virInterfaceDefFormat, virInterfaceFindByMACString) (virInterfaceFindByName, virInterfaceAssignDef) (virInterfaceRemove): Likewise. * src/conf/network_conf.c (VIR_ENUM_IMPL, virNetworkFindByName, virNetworkObjAssignDef) (virNetworkAssignDef, virNetworkRemoveInactive) (virNetworkDefGetIpByIndex, virNetworkIpDefPrefix) (virNetworkIpDefNetmask, virNetworkDHCPHostDefParseXML) (virNetworkIpDefFormat, virNetworkRouteDefFormat) (virPortGroupDefFormat, virNetworkForwardNatDefFormat) (virNetworkDefFormatInternal, virNetworkBridgeInUse) (virNetworkAllocateBridge, virNetworkSetBridgeName) (virNetworkDNSDefFormat, virNetworkDefFormat): Likewise. * src/conf/netdev_vlan_conf.c (virNetDevVlanFormat): Likewise. * src/conf/node_device_conf.c (virNodeDeviceHasCap) (virNodeDeviceFindBySysfsPath, virNodeDeviceFindByName) (virNodeDeviceAssignDef, virNodeDeviceObjRemove) (virNodeDeviceDefFormat, virNodeDeviceGetParentHost): Likewise. * src/conf/secret_conf.c (virSecretDefFormatUsage) (virSecretDefFormat): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 04 10月, 2013 1 次提交
-
-
由 Cole Robinson 提交于
-
- 26 9月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
The virDomainSnapshotDefParse method assigned to def->ndisks before allocating def->disks. Thus if an OOM occurred, the cleanup code would access out of bounds. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 17 8月, 2013 1 次提交
-
-
由 Cole Robinson 提交于
Similar to how other objects arrange their parse APIs. This will be used by the test driver.
-
- 11 7月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
Convert the type of loop iterators named 'i', 'j', k', 'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or 'unsigned int', also santizing 'ii', 'jj', 'kk' to use the normal 'i', 'j', 'k' naming Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 10 7月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
-
- 19 6月, 2013 1 次提交
-
-
由 Ján Tomko 提交于
Just to reduce the indentation levels. Remove the unneeded NULL check for disk->file, as virBufferEscapeString doesn't print anything with NULL arguments.
-
- 23 5月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
-
- 02 5月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
The source code base needs to be adapted as well. Some files include virutil.h just for the string related functions (here, the include is substituted to match the new file), some include virutil.h without any need (here, the include is removed), and some require both.
-
- 05 4月, 2013 2 次提交
-
-
由 Peter Krempa 提交于
Move the xmlopt and caps arguments to the end of the argument list.
-
由 Peter Krempa 提交于
This patch is the result of running: for i in $(git ls-files | grep -v html | grep -v \.po$ ); do sed -i -e "s/virDomainXMLConf/virDomainXMLOption/g" -e "s/xmlconf/xmlopt/g" $i done and a few manual tweaks.
-
- 13 3月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
The virCaps structure gathered a ton of irrelevant data over time that. The original reason is that it was propagated to the XML parser functions. This patch aims to create a new data structure virDomainXMLConf that will contain immutable data that are used by the XML parser. This will allow two things we need: 1) Get rid of the stuff from virCaps 2) Allow us to add callbacks to check and add driver specific stuff after domain XML is parsed. This first attempt removes pointers to private data allocation functions to this new structure and update all callers and function that require them.
-
- 30 1月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
When a disk-only snapshot is requested the domain is treated as if it was offline. This forbids to mix memory checkpoints with the DISK_ONLY flag. This patch improves the error message and mentions the restriction in the virsh man page.
-
- 05 1月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
Allow to use definition objects with this predicate function.
-
- 21 12月, 2012 9 次提交
-
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 30 11月, 2012 1 次提交
-
-
由 Ján Tomko 提交于
If allocation of names fails, list is uninitialized.
-
- 29 11月, 2012 1 次提交
-
-
由 Ján Tomko 提交于
If it's negative, this might result in a request to allocate lots of memory.
-
- 20 11月, 2012 1 次提交
-
-
由 Eric Blake 提交于
Relatively straight-forward. And since qemu was already using VIR_DOMAIN_SNAPSHOT_FILTERS_ALL, with 6 different APIs all calling into this common code, I've instantly added all 5 flags to 6 APIs. * src/conf/snapshot_conf.h (VIR_DOMAIN_SNAPSHOT_FILTERS_ALL): Enable new filters. * src/conf/snapshot_conf.c (virDomainSnapshotObjListGetNames): Prep the new flags. (virDomainSnapshotObjListCopyNames): Actually do the filtering.
-
- 16 11月, 2012 1 次提交
-
-
由 Eric Blake 提交于
For disk snapshots, the user could request an external snapshot but not supply a filename; later on, we would check this condition and generate a suitable name if possible, or gracefully error out when not possible (such as when the original file was a block device). But unless we come up with a suitable way to generate external memory file names, we have no later code point that was checking for NULL, so we should forbid this up front. * src/conf/snapshot_conf.c (virDomainSnapshotDefParseString): Avoid NULL deref, since we don't generate names yet.
-
- 14 11月, 2012 1 次提交
-
-
由 Peter Krempa 提交于
This patch adds a helper to determine if snapshots are external and uses the helper to fix detection of those in snapshot deletion code. Snapshots are external if they have an external memory image or if the disk locations are external. As mixed snapshots are forbidden for now we need to check just one disk to know.
-
- 03 11月, 2012 1 次提交
-
-
由 Eric Blake 提交于
There were not previous callers with require_match set to true. I originally implemented this bool with the intent of supporting ESX snapshot semantics, where the choice of internal vs. external vs. non-checkpointable must be made at domain start, but as ESX has not been wired up to use it yet, we might as well fix it to work with our next qemu patch for now, and worry about any further improvements (changing the bool to a flags argument) if the ESX driver decides to use this function in the future. * src/conf/snapshot_conf.c (virDomainSnapshotAlignDisks): Alter logic when require_match is true to deal with new XML.
-
- 02 11月, 2012 2 次提交
-
-
由 Eric Blake 提交于
Each <domainsnapshot> can now contain an optional <memory> element that describes how the VM state was handled, similar to disk snapshots. The new element will always appear in output; for back-compat, an input that lacks the element will assume 'no' or 'internal' according to the domain state. Along with this change, it is now possible to pass <disks> in the XML for an offline snapshot; this also needs to be wired up in a future patch, to make it possible to choose internal vs. external on a per-disk basis for each disk in an offline domain. At that point, using the --disk-only flag for an offline domain will be able to work. For some examples below, remember that qemu supports the following snapshot actions: qemu-img: offline external and internal disk savevm: online internal VM and disk migrate: online external VM transaction: online external disk ===== <domainsnapshot> <memory snapshot='no'/> ... </domainsnapshot> implies that there is no VM state saved (mandatory for offline and disk-only snapshots, not possible otherwise); using qemu-img for offline domains and transaction for online. ===== <domainsnapshot> <memory snapshot='internal'/> ... </domainsnapshot> state is saved inside one of the disks (as in qemu's 'savevm' system checkpoint implementation). If needed in the future, we can also add an attribute pointing out _which_ disk saved the internal state; maybe disk='vda'. ===== <domainsnapshot> <memory snapshot='external' file='/path/to/state'/> ... </domainsnapshot> This is not wired up yet, but future patches will allow this to control a combination of 'virsh save /path/to/state' plus disk snapshots from the same point in time. ===== So for 1.0.1 (and later, as needed), I plan to implement this table of combinations, with '*' designating new code and '+' designating existing code reached through new combinations of xml and/or the existing DISK_ONLY flag: domain memory disk disk-only | result ----------------------------------------- offline omit omit any | memory=no disk=int, via qemu-img offline no omit any |+memory=no disk=int, via qemu-img offline omit/no no any | invalid combination (nothing to snapshot) offline omit/no int any |+memory=no disk=int, via qemu-img offline omit/no ext any |*memory=no disk=ext, via qemu-img offline int/ext any any | invalid combination (no memory to save) online omit omit off | memory=int disk=int, via savevm online omit omit on | memory=no disk=default, via transaction online omit no/ext off | unsupported for now online omit no on | invalid combination (nothing to snapshot) online omit ext on | memory=no disk=ext, via transaction online omit int off |+memory=int disk=int, via savevm online omit int on | unsupported for now online no omit any |+memory=no disk=default, via transaction online no no any | invalid combination (nothing to snapshot) online no int any | unsupported for now online no ext any |+memory=no disk=ext, via transaction online int/ext any on | invalid combination (disk-only vs. memory) online int omit off |+memory=int disk=int, via savevm online int no/ext off | unsupported for now online int int off |+memory=int disk=int, via savevm online ext omit off |*memory=ext disk=default, via migrate+trans online ext no off |+memory=ext disk=no, via migrate online ext int off | unsupported for now online ext ext off |*memory=ext disk=ext, via migrate+transaction * docs/schemas/domainsnapshot.rng (memory): New RNG element. * docs/formatsnapshot.html.in: Document it. * src/conf/snapshot_conf.h (virDomainSnapshotDef): New fields. * src/conf/domain_conf.c (virDomainSnapshotDefFree) (virDomainSnapshotDefParseString, virDomainSnapshotDefFormat): Manage new fields. * tests/domainsnapshotxml2xmltest.c: New test. * tests/domainsnapshotxml2xmlin/*.xml: Update existing tests. * tests/domainsnapshotxml2xmlout/*.xml: Likewise.
-
由 Eric Blake 提交于
* src/conf/snapshot_conf.c (virDomainSnapshotDefParseString): Simplify OOM reporting.
-
- 20 10月, 2012 1 次提交
-
-
由 Eric Blake 提交于
This is the last use of raw strings for disk formats throughout the src/conf directory. * src/conf/snapshot_conf.h (_virDomainSnapshotDiskDef): Store enum rather than string for disk type. * src/conf/snapshot_conf.c (virDomainSnapshotDiskDefClear) (virDomainSnapshotDiskDefParseXML, virDomainSnapshotDefFormat): Adjust users. * src/qemu/qemu_driver.c (qemuDomainSnapshotDiskPrepare) (qemuDomainSnapshotCreateSingleDiskActive): Likewise.
-
- 21 9月, 2012 1 次提交
-
-
由 Eric Blake 提交于
https://www.gnu.org/licenses/gpl-howto.html recommends that the 'If not, see <url>.' phrase be a separate sentence. * tests/securityselinuxhelper.c: Remove doubled line. * tests/securityselinuxtest.c: Likewise. * globally: s/; If/. If/
-