- 18 11月, 2017 4 次提交
-
-
由 Martin Kletzander 提交于
Truncate the output so that it is only as big as is needed to fit all the bits, not all the units from the map. This will be needed in the future in order to properly format bitmaps for kernel's sysfs files. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Martin Kletzander 提交于
It is literally only a wrapper around virBitmapNewData() and virBitmapFormat(), only the naming was wrong since it was introduced. And because we have virBitmap*String functions where the meaning of the 'String' is constant, this might confuse someone. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Martin Kletzander 提交于
This follows the virBitmapToData() function and, similarly to virBitmapNewData(), we'll be able to have virBitmapNewString() later on without name confusion. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 29 8月, 2017 1 次提交
-
-
由 Martin Kletzander 提交于
We can now check for the error and not care about the return value as it will be properly handled in virBufferContentAndReset() anyway. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 20 7月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
Since virBitmapSubtract is unused modify it to perform bitmap intersection.
-
- 23 3月, 2017 2 次提交
-
-
由 John Ferlan 提交于
The code checks and handles a NULL 'str', so just remove the NONNULL. Update the error message to add the NULLSTR() around 'str' also. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Rather than returning an int and a *bitmap pointer, just return and check a NULL bitmap pointer
-
- 14 2月, 2017 1 次提交
-
-
由 Ján Tomko 提交于
To make sure bit 'b' fits into the bitmap, we need to allocate b+1 bits, since we number from 0. Adjust the bitmap test to set a bit at a multiple of 16. That way the test fails without this fix, because the VIR_REALLOC call clears the newly added memory even if the original pointer has not changed.
-
- 12 10月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
The functions just read the passed pointer so it can be marked as const.
-
- 09 7月, 2016 2 次提交
-
-
由 Marc Hartmayer 提交于
As there is an explicit constructor for the special case of empty bitmaps, we should mention that the generic constructors rejects the creation of empty bitmaps. Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: NSascha Silbe <silbe@linux.vnet.ibm.com> Reviewed-by: NBjoern Walk <bwalk@linux.vnet.ibm.com> Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
-
由 Marc Hartmayer 提交于
Before the variable 'bits' was initialized with 0 (commit 3470cd86), the following bug was possible. A function call with an empty bitmap leads to undefined behavior. Because if 'bitmap->map_len == 0' 'unusedBits' will be <= 0 and 'sz == 1'. So the non global and non static variable 'bits' would have never been set. Consequently the check 'bits == 0' results in undefined behavior. This patch clarifies the current version of the function by handling the empty bitmap explicitly. Also, for an empty bitmap there is obviously no bit set so we can just return -1 (indicating no bit set) right away. The explicit check for 'bits == 0' after the loop is unnecessary because we only get to this point if no set bit was found. Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: NSascha Silbe <silbe@linux.vnet.ibm.com> Reviewed-by: NBjoern Walk <bwalk@linux.vnet.ibm.com> Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
-
- 20 6月, 2016 4 次提交
-
-
由 Ján Tomko 提交于
For parsing a bitmap of an unknown size.
-
由 Ján Tomko 提交于
Most the callers pass 0 in one form or another, including vircapstest which used VIR_ARCH_NONE.
-
由 Ján Tomko 提交于
This will be used for the caller that needs to specify a separator. Currently identical to virBitmapParse. Also change one test case to use the new function.
-
由 Ján Tomko 提交于
This is only used by one caller.
-
- 03 6月, 2016 1 次提交
-
-
由 Martin Kletzander 提交于
When building using -Og, gcc sees that some variables can be used uninitialized It can be debatable whether it is possible with our codeflow, but functions should be self-contained and initializations are always good. The return instead of goto is due to actualType being used in the cleanup. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 30 3月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
In some cases it's impractical to use the regular APIs as the bitmap size needs to be pre-declared. These new APIs allow to use bitmaps that self expand. The new code adds a property to the bitmap to track the allocation of memory so that VIR_RESIZE_N can be used.
-
- 05 2月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
Performs binary subtraction of two bitmaps. Stores result in the first operand.
-
- 23 9月, 2015 1 次提交
-
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 08 7月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
Optimize the virBitmap to array-of-char bitmap conversion by skipping trailing zero bytes. This also fixes a regression when requesting iothread information from a live VM since after commit 825df8c3 the bitmap returned from virProcessGetAffinity is too big to be formatted properly via RPC. A user would get the following error: error: Unable to get domain IOThreads information error: Unable to encode message payload Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1238589
-
- 03 6月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
Since some functions can be optimized by reusing the buffers that they already have instead of allocating and copying new ones, lets split virBitmapToData to two functions where one only converts the data and the second one is a wrapper that allocates the buffer if necessary.
-
- 13 4月, 2015 1 次提交
-
-
由 Erik Skultety 提交于
This patch adds checks for empty bitmaps right after the calls of virBitmapParse. These only include spots where set API's are called and where domain's XML is parsed. Also, it partially reverts commit 983f5a which added a check for invalid nodeset "0,^0" into virBitmapParse function. This change broke the logic, as an empty bitmap should not cause an error. https://bugzilla.redhat.com/show_bug.cgi?id=1210545
-
- 13 3月, 2015 1 次提交
-
-
由 Ján Tomko 提交于
A helper that never returns an error and treats bits out of bitmap range as false. Use it everywhere we use ignore_value on virBitmapGetBit, or loop over the bitmap size.
-
- 31 1月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
The virBitmapNew() function reports only OOM errors. Split out the internals into a "quiet" function and add a wrapper that reports the error.
-
- 29 1月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
After virBitmapEqual is able to compare NULL bitmaps few bits of code can be cleaned up.
-
- 15 11月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 04 11月, 2014 1 次提交
-
-
由 Chen Fan 提交于
Signed-off-by: NChen Fan <chen.fan.fnst@cn.fujitsu.com>
-
- 12 8月, 2014 1 次提交
-
-
由 Erik Skultety 提交于
Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1121837
-
- 29 7月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
This internal API just checks if two bitmaps intersect or not. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 06 6月, 2014 3 次提交
-
-
由 Ján Tomko 提交于
For converting bitmap data to human-readable strings.
-
由 Ján Tomko 提交于
It already reports an error if STRDUP fails.
-
由 Ján Tomko 提交于
This simplifies the usage in {libxl,qemu}DomainGetNumaParameters and it's needed for consistent error reporting in virBitmapFormat. Also remove the forgotten ATTRIBUTE_NONNULL marker.
-
- 25 3月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
-
- 10 3月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
Some of these are leftovers from renaming the files, others are just typos. Also introduce an ugly awk script to enforce this.
-
- 22 8月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
Re-arrange the code so that the returned bitmap is always initialized to NULL even on early failures and return an error message as some callers are already expecting it. Fix up the rest not to shadow the error.
-
- 16 8月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
The virBitmapParse function was calling virBitmapIsSet() function that requires the caller to check the bounds of the bitmap without checking them. This resulted into crashes when parsing a bitmap string that was exceeding the bounds used as argument. This patch refactors the function to use virBitmapSetBit without checking if the bit is set (this function does the checks internally) and then counts the bits in the bitmap afterwards (instead of keeping track while parsing the string). This patch also changes the "parse_error" label to a more common "error". The refactor should also get rid of the need to call sa_assert on the returned variable as the callpath should allow coverity to infer the possible return values. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=997367 Thanks to Alex Jia for tracking down the issue. This issue is introduced by commit 0fc89098.
-
- 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 提交于
-
- 24 5月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
-