- 24 11月, 2016 1 次提交
-
-
由 Nitesh Konkar 提交于
Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
-
- 18 4月, 2016 1 次提交
-
-
由 Jason J. Herne 提交于
virTypedParamsValidate currently uses an index based check to find duplicate parameters. This check does not work. Consider the following simple example: We have only 2 keys A (multiples allowed) B (multiples NOT allowed) We are given the following list of parameters to check: A A B If you work through the validation loop you will see that our last iteration through the loop has i=2 and j=1. In this case, i > j and keys[j].value.i will indicate that multiples are not allowed. Both conditionals are satisfied so an incorrect error will be given: "parameter '%s' occurs multiple times" This patch replaces the index based check with code that remembers the name of the last parameter seen and only triggers the error case if the current parameter name equals the last one. This works because the list is sorted and duplicate parameters will be grouped together. In reality, we hit this bug while using selective block migration to migrate a guest with 5 disks. 5 was apparently just the right number to push i > j and hit this bug. virsh migrate --live guestname --copy-storage-all --migrate-disks vdb,vdc,vdd,vde,vdf qemu+ssh://dsthost/systemSigned-off-by: NJason J. Herne <jjherne@linux.vnet.ibm.com> Reviewed-by: NEric Farman <farman@linux.vnet.ibm.com>
-
- 03 2月, 2016 3 次提交
-
-
由 Erik Skultety 提交于
Same as for deserializer, this method might get handy for admin one day. The major reason for this patch is to stay consistent with idea, i.e. when deserializer can be shared, why not serializer as well. The only problem to be solved was that the daemon side serializer uses a code snippet which handles sparse arrays returned by some APIs as well as removes any string parameters that can't be returned to older clients. This patch makes of the new virTypedParameterRemote datatype introduced by one of the pvious patches.
-
由 Erik Skultety 提交于
Since the method is static to remote_driver, it can't even be used by our daemon. Other than that, it would be useful to be able to use it with admin as well. This patch uses the new virTypedParameterRemote datatype introduced in one of previous patches.
-
由 Erik Skultety 提交于
Currently, the deserializer is hardcoded into remote_driver which makes it impossible for admin to use it. One way to achieve a shared implementation (besides moving the code to another module) would be pass @ret_params_val as a void pointer as opposed to the remote_typed_param pointer and add a new extra argument specifying which of those two protocols is being used and typecast the pointer at the function entry. An example from remote_protocol: struct remote_typed_param_value { int type; union { int i; u_int ui; int64_t l; uint64_t ul; double d; int b; remote_nonnull_string s; } remote_typed_param_value_u; }; typedef struct remote_typed_param_value remote_typed_param_value; struct remote_typed_param { remote_nonnull_string field; remote_typed_param_value value; }; That would leave us with a bunch of if-then-elses that needed to be used across the method. This patch takes the other approach using the new datatype introduced in one of earlier commits.
-
- 02 7月, 2015 1 次提交
-
-
由 John Ferlan 提交于
Avoid a false positive since Coverity find a path in virResizeN which could return 0 prior to the allocation of memory and thus flags a possible NULL dereference. Instead allocate the output buffer based on 'nparams' and only fill it partially if need be - shouldn't be too much a waste of space. Quicker than multiple VIR_RESIZE_N calls or two loops of STREQ's sandwiched around a single VIR_ALLOC_N using 'n' matches from a first loop to generate the 'n' addresses to return Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 18 6月, 2015 4 次提交
-
-
由 Pavel Boldin 提交于
The `virTypedParamsAddStringList' function provides interface to add a NULL-terminated array of string values as a multi-value to the params. Signed-off-by: NPavel Boldin <pboldin@mirantis.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Pavel Boldin 提交于
Add multikey API: * virTypedParamsFilter that filters all the parameters with specified name. * virTypedParamsGetStringList that returns a list with all the values for specified name and string type. Signed-off-by: NPavel Boldin <pboldin@mirantis.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Pavel Boldin 提交于
Allow multi-value parameters to be build using virTypedParamsAdd* functions by removing check for duplicates. Signed-off-by: NPavel Boldin <pboldin@mirantis.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Pavel Boldin 提交于
The `virTypedParamsValidate' function now can be instructed to allow multiple entries for some of the keys. For this flag the type with the `VIR_TYPED_PARAM_MULTIPLE' flag. Add unit tests for this new behaviour. Signed-off-by: NPavel Boldin <pboldin@mirantis.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 05 9月, 2014 1 次提交
-
-
由 Eric Blake 提交于
Our style overwhelmingly uses hanging braces (the open brace hangs at the end of the compound condition, rather than on its own line), with the primary exception of the top level function body. Fix the few remaining outliers, before adding a syntax check in a later patch. * src/interface/interface_backend_netcf.c (netcfStateReload) (netcfInterfaceClose, netcf_to_vir_err): Correct use of { in compound statement. * src/conf/domain_conf.c (virDomainHostdevDefFormatSubsys) (virDomainHostdevDefFormatCaps): Likewise. * src/network/bridge_driver.c (networkAllocateActualDevice): Likewise. * src/util/virfile.c (virBuildPathInternal): Likewise. * src/util/virnetdev.c (virNetDevGetVirtualFunctions): Likewise. * src/util/virnetdevmacvlan.c (virNetDevMacVLanVPortProfileCallback): Likewise. * src/util/virtypedparam.c (virTypedParameterAssign): Likewise. * src/util/virutil.c (virGetWin32DirectoryRoot) (virFileWaitForDevices): Likewise. * src/vbox/vbox_common.c (vboxDumpNetwork): Likewise. * tests/seclabeltest.c (main): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 25 3月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
-
- 04 1月, 2014 1 次提交
-
-
由 Eric Blake 提交于
Having one API call into another is generally not good; among other issues, it gives confusing logs, and is not quite as efficient. This fixes several instances, but not all: we still have instances in both libvirt.c and in backend hypervisors (lxc and qemu) calling the public virTypedParamsGetString and friends, which dispatch errors immediately. I'm not sure if it is worth trying to clean that up in a separate patch (such a cleanup may be easiest by separating the public function into a wrapper around the internal, then tweaking internal.h so that internal users directly use the internal function). * src/libvirt.c (virDomainGetUUIDString, virNetworkGetUUIDString) (virStoragePoolGetUUIDString, virSecretGetUUIDString) (virNWFilterGetUUIDString): Avoid nested public API call. * src/util/virtypedparam.c (virTypedParamsReplaceString): Don't dispatch errors here. (virTypedParamsGet): No need to reset errors. (virTypedParamsGetBoolean): Use consistent ordering. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 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 提交于
-
- 25 6月, 2013 6 次提交
-
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
All APIs that take typed parameters are only using params address in their entry point debug messages. With the new VIR_TYPED_PARAMS_DEBUG macro, all functions can easily log all individual typed parameters passed to them.
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
This API is useful for checking whether only a specific subset of supported typed parameters were passed.
-
由 Jiri Denemark 提交于
When unsupported parameter is passed to virTypedParamsValidate, VIR_ERR_ARGUMENT_UNSUPPORTED should be returned rather than VIR_ERR_INVALID_ARG, which is more appropriate for supported parameters used incorrectly.
-
由 Jiri Denemark 提交于
-
- 24 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.
-
- 19 2月, 2013 1 次提交
-
-
由 Jiri Denemark 提交于
The function does not report any errors so there should be no need too reset an existing error first. Moreover, virTypedParamsFree is mostly called in cleanup phase where it has the potential to reset any useful reported earlier.
-
- 18 1月, 2013 2 次提交
-
-
由 Jiri Denemark 提交于
The function is just a renamed public version of former virTypedParameterArrayClear.
-
由 Jiri Denemark 提交于
Working with virTypedParameters in clients written in C is ugly and requires all clients to duplicate the same code. This set of APIs makes this code for manipulating with virTypedParameters integral part of libvirt so that all clients may benefit from it.
-
- 21 12月, 2012 3 次提交
-
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-
- 03 12月, 2012 1 次提交
-
-
由 Peter Krempa 提交于
-
- 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/
-
- 07 9月, 2012 1 次提交
-
-
由 Peter Krempa 提交于
This patch adds a helper to deal with assigning values to virTypedParameter structures from strings. The helper parses the value from the string and assigns it to the corresponding union value.
-
- 23 7月, 2012 1 次提交
-
-
由 Osier Yang 提交于
Per the FSF address could be changed from time to time, and GNU recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html) You should have received a copy of the GNU General Public License along with Foobar. If not, see <http://www.gnu.org/licenses/>. This patch removes the explicit FSF address, and uses above instead (of course, with inserting 'Lesser' before 'General'). Except a bunch of files for security driver, all others are changed automatically, the copyright for securify files are not complete, that's why to do it manually: src/security/security_selinux.h src/security/security_driver.h src/security/security_selinux.c src/security/security_apparmor.h src/security/security_apparmor.c src/security/security_driver.c
-
- 18 7月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
This removes nearly all the per-file error reporting macros from the code in src/util/. A few custom macros remain for the case, where the file needs to report errors with a variety of different codes or parameters Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 21 1月, 2012 1 次提交
-
-
由 Eric Blake 提交于
When converting a linear enum to a string, we have checks in place in the VIR_ENUM_IMPL macro to ensure that there is one string for every value, which lets us quickly flag if a user added a value but forgot to add a counterpart string. However, this only works if we use the _LAST marker. * cfg.mk (sc_require_enum_last_marker): New syntax check. * src/conf/domain_conf.h (virDomainSnapshotState): Add new marker. * src/conf/domain_conf.c (virDomainSnapshotState): Fix offender. * src/qemu/qemu_monitor_json.c (qemuMonitorWatchdogAction) (qemuMonitorIOErrorAction, qemuMonitorGraphicsAddressFamily): Likewise. * src/util/virtypedparam.c (virTypedParameter): Likewise.
-
- 20 1月, 2012 1 次提交
-
-
由 Eric Blake 提交于
Preparation for another patch that refactors common patterns into the new file for fewer lines of code overall. * src/util/util.h (virTypedParameterArrayClear): Move... * src/util/virtypedparam.h: ...to new file. (virTypedParameterArrayValidate, virTypedParameterAssign): New prototypes. * src/util/util.c (virTypedParameterArrayClear): Likewise. * src/util/virtypedparam.c: New file. * po/POTFILES.in: Mark file for translation. * src/Makefile.am (UTIL_SOURCES): Build it. * src/libvirt_private.syms (util.h): Split... (virtypedparam.h): to new section. (virkeycode.h): Sort. * daemon/remote.c: Adjust callers. * tools/virsh.c: Likewise.
-