- 03 4月, 2018 1 次提交
-
-
由 Peter Krempa 提交于
Sometimes it's desired to get a JSON number as string. Add a helper. This will help in cases where we'd want to convert the internal type from string to something else. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
- 23 3月, 2018 1 次提交
-
-
由 Peter Krempa 提交于
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
- 31 1月, 2018 1 次提交
-
-
由 Peter Krempa 提交于
The helper is useful in cases when the JSON we have to parse may contain one of the two due to historical reasons and the number value itself would be stored as a string.
-
- 11 7月, 2017 2 次提交
-
-
由 Peter Krempa 提交于
The code will become more universal so it makes more sense for it to live with the rest of the JSON functions.
-
由 Peter Krempa 提交于
Allows testing whether a virJSONValue is an object.
-
- 27 3月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
Move the helper that frees JSON entries put into hash tables into the JSON module so that it does not have to be reimplemented.
-
- 18 1月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
For use in test cases it will be helpful to allow reformatting JSON strings. Add a wrapper on top of the parser and formatter to achieve this.
-
- 14 12月, 2016 1 次提交
-
-
由 Jiri Denemark 提交于
Almost none of our virJSONValue*Get* functions accept const virJSONValue pointers and it wouldn't even make sense since we sometimes modify what we get. And because there is no reason for preventing callers of virJSONValueObjectForeachKeyValue from modifying the values they get in each iteration we can just stop doing it. Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 09 11月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
Simplifies cases where JSON array members need to be transferred to a different structure.
-
- 05 10月, 2016 1 次提交
-
-
由 John Ferlan 提交于
Provide the Steal API for any code paths that will desire to grab the object array and then free it afterwards rather than relying to freeing the whole chain from the reply.
-
- 27 7月, 2016 2 次提交
-
-
由 Peter Krempa 提交于
It's just read.
-
由 Peter Krempa 提交于
The iterator function (second argument) already requires that the object is handled as 'const' thus we won't modify the object itself.
-
- 09 10月, 2015 1 次提交
-
-
由 Michal Privoznik 提交于
The internal representation of a JSON array counts the items in size_t. However, for some reason, when asking for the count it's reported as int. Firstly, we need the function to return a signed type as it's returning -1 on an error. But, not every system has integer the same size as size_t. Therefore, lets return ssize_t. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 23 6月, 2015 1 次提交
-
-
由 Eric Blake 提交于
While working in qemu_monitor_json, I repeatedly found myself getting a value then checking if it was an object. Add some wrappers to make this task easier. * src/util/virjson.c (virJSONValueObjectGetByType) (virJSONValueObjectGetObject, virJSONValueObjectGetArray): New functions. (virJSONValueObjectGetString, virJSONValueObjectGetNumberInt) (virJSONValueObjectGetNumberUint) (virJSONValueObjectGetNumberLong) (virJSONValueObjectGetNumberUlong) (virJSONValueObjectGetNumberDouble) (virJSONValueObjectGetBoolean): Simplify. (virJSONValueIsNull): Change return type. * src/util/virjson.h: Reflect changes. * src/libvirt_private.syms (virjson.h): Export them. * tests/jsontest.c (testJSONLookup): New test. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 11 6月, 2015 1 次提交
-
-
由 Martin Kletzander 提交于
Faster version of virJSONValueFromString(virJSONValueToString()). Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 31 1月, 2015 3 次提交
-
-
由 Peter Krempa 提交于
This helper eases iterating all key=value pairs stored in a JSON object. Usually we pick only certain known keys from a JSON object, but this will allow to walk complete objects and have the callback act on those.
-
由 Peter Krempa 提交于
To be able to easily represent nodesets and other data stored in virBitmaps in libvirt, this patch introduces a set of helpers that allow to convert the bitmap to and from JSON value objects.
-
由 Peter Krempa 提交于
To allow constructing of value objects stepwise explode the helper into separate steps and allow appending into existing value objects.
-
- 23 1月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
The function doesn't allow to modify the array in any way, thus the argument can be const.
-
- 15 10月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
Our qemu monitor code has a converter from key-value pairs to a json value object. I want to re-use the code later and having it part of the monitor command generator is inflexible. Split it out into a separate helper.
-
- 17 6月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
Add a checker to determine whether a JSON object is an array and a helper to steal objects from a JSON array.
-
- 14 5月, 2013 1 次提交
-
-
由 Eric Blake 提交于
In an upcoming patch, I need the way to safely transfer a nested virJSON object out of its parent container for independent use, even after the parent is freed. * src/util/virjson.h (virJSONValueObjectRemoveKey): New function. (_virJSONObject, _virJSONArray): Use correct type. * src/util/virjson.c (virJSONValueObjectRemoveKey): Implement it. * src/libvirt_private.syms (virjson.h): Export it. * tests/jsontest.c (mymain): Test it. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 21 12月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
-
- 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/
-
- 15 8月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
While the QEMU monitor/agent do not want JSON strings pretty printed, other parts of libvirt might. Instead of hardcoding QEMU's desired behaviour in virJSONValueToString(), add a boolean flag to control pretty printing Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 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
-
- 03 5月, 2012 1 次提交
-
-
由 Dmitry Guryanov 提交于
Add function virJSONValueObjectKeysNumber, virJSONValueObjectGetKey and virJSONValueObjectGetValue, which allow you to iterate over all fields of json object: you can get number of fields and then get name and value, stored in field with that name by index. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
- 06 4月, 2012 1 次提交
-
-
由 Eric Blake 提交于
Leak introduced in commit 0436d328. If we allocate an actions array, but fail early enough to never consume it with the qemu monitor transaction call, we leaked memory. But our semantics of making the transaction command free the caller's memory is awkward; avoiding the memory leak requires making every intermediate function in the call chain check for error. It is much easier to fix things so that the function that allocates also frees, while the call chain leaves the caller's data intact. To do that, I had to hack our JSON data structure to make it easy to protect a portion of an arbitrary JSON tree from being freed. * src/util/json.h (virJSONType): Name the enum. (_virJSONValue): New field. * src/util/json.c (virJSONValueFree): Use it to protect a portion of an array. * src/qemu/qemu_monitor_json.c (qemuMonitorJSONTransaction): Avoid freeing caller's data. * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateDiskActive): Free actions array on failure.
-
- 09 5月, 2011 1 次提交
-
-
由 Jiri Denemark 提交于
They were not used anywhere so far so nobody noticed they are broken.
-
- 10 3月, 2010 1 次提交
-
-
由 Eric Blake 提交于
* global: patch created by running: for f in $(git ls-files '*.[ch]') ; do cppi $f > $f.t && mv $f.t $f done
-
- 26 1月, 2010 1 次提交
-
-
由 Daniel P. Berrange 提交于
* src/util/json.c, src/util/json.h: Declare returned strings to be const * src/qemu/qemu_monitor.c: Wire up JSON mode for qemuMonitorGetPtyPaths * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Fix const correctness. Add missing error message in the function qemuMonitorJSONGetAllPCIAddresses. Add implementation of the qemuMonitorGetPtyPaths function calling 'query-chardev'.
-
- 07 12月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
This introduces simple API for handling JSON data. There is an internal data structure 'virJSONValuePtr' which stores a arbitrary nested JSON value (number, string, array, object, nul, etc). There are APIs for constructing/querying objects and APIs for parsing/formatting string formatted JSON data. This uses the YAJL library for parsing/formatting from http://lloyd.github.com/yajl/ * src/util/json.h, src/util/json.c: Data structures and APIs for representing JSON data, and parsing/formatting it * configure.in: Add check for yajl library * libvirt.spec.in: Add build requires for yajl * src/Makefile.am: Add json.c/h * src/libvirt_private.syms: Export JSON symbols to drivers
-