- 20 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> (cherry picked from commit 0e570a6a)
-
- 21 10月, 2015 1 次提交
-
-
由 Ishmanpreet Kaur Khera 提交于
We have macros for both positive and negative string matching. Therefore there is no need to use !STREQ or !STRNEQ. At the same time as we are dropping this, new syntax-check rule is introduced to make sure we won't introduce it again. Signed-off-by: NIshmanpreet Kaur Khera <khera.ishman@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 18 6月, 2015 3 次提交
-
-
由 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 提交于
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>
-