- 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>
-
- 13 6月, 2019 1 次提交
-
-
由 Jonathon Jongsma 提交于
Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NJán Tomko <jtomko@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>
-
- 12 4月, 2019 1 次提交
-
-
由 Andrea Bolognani 提交于
Vim has trouble figuring out the filetype automatically because the name doesn't follow existing conventions; annotations like the ones we already have in Makefile.ci help it out. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@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>
-
- 12 2月, 2019 1 次提交
-
-
由 John Ferlan 提交于
Let's make use of the auto __cleanup capabilities cleaning up any now unnecessary goto paths. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 14 12月, 2018 1 次提交
-
-
由 Daniel P. Berrangé 提交于
Require that all headers are guarded by a symbol named LIBVIRT_$FILENAME where $FILENAME is the uppercased filename, with all characters outside a-z changed into '_'. Note we do not use a leading __ because that is technically a namespace reserved for the toolchain. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 20 9月, 2018 2 次提交
-
-
由 Erik Skultety 提交于
All of the ones being removed are pulled in by internal.h. The only exception is sanlock which expects the application to include <stdint.h> before sanlock's headers, because sanlock prototypes use fixed width int, but they don't include stdint.h themselves, so we have to leave that one in place. Signed-off-by: NErik Skultety <eskultet@redhat.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Erik Skultety 提交于
It doesn't really make sense for us to have stdlib.h and string.h but not stdio.h in the internal.h header. Signed-off-by: NErik Skultety <eskultet@redhat.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 17 9月, 2018 1 次提交
-
-
由 Shi Lei 提交于
Signed-off-by: NShi Lei <shi_lei@massclouds.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 2 次提交
-
-
由 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>
-
由 Marcos Paulo de Souza 提交于
When building libvirt with libcurl debug enabled (with ESX_VI__CURL__ENABLE_DEBUG_OUTPUT set), the message bellow pops up: make[3]: Entering directory '/mnt/data/gitroot/libvirt/src' CC esx/libvirt_driver_esx_la-esx_vi.lo esx/esx_vi.c: In function 'esxVI_CURL_Debug': esx/esx_vi.c:191:5: error: enumeration value 'CURLINFO_SSL_DATA_IN' not handled in switch [-Werror=switch-enum] switch (type) { ^~~~~~ esx/esx_vi.c:191:5: error: enumeration value 'CURLINFO_SSL_DATA_OUT' not handled in switch [-Werror=switch-enum] esx/esx_vi.c:191:5: error: enumeration value 'CURLINFO_END' not handled in switch [-Werror=switch-enum] Our build requires at least libcurl 7.18.0, which is pretty stable since it was release in 2008. Fix this problem by handling the mentioned enums in the code. Signed-off-by: NMarcos Paulo de Souza <marcos.souza.org@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.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>
-
- 25 7月, 2018 2 次提交
-
-
由 Shi Lei 提交于
With 'switch' we can utilize the compile time enum checks which we can't rely on with plain 'if' conditions. Signed-off-by: NShi Lei <shilei.massclouds@gmx.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Marcos Paulo de Souza 提交于
Commit 77298458 changed the esx storage adapter from busLogic to lsilogic, introducing a typo. Changing it back to lsiLogic (with capital L) solves the issue. With this change, libvirt can now create volumes in ESX again. Thanks to Jaroslav Suchanek who figured out what was the issue in the first place. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1571759Signed-off-by: NMarcos Paulo de Souza <marcos.souza.org@gmail.com>
-
- 23 7月, 2018 3 次提交
-
-
由 Andrea Bolognani 提交于
We're going to change virStrncpy() in a way that requires the source string to be NULL-terminated, so we'll no longer be able to use in this context. Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
-
由 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 4 次提交
-
-
由 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>
-
由 Marcos Paulo de Souza 提交于
This macro avoids code duplication when checking for arrays of objects. Signed-off-by: NMarcos Paulo de Souza <marcos.souza.org@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.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>
-
由 Michal Privoznik 提交于
When reviewing 00d9edfe I've changed proposed patch and made it to not report error if no domain is found. This is wrong and the original patch was okay. Thing is, both callers pass occurrence = OptionalItem so no error message overwriting is done as I thought initially. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 03 7月, 2018 3 次提交
-
-
由 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 提交于
The same pattern is used in lots of other places. Also, reporting error message is not desired because all callers check the return value and report errors on their own. 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>
-
- 14 5月, 2018 2 次提交
-
-
由 Ján Tomko 提交于
Do not rely on gnulib's MD5_DIGEST_SIZE from md5.h. Include vircrypto.h and use VIR_CRYPTO_HASH_SIZE_MD5. Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
Instead of using md5_buffer from gnulib directly. Signed-off-by: NJán Tomko <jtomko@redhat.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 2 次提交
-
-
由 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>
-