- 09 7月, 2019 1 次提交
-
-
由 Eric Blake 提交于
Even though we don't accept any flags, it is unfriendly to callers that use the modern API to have to fall back to the flag-free API. Signed-off-by: NEric Blake <eblake@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
- 09 5月, 2019 3 次提交
-
-
由 Eric Blake 提交于
This brings about a couple of benefits: - use of VIR_AUTOUNREF() simplifies several callers - Fixes a todo about virDomainMomentObjList not being polymorphic enough Signed-off-by: NEric Blake <eblake@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Eric Blake 提交于
VIR_CLASS_NEW insists that descendents of virObject have 'parent' as the name of their inherited base class member at offset 0. While it would be possible to write a new class-creation macro that takes the actual field name 'current', and rewrite VIR_CLASS_NEW to call the new macro with the hard-coded name 'parent', it seems less confusing if all object code uses similar naming. Thus, this is a mechanical rename in preparation of making virDomainSnapshotDef a descendent of virObject. Signed-off-by: NEric Blake <eblake@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Eric Blake 提交于
VIR_CLASS_NEW insists that descendents of virObject have 'parent' as the name of their inherited base class member at offset 0. While it would be possible to write a new class-creation macro that takes the actual field name, and rewrite VIR_CLASS_NEW to call the new macro with the hard-coded name 'parent', so that we could make virDomainMomentDef use a custom name for its base class, it seems less confusing if all object code uses similar naming. Thus, this is a mechanical rename in preparation of making virDomainSnapshotDef a descendent of virObject, when we can no longer use 'parent' for a different purpose than the base class. Signed-off-by: NEric Blake <eblake@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
- 10 4月, 2019 1 次提交
-
-
由 Han Han 提交于
Define VMX_CONFIG_FORMAT_ARGV to replace the hardcoded 'vmware-vmx' string used by the domxml-X-native APIs. This follows the pattern used by other drivers. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NHan Han <hhan@redhat.com>
-
- 22 3月, 2019 2 次提交
-
-
由 Eric Blake 提交于
Pull out the common parts of virDomainSnapshotDef that will be reused for virDomainCheckpointDef into a new base class. Adjust all callers that use the direct fields (some of it is churn that disappears when the next patch refactors virDomainSnapshotObj; oh well...). Someday, I hope to switch this type to be a subclass of virObject, but that requires a more thorough audit of cleanup paths, and besides minimal incremental changes are easier to review. As for the choice of naming: I promised my teenage daughter Evelyn that I'd give her credit for her contribution to this commit. I asked her "What would be a good name for a base class for DomainSnapshot and DomainCheckpoint". After explaining what a base class was (using the classic OOB Square and Circle inherit from Shape), she came up with "DomainMoment", which is way better than my initial thought of "DomainPointInTime" or "DomainPIT". Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Eric Blake 提交于
The only use for the 'current' member of virDomainSnapshotDef was with the PARSE/FORMAT_INTERNAL flag for controlling an internal-use <active> element marking whether a particular snapshot definition was current, and even then, only by the qemu driver on output, and by qemu and test driver on input. But this duplicates vm->snapshot_current, and gets in the way of potential simplifications to have qemu store a single file for all snapshots rather than one file per snapshot. Get rid of the member by adding a bool* parameter during parse (ignored if the PARSE_INTERNAL flag is not set), and by adding a new flag during format (if FORMAT_INTERNAL is set, the value printed in <active> depends on the new FORMAT_CURRENT). Then update the qemu driver accordingly, which involves hoisting assignments to vm->current_snapshot to occur prior to any point where a snapshot XML file is written (although qemu kept vm->current_snapshot and snapshot->def_current in sync by the end of the function, they were not always identical in the middle of functions, so the shuffling gets a bit interesting). Later patches will clean up some of that confusing churn to vm->current_snapshot. Note: even if later patches refactor qemu to no longer use FORMAT_INTERNAL for output (by storing bulk snapshot XML instead), we will always need PARSE_INTERNAL for input (because on upgrade, a new libvirt still has to parse XML left from a previous libvirt). Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 08 3月, 2019 1 次提交
-
-
由 Eric Blake 提交于
virDomainSnapshotDefFormat currently takes two sets of knobs: an 'unsigned int flags' argument that can currently just be VIR_DOMAIN_DEF_FORMAT_SECURE, and an 'int internal' argument used as a bool to determine whether to output an additional element. It then reuses the 'flags' knob to call into virDomainDefFormatInternal(), which takes a different set of flags. In fact, prior to commit 0ecd6851 (1.2.12), the 'flags' argument actually took the public VIR_DOMAIN_XML_SECURE, which was even more confusing. Let's borrow from the style of that earlier commit, by introducing a function for translating from the public flags (VIR_DOMAIN_SNAPSHOT_XML_SECURE was just recently introduced) into a new enum specific to snapshot formatting, and adjust all callers to use snapshot-specific enum values when formatting, and where the formatter now uses a new variable 'domainflags' to make it obvious when we are translating from snapshot flags back to domain flags. We don't even have to use the conversion function for drivers that don't accept the public VIR_DOMAIN_SNAPSHOT_XML_SECURE flag. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 07 3月, 2019 1 次提交
-
-
由 Andrea Bolognani 提交于
Despite its name, this is really just a general-purpose string manipulation function, so it should be moved to the virstring module and renamed accordingly. In addition to the obvious s/File/String/, also tweak the name to make it clear that the presence of the suffix is verified using case-insensitive comparison. A few trivial whitespace changes are squashed in. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> ACKed-by: NPeter Krempa <pkrempa@redhat.com>
-
- 20 2月, 2019 1 次提交
-
-
由 Eric Blake 提交于
Many drivers had a comment that they did not validate the incoming 'flags' to virDomainGetXMLDesc() because they were relying on virDomainDefFormat() to do it instead. This used to be the case (at least since 461e0f1a and friends in 0.9.4 added unknown flag checking in general), but regressed in commit 0ecd6851 (1.2.12), when all of the drivers were changed to pass 'flags' through the new helper virDomainDefFormatConvertXMLFlags(). Since this helper silently ignores unknown flags, we need to implement flag checking in each driver instead. Annoyingly, this means that any new flag values added will silently be ignored when targeting an older libvirt, rather than our usual practice of loudly diagnosing an unsupported flag. Add comments in domain_conf.[ch] to remind us to be extra vigilant about the impact when adding flags (a new flag to add data is safe if the older server omitting the requested data doesn't break things in the newer client; a new flag to suppress data rather than enhancing the existing VIR_DOMAIN_XML_SECURE may form a data leak or even a security hole). In the qemu driver, there are multiple callers all funnelling to qemuDomainDefFormatBufInternal(); many of them already validated flags (and often only a subset of the full set of possible flags), but for ease of maintenance, we can also check flags at the common helper function. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 16 8月, 2018 1 次提交
-
-
由 John Ferlan 提交于
Now that the virAuthGet*Path API's generate all the error messages we can remove them from the callers. This means that we will no longer overwrite the error from the API. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NMarcos Paulo de Souza <marcos.souza.org@gmail.com>
-
- 14 8月, 2018 1 次提交
-
-
由 Marcos Paulo de Souza 提交于
Since they are done inside virAuthGetPassword and virAuthGetUsername when needed. Signed-off-by: NMarcos Paulo de Souza <marcos.souza.org@gmail.com>
-
- 13 8月, 2018 1 次提交
-
-
由 Marcos Paulo de Souza 提交于
Commit 6c0d0210 changed the behavior of virStr*cpy* functions, so now the nodeGetInfo call fails. Version 4.1.0 (default for Fedora 28) works: Model: Intel Core i7-4500U CPU @ 1.80G Current master tries to write "Intel Core i7-4500U CPU @ 1.80GHz", but the string is bigger than nodeinfo->model (which is a char[32]). So this patch "cuts" the string, and presents the same output from 4.1.0. Signed-off-by: NMarcos Paulo de Souza <marcos.souza.org@gmail.com>
-
- 03 8月, 2018 1 次提交
-
-
由 Matthias Bolte 提交于
Since commit ae83e02f#l3393 the newPowerInfo pointer itself is used to track the ownership of the AutoStartPowerInfo object to make Coverity understand the code better. This broke the code that unset some members of the AutoStartPowerInfo object that should not be freed the normal way. Instead, transfer ownership of the AutoStartPowerInfo object to the HostAutoStartManagerConfig object before filling in the values that need special handling. This allows to free the AutoStartPowerInfo directly without having to deal with the special values, or to let the old (now restored) logic handle the special values again. Signed-off-by: NMatthias Bolte <matthias.bolte@googlemail.com> Tested-by: NMarcos Paulo de Souza <marcos.souza.org@gmail.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 23 7月, 2018 2 次提交
-
-
由 Andrea Bolognani 提交于
Currently, the functions return a pointer to the destination buffer on success or NULL on failure. Not only does this kind of error handling look quite alien in the context of libvirt, where most functions return zero on success and a negative int on failure, but it's also somewhat pointless because unless there's been a failure the returned pointer will be the same one passed in by the user, thus offering no additional value. Change the functions so that they return an int instead. Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
-
由 Andrea Bolognani 提交于
The way virStrncpy() is called here will never result in buffer overflow, but it won't prevent or detect truncation either, despite what the error message might suggest. Use virStrcpyStatic(), which does all of the above, instead. Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
-
- 11 7月, 2018 1 次提交
-
-
由 Marcos Paulo de Souza 提交于
ESX driver can't function without a server being informed, so this flag makes libvirt to check for a valid server before calling connectOpen. Signed-off-by: NMarcos Paulo de Souza <marcos.souza.org@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 04 7月, 2018 2 次提交
-
-
由 Marcos Paulo de Souza 提交于
By using this macro we can avoid boilerplate code to check for arrays of objects from ESX driver. This replacement was done using the coccinelle script bellow: @@ identifier ptr; @@ -if (!ptr || *ptr) { ... } +ESX_VI_CHECK_ARG_LIST(ptr); Signed-off-by: NMarcos Paulo de Souza <marcos.souza.org@gmail.com>
-
由 Michal Privoznik 提交于
The function call esxVI_LookupVirtualMachineByName(occurrence = OptionalItem) and then checks if @virtualMachine is NULL. If it is an error is reported. The same result can be achieved by setting occurrence to RequiredItem. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 03 7月, 2018 2 次提交
-
-
由 Marcos Paulo de Souza 提交于
Instead of duplicating code to do the same checking. Now all functions of virHypervisorDriver from esx driver are using this macro. Signed-off-by: NMarcos Paulo de Souza <marcos.souza.org@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Marcos Paulo de Souza 提交于
Signed-off-by: NMarcos Paulo de Souza <marcos.souza.org@gmail.com>
-
- 04 5月, 2018 1 次提交
-
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 12 4月, 2018 3 次提交
-
-
由 Daniel P. Berrangé 提交于
Avoid the need for the drivers to explicitly check for a NULL path by making sure it is at least the empty string. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Ensuring that we don't call the virDrvConnectOpen method with a NULL URI means that the drivers can drop various checks for NULL URIs. These were not needed anymore since the probe functionality was split Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Declare what URI schemes a driver supports in its virConnectDriver struct. This allows us to skip trying to open the driver entirely if the URI scheme doesn't match. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 16 3月, 2018 1 次提交
-
-
由 Marc Hartmayer 提交于
Add typedef for the anonymous enum used for the driver features. This allows the usage of the type in a switch statement and taking advantage of the compilers feature to detect uncovered cases. Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 22 2月, 2018 1 次提交
-
-
由 Daniel P. Berrangé 提交于
Ensure all enum cases are listed in switch statements, or explicitly cast away enum type where we don't want to list all cases. Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 03 11月, 2017 1 次提交
-
-
由 Andrea Bolognani 提交于
Right-aligning backslashes when defining macros or using complex commands in Makefiles looks cute, but as soon as any changes is required to the code you end up with either distractingly broken alignment or unnecessarily big diffs where most of the changes are just pushing all backslashes a few characters to one side. Generated using $ git grep -El '[[:blank:]][[:blank:]]\\$' | \ grep -E '*\.([chx]|am|mk)$$' | \ while read f; do \ sed -Ei 's/[[:blank:]]*[[:blank:]]\\$/ \\/g' "$f"; \ done Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
-
- 04 9月, 2017 1 次提交
-
-
由 Richard W.M. Jones 提交于
If you use the VDDK library to access virtual machines remotely, you really need to know the Managed Object Reference ("moref") of the VM. This must be passed each time you connect to the API. For example nbdkit's VDDK plugin requires a moref to be passed to mount up a VM's disk remotely: nbdkit vddk user=root password=+/tmp/rootpw \ server=esxi.example.com thumbprint=xx:xx:xx:... \ vm=moref=2 \ file="[datastore1] Fedora/Fedora.vmdk" Getting the moref is a huge pain. To get some idea of what it is, why it is needed, and how much trouble it is to get it, see: https://blogs.vmware.com/vsphere/2012/02/uniquely-identifying-virtual-machines-in-vsphere-and-vcloud-part-1-overview.html https://blogs.vmware.com/vsphere/2012/02/uniquely-identifying-virtual-machines-in-vsphere-and-vcloud-part-2-technical.html However the moref is available conveniently in the internals of the libvirt VMX driver. This patch exposes it as a custom XML element using the same "vmware:" namespace which was previously used for the datacenterpath (see libvirt commit 636a9905). It appears in the XML like this: <domain type='vmware' xmlns:vmware='http://libvirt.org/schemas/domain/vmware/1.0'> <name>Fedora</name> ... <vmware:datacenterpath>ha-datacenter</vmware:datacenterpath> <vmware:moref>2</vmware:moref> </domain> Note that the moref can appear as either a simple ID (for esx:// connections) or as a "vm-<ID>" (for vpx:// connections). It should be treated by users as an opaque string. Signed-off-by: NRichard W.M. Jones <rjones@redhat.com>
-
- 07 6月, 2017 1 次提交
-
-
由 Jiri Denemark 提交于
This will be used later when a save cookie will become part of the snapshot XML using new driver specific parser/formatter functions. Signed-off-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
-
- 03 4月, 2017 1 次提交
-
-
由 Michal Privoznik 提交于
So far our code is full of the following pattern: dom = virGetDomain(conn, name, uuid) if (dom) dom->id = 42; There is no reasong why it couldn't be just: dom = virGetDomain(conn, name, uuid, id); After all, client domain representation consists of tuple (name, uuid, id). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 22 11月, 2016 1 次提交
-
-
由 Sławek Kapłoński 提交于
New line character in name of domain is now forbidden because it mess virsh output and can be confusing for users. Validation of name is done in drivers, after parsing XML to avoid problems with dissappeared domains which was already created with new-line char in name. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 26 9月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
We want to pass the proper opaque pointer instead of NULL to virDomainDefParse and subsequently virDomainDefParseNode too. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 23 9月, 2016 1 次提交
-
-
由 Nitesh Konkar 提交于
Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
-
- 13 7月, 2016 1 次提交
-
-
由 Tomáš Golembiovský 提交于
When fetching domains with virConnectListAllDomains() and when filtering by snapshot existence is requested the ESX driver first lists all the domains and then check one-by-one for snapshot existence. This process takes unnecessarily long time. To significantly improve the time necessary to finish the query we can request the snapshot related info directly when querying the list of domains from VMware. Signed-off-by: NTomáš Golembiovský <tgolembi@redhat.com>
-
- 27 6月, 2016 1 次提交
-
-
由 Laine Stump 提交于
I'm tired of mistyping this all the time, so let's do it the same all the time (similar to how we changed all "Pci" to "PCI" awhile back). (NB: I've left alone some things in the esx and vbox drivers because I'm unable to compile them and they weren't obviously *not* a part of some API. I also didn't change a couple of variables named, e.g. "somethingIptables", because they were derived from the name of the "iptables" command)
-
- 08 6月, 2016 1 次提交
-
-
由 Daniel P. Berrange 提交于
The virConnectOpenInternal method opens the libvirt client config file and uses it to resolve things like URI aliases. There may be driver specific things that are useful to store in the config file too, so rather than have them re-parse the same file, pass the virConfPtr down to the drivers. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 07 6月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
Make it obvious that the flag is controlling RNG schema validation.
-
- 27 5月, 2016 1 次提交
-
-
由 Dawid Zamirski 提交于
This patch fixes an issue where screenshot API call was failing when the esx/vcenter password contains special characters such as apostrophee. The reason for failures was that passwords were escaped for XML and stored in esxVI_Context which was then passed to raw CURL API calls where the password must be passed in original form to authenticate successfully. So this patch addresses this by storing original passwords in the esxVI_Context struct and escape only for esxVI_Login call.
-
- 05 2月, 2016 1 次提交
-
-
由 Joao Martins 提交于
The virDomainSnapshotDefFormat calls into virDomainDefFormat, so should be providing a non-NULL virCapsPtr instance. On the qemu driver we change qemuDomainSnapshotWriteMetadata to also include caps since it calls virDomainSnapshotDefFormat. Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
-