Codebase list libvirt / 41fa8f5
Rediff patches Drop all jansson related patches. Fixed ustream. Guido Günther 5 years ago
20 changed file(s) with 10 addition(s) and 2523 deletion(s). Raw diff Collapse all Expand all
+0
-574
debian/patches/Revert-Remove-functions-using-yajl.patch less more
0 From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
1 Date: Mon, 13 Aug 2018 13:40:11 +0200
2 Subject: Revert "Remove functions using yajl"
3 MIME-Version: 1.0
4 Content-Type: text/plain; charset="utf-8"
5 Content-Transfer-Encoding: 8bit
6
7 This reverts commit bf114decb34f21cd225ead6dc4d929d35a8c5fe5.
8
9 Jansson cannot parse QEMU's quirky JSON.
10 Revert back to yajl.
11
12 https://bugzilla.redhat.com/show_bug.cgi?id=1614569
13
14 Signed-off-by: Ján Tomko <jtomko@redhat.com>
15 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
16 ---
17 src/util/virjson.c | 529 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
18 1 file changed, 528 insertions(+), 1 deletion(-)
19
20 diff --git a/src/util/virjson.c b/src/util/virjson.c
21 index 80274bc..608ba85 100644
22 --- a/src/util/virjson.c
23 +++ b/src/util/virjson.c
24 @@ -29,6 +29,22 @@
25 #include "virstring.h"
26 #include "virutil.h"
27
28 +#if WITH_YAJL
29 +# include <yajl/yajl_gen.h>
30 +# include <yajl/yajl_parse.h>
31 +
32 +# ifdef WITH_YAJL2
33 +# define yajl_size_t size_t
34 +# define VIR_YAJL_STATUS_OK(status) ((status) == yajl_status_ok)
35 +# else
36 +# define yajl_size_t unsigned int
37 +# define yajl_complete_parse yajl_parse_complete
38 +# define VIR_YAJL_STATUS_OK(status) \
39 + ((status) == yajl_status_ok || (status) == yajl_status_insufficient_data)
40 +# endif
41 +
42 +#endif
43 +
44 /* XXX fixme */
45 #define VIR_FROM_THIS VIR_FROM_NONE
46
47 @@ -72,6 +88,23 @@ struct _virJSONValue {
48 };
49
50
51 +typedef struct _virJSONParserState virJSONParserState;
52 +typedef virJSONParserState *virJSONParserStatePtr;
53 +struct _virJSONParserState {
54 + virJSONValuePtr value;
55 + char *key;
56 +};
57 +
58 +typedef struct _virJSONParser virJSONParser;
59 +typedef virJSONParser *virJSONParserPtr;
60 +struct _virJSONParser {
61 + virJSONValuePtr head;
62 + virJSONParserStatePtr state;
63 + size_t nstate;
64 + int wrap;
65 +};
66 +
67 +
68 virJSONType
69 virJSONValueGetType(const virJSONValue *value)
70 {
71 @@ -1458,7 +1491,501 @@ virJSONValueCopy(const virJSONValue *in)
72 }
73
74
75 -#if WITH_JANSSON
76 +#if WITH_YAJL
77 +static int
78 +virJSONParserInsertValue(virJSONParserPtr parser,
79 + virJSONValuePtr value)
80 +{
81 + if (!parser->head) {
82 + parser->head = value;
83 + } else {
84 + virJSONParserStatePtr state;
85 + if (!parser->nstate) {
86 + VIR_DEBUG("got a value to insert without a container");
87 + return -1;
88 + }
89 +
90 + state = &parser->state[parser->nstate-1];
91 +
92 + switch (state->value->type) {
93 + case VIR_JSON_TYPE_OBJECT: {
94 + if (!state->key) {
95 + VIR_DEBUG("missing key when inserting object value");
96 + return -1;
97 + }
98 +
99 + if (virJSONValueObjectAppend(state->value,
100 + state->key,
101 + value) < 0)
102 + return -1;
103 +
104 + VIR_FREE(state->key);
105 + } break;
106 +
107 + case VIR_JSON_TYPE_ARRAY: {
108 + if (state->key) {
109 + VIR_DEBUG("unexpected key when inserting array value");
110 + return -1;
111 + }
112 +
113 + if (virJSONValueArrayAppend(state->value,
114 + value) < 0)
115 + return -1;
116 + } break;
117 +
118 + default:
119 + VIR_DEBUG("unexpected value type, not a container");
120 + return -1;
121 + }
122 + }
123 +
124 + return 0;
125 +}
126 +
127 +
128 +static int
129 +virJSONParserHandleNull(void *ctx)
130 +{
131 + virJSONParserPtr parser = ctx;
132 + virJSONValuePtr value = virJSONValueNewNull();
133 +
134 + VIR_DEBUG("parser=%p", parser);
135 +
136 + if (!value)
137 + return 0;
138 +
139 + if (virJSONParserInsertValue(parser, value) < 0) {
140 + virJSONValueFree(value);
141 + return 0;
142 + }
143 +
144 + return 1;
145 +}
146 +
147 +
148 +static int
149 +virJSONParserHandleBoolean(void *ctx,
150 + int boolean_)
151 +{
152 + virJSONParserPtr parser = ctx;
153 + virJSONValuePtr value = virJSONValueNewBoolean(boolean_);
154 +
155 + VIR_DEBUG("parser=%p boolean=%d", parser, boolean_);
156 +
157 + if (!value)
158 + return 0;
159 +
160 + if (virJSONParserInsertValue(parser, value) < 0) {
161 + virJSONValueFree(value);
162 + return 0;
163 + }
164 +
165 + return 1;
166 +}
167 +
168 +
169 +static int
170 +virJSONParserHandleNumber(void *ctx,
171 + const char *s,
172 + yajl_size_t l)
173 +{
174 + virJSONParserPtr parser = ctx;
175 + char *str;
176 + virJSONValuePtr value;
177 +
178 + if (VIR_STRNDUP(str, s, l) < 0)
179 + return -1;
180 + value = virJSONValueNewNumber(str);
181 + VIR_FREE(str);
182 +
183 + VIR_DEBUG("parser=%p str=%s", parser, str);
184 +
185 + if (!value)
186 + return 0;
187 +
188 + if (virJSONParserInsertValue(parser, value) < 0) {
189 + virJSONValueFree(value);
190 + return 0;
191 + }
192 +
193 + return 1;
194 +}
195 +
196 +
197 +static int
198 +virJSONParserHandleString(void *ctx,
199 + const unsigned char *stringVal,
200 + yajl_size_t stringLen)
201 +{
202 + virJSONParserPtr parser = ctx;
203 + virJSONValuePtr value = virJSONValueNewStringLen((const char *)stringVal,
204 + stringLen);
205 +
206 + VIR_DEBUG("parser=%p str=%p", parser, (const char *)stringVal);
207 +
208 + if (!value)
209 + return 0;
210 +
211 + if (virJSONParserInsertValue(parser, value) < 0) {
212 + virJSONValueFree(value);
213 + return 0;
214 + }
215 +
216 + return 1;
217 +}
218 +
219 +
220 +static int
221 +virJSONParserHandleMapKey(void *ctx,
222 + const unsigned char *stringVal,
223 + yajl_size_t stringLen)
224 +{
225 + virJSONParserPtr parser = ctx;
226 + virJSONParserStatePtr state;
227 +
228 + VIR_DEBUG("parser=%p key=%p", parser, (const char *)stringVal);
229 +
230 + if (!parser->nstate)
231 + return 0;
232 +
233 + state = &parser->state[parser->nstate-1];
234 + if (state->key)
235 + return 0;
236 + if (VIR_STRNDUP(state->key, (const char *)stringVal, stringLen) < 0)
237 + return 0;
238 + return 1;
239 +}
240 +
241 +
242 +static int
243 +virJSONParserHandleStartMap(void *ctx)
244 +{
245 + virJSONParserPtr parser = ctx;
246 + virJSONValuePtr value = virJSONValueNewObject();
247 +
248 + VIR_DEBUG("parser=%p", parser);
249 +
250 + if (!value)
251 + return 0;
252 +
253 + if (virJSONParserInsertValue(parser, value) < 0) {
254 + virJSONValueFree(value);
255 + return 0;
256 + }
257 +
258 + if (VIR_REALLOC_N(parser->state,
259 + parser->nstate + 1) < 0) {
260 + return 0;
261 + }
262 +
263 + parser->state[parser->nstate].value = value;
264 + parser->state[parser->nstate].key = NULL;
265 + parser->nstate++;
266 +
267 + return 1;
268 +}
269 +
270 +
271 +static int
272 +virJSONParserHandleEndMap(void *ctx)
273 +{
274 + virJSONParserPtr parser = ctx;
275 + virJSONParserStatePtr state;
276 +
277 + VIR_DEBUG("parser=%p", parser);
278 +
279 + if (!parser->nstate)
280 + return 0;
281 +
282 + state = &(parser->state[parser->nstate-1]);
283 + if (state->key) {
284 + VIR_FREE(state->key);
285 + return 0;
286 + }
287 +
288 + VIR_DELETE_ELEMENT(parser->state, parser->nstate - 1, parser->nstate);
289 +
290 + return 1;
291 +}
292 +
293 +
294 +static int
295 +virJSONParserHandleStartArray(void *ctx)
296 +{
297 + virJSONParserPtr parser = ctx;
298 + virJSONValuePtr value = virJSONValueNewArray();
299 +
300 + VIR_DEBUG("parser=%p", parser);
301 +
302 + if (!value)
303 + return 0;
304 +
305 + if (virJSONParserInsertValue(parser, value) < 0) {
306 + virJSONValueFree(value);
307 + return 0;
308 + }
309 +
310 + if (VIR_REALLOC_N(parser->state,
311 + parser->nstate + 1) < 0)
312 + return 0;
313 +
314 + parser->state[parser->nstate].value = value;
315 + parser->state[parser->nstate].key = NULL;
316 + parser->nstate++;
317 +
318 + return 1;
319 +}
320 +
321 +
322 +static int
323 +virJSONParserHandleEndArray(void *ctx)
324 +{
325 + virJSONParserPtr parser = ctx;
326 + virJSONParserStatePtr state;
327 +
328 + VIR_DEBUG("parser=%p", parser);
329 +
330 + if (!(parser->nstate - parser->wrap))
331 + return 0;
332 +
333 + state = &(parser->state[parser->nstate-1]);
334 + if (state->key) {
335 + VIR_FREE(state->key);
336 + return 0;
337 + }
338 +
339 + VIR_DELETE_ELEMENT(parser->state, parser->nstate - 1, parser->nstate);
340 +
341 + return 1;
342 +}
343 +
344 +
345 +static const yajl_callbacks parserCallbacks = {
346 + virJSONParserHandleNull,
347 + virJSONParserHandleBoolean,
348 + NULL,
349 + NULL,
350 + virJSONParserHandleNumber,
351 + virJSONParserHandleString,
352 + virJSONParserHandleStartMap,
353 + virJSONParserHandleMapKey,
354 + virJSONParserHandleEndMap,
355 + virJSONParserHandleStartArray,
356 + virJSONParserHandleEndArray
357 +};
358 +
359 +
360 +/* XXX add an incremental streaming parser - yajl trivially supports it */
361 +virJSONValuePtr
362 +virJSONValueFromString(const char *jsonstring)
363 +{
364 + yajl_handle hand;
365 + virJSONParser parser = { NULL, NULL, 0, 0 };
366 + virJSONValuePtr ret = NULL;
367 + int rc;
368 + size_t len = strlen(jsonstring);
369 +# ifndef WITH_YAJL2
370 + yajl_parser_config cfg = { 0, 1 }; /* Match yajl 2 default behavior */
371 + VIR_AUTOPTR(virJSONValue) tmp = NULL;
372 +# endif
373 +
374 + VIR_DEBUG("string=%s", jsonstring);
375 +
376 +# ifdef WITH_YAJL2
377 + hand = yajl_alloc(&parserCallbacks, NULL, &parser);
378 +# else
379 + hand = yajl_alloc(&parserCallbacks, &cfg, NULL, &parser);
380 +# endif
381 + if (!hand) {
382 + virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
383 + _("Unable to create JSON parser"));
384 + goto cleanup;
385 + }
386 +
387 + /* Yajl 2 is nice enough to default to rejecting trailing garbage.
388 + * Yajl 1.0.12 has yajl_get_bytes_consumed to make that detection
389 + * simpler. But we're stuck with yajl 1.0.7 on RHEL 6, which
390 + * happily quits parsing at the end of a valid JSON construct,
391 + * with no visibility into how much more input remains. Wrapping
392 + * things in an array forces yajl to confess the truth. */
393 +# ifdef WITH_YAJL2
394 + rc = yajl_parse(hand, (const unsigned char *)jsonstring, len);
395 +# else
396 + rc = yajl_parse(hand, (const unsigned char *)"[", 1);
397 + parser.wrap = 1;
398 + if (VIR_YAJL_STATUS_OK(rc))
399 + rc = yajl_parse(hand, (const unsigned char *)jsonstring, len);
400 + parser.wrap = 0;
401 + if (VIR_YAJL_STATUS_OK(rc))
402 + rc = yajl_parse(hand, (const unsigned char *)"]", 1);
403 +# endif
404 + if (!VIR_YAJL_STATUS_OK(rc) ||
405 + yajl_complete_parse(hand) != yajl_status_ok) {
406 + unsigned char *errstr = yajl_get_error(hand, 1,
407 + (const unsigned char*)jsonstring,
408 + strlen(jsonstring));
409 +
410 + virReportError(VIR_ERR_INTERNAL_ERROR,
411 + _("cannot parse json %s: %s"),
412 + jsonstring, (const char*) errstr);
413 + yajl_free_error(hand, errstr);
414 + virJSONValueFree(parser.head);
415 + goto cleanup;
416 + }
417 +
418 + if (parser.nstate != 0) {
419 + virReportError(VIR_ERR_INTERNAL_ERROR,
420 + _("cannot parse json %s: unterminated string/map/array"),
421 + jsonstring);
422 + virJSONValueFree(parser.head);
423 + } else {
424 + ret = parser.head;
425 +# ifndef WITH_YAJL2
426 + /* Undo the array wrapping above */
427 + tmp = ret;
428 + ret = NULL;
429 + if (virJSONValueArraySize(tmp) > 1)
430 + virReportError(VIR_ERR_INTERNAL_ERROR,
431 + _("cannot parse json %s: too many items present"),
432 + jsonstring);
433 + else
434 + ret = virJSONValueArraySteal(tmp, 0);
435 +# endif
436 + }
437 +
438 + cleanup:
439 + yajl_free(hand);
440 +
441 + if (parser.nstate) {
442 + size_t i;
443 + for (i = 0; i < parser.nstate; i++)
444 + VIR_FREE(parser.state[i].key);
445 + VIR_FREE(parser.state);
446 + }
447 +
448 + VIR_DEBUG("result=%p", ret);
449 +
450 + return ret;
451 +}
452 +
453 +
454 +static int
455 +virJSONValueToStringOne(virJSONValuePtr object,
456 + yajl_gen g)
457 +{
458 + size_t i;
459 +
460 + VIR_DEBUG("object=%p type=%d gen=%p", object, object->type, g);
461 +
462 + switch (object->type) {
463 + case VIR_JSON_TYPE_OBJECT:
464 + if (yajl_gen_map_open(g) != yajl_gen_status_ok)
465 + return -1;
466 + for (i = 0; i < object->data.object.npairs; i++) {
467 + if (yajl_gen_string(g,
468 + (unsigned char *)object->data.object.pairs[i].key,
469 + strlen(object->data.object.pairs[i].key))
470 + != yajl_gen_status_ok)
471 + return -1;
472 + if (virJSONValueToStringOne(object->data.object.pairs[i].value, g) < 0)
473 + return -1;
474 + }
475 + if (yajl_gen_map_close(g) != yajl_gen_status_ok)
476 + return -1;
477 + break;
478 + case VIR_JSON_TYPE_ARRAY:
479 + if (yajl_gen_array_open(g) != yajl_gen_status_ok)
480 + return -1;
481 + for (i = 0; i < object->data.array.nvalues; i++) {
482 + if (virJSONValueToStringOne(object->data.array.values[i], g) < 0)
483 + return -1;
484 + }
485 + if (yajl_gen_array_close(g) != yajl_gen_status_ok)
486 + return -1;
487 + break;
488 +
489 + case VIR_JSON_TYPE_STRING:
490 + if (yajl_gen_string(g, (unsigned char *)object->data.string,
491 + strlen(object->data.string)) != yajl_gen_status_ok)
492 + return -1;
493 + break;
494 +
495 + case VIR_JSON_TYPE_NUMBER:
496 + if (yajl_gen_number(g, object->data.number,
497 + strlen(object->data.number)) != yajl_gen_status_ok)
498 + return -1;
499 + break;
500 +
501 + case VIR_JSON_TYPE_BOOLEAN:
502 + if (yajl_gen_bool(g, object->data.boolean) != yajl_gen_status_ok)
503 + return -1;
504 + break;
505 +
506 + case VIR_JSON_TYPE_NULL:
507 + if (yajl_gen_null(g) != yajl_gen_status_ok)
508 + return -1;
509 + break;
510 +
511 + default:
512 + return -1;
513 + }
514 +
515 + return 0;
516 +}
517 +
518 +
519 +char *
520 +virJSONValueToString(virJSONValuePtr object,
521 + bool pretty)
522 +{
523 + yajl_gen g;
524 + const unsigned char *str;
525 + char *ret = NULL;
526 + yajl_size_t len;
527 +# ifndef WITH_YAJL2
528 + yajl_gen_config conf = { pretty ? 1 : 0, pretty ? " " : " "};
529 +# endif
530 +
531 + VIR_DEBUG("object=%p", object);
532 +
533 +# ifdef WITH_YAJL2
534 + g = yajl_gen_alloc(NULL);
535 + if (g) {
536 + yajl_gen_config(g, yajl_gen_beautify, pretty ? 1 : 0);
537 + yajl_gen_config(g, yajl_gen_indent_string, pretty ? " " : " ");
538 + yajl_gen_config(g, yajl_gen_validate_utf8, 1);
539 + }
540 +# else
541 + g = yajl_gen_alloc(&conf, NULL);
542 +# endif
543 + if (!g) {
544 + virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
545 + _("Unable to create JSON formatter"));
546 + goto cleanup;
547 + }
548 +
549 + if (virJSONValueToStringOne(object, g) < 0) {
550 + virReportOOMError();
551 + goto cleanup;
552 + }
553 +
554 + if (yajl_gen_get_buf(g, &str, &len) != yajl_gen_status_ok) {
555 + virReportOOMError();
556 + goto cleanup;
557 + }
558 +
559 + ignore_value(VIR_STRDUP(ret, (const char *)str));
560 +
561 + cleanup:
562 + yajl_gen_free(g);
563 +
564 + VIR_DEBUG("result=%s", NULLSTR(ret));
565 +
566 + return ret;
567 +}
568 +
569 +
570 +#elif WITH_JANSSON
571 # include <jansson.h>
572
573 static virJSONValuePtr
+0
-79
debian/patches/Revert-Remove-virJSONValueNewStringLen.patch less more
0 From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
1 Date: Mon, 13 Aug 2018 13:39:56 +0200
2 Subject: Revert "Remove virJSONValueNewStringLen"
3 MIME-Version: 1.0
4 Content-Type: text/plain; charset="utf-8"
5 Content-Transfer-Encoding: 8bit
6
7 This reverts commit 8f802c6d8659beb9eb3cab96ba2553e251728337.
8
9 Jansson cannot parse QEMU's quirky JSON.
10 Revert back to yajl.
11
12 https://bugzilla.redhat.com/show_bug.cgi?id=1614569
13
14 Signed-off-by: Ján Tomko <jtomko@redhat.com>
15 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
16 ---
17 src/libvirt_private.syms | 1 +
18 src/util/virjson.c | 22 ++++++++++++++++++++++
19 src/util/virjson.h | 1 +
20 3 files changed, 24 insertions(+)
21
22 diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
23 index fc386e1..a5e88a9 100644
24 --- a/src/libvirt_private.syms
25 +++ b/src/libvirt_private.syms
26 @@ -2098,6 +2098,7 @@ virJSONValueNewNumberUint;
27 virJSONValueNewNumberUlong;
28 virJSONValueNewObject;
29 virJSONValueNewString;
30 +virJSONValueNewStringLen;
31 virJSONValueObjectAdd;
32 virJSONValueObjectAddVArgs;
33 virJSONValueObjectAppend;
34 diff --git a/src/util/virjson.c b/src/util/virjson.c
35 index 01a387b..80274bc 100644
36 --- a/src/util/virjson.c
37 +++ b/src/util/virjson.c
38 @@ -420,6 +420,28 @@ virJSONValueNewString(const char *data)
39 }
40
41
42 +virJSONValuePtr
43 +virJSONValueNewStringLen(const char *data,
44 + size_t length)
45 +{
46 + virJSONValuePtr val;
47 +
48 + if (!data)
49 + return virJSONValueNewNull();
50 +
51 + if (VIR_ALLOC(val) < 0)
52 + return NULL;
53 +
54 + val->type = VIR_JSON_TYPE_STRING;
55 + if (VIR_STRNDUP(val->data.string, data, length) < 0) {
56 + VIR_FREE(val);
57 + return NULL;
58 + }
59 +
60 + return val;
61 +}
62 +
63 +
64 static virJSONValuePtr
65 virJSONValueNewNumber(const char *data)
66 {
67 diff --git a/src/util/virjson.h b/src/util/virjson.h
68 index 0d5a7ef..75f7f17 100644
69 --- a/src/util/virjson.h
70 +++ b/src/util/virjson.h
71 @@ -59,6 +59,7 @@ int virJSONValueObjectAddVArgs(virJSONValuePtr obj, va_list args)
72
73
74 virJSONValuePtr virJSONValueNewString(const char *data);
75 +virJSONValuePtr virJSONValueNewStringLen(const char *data, size_t length);
76 virJSONValuePtr virJSONValueNewNumberInt(int data);
77 virJSONValuePtr virJSONValueNewNumberUint(unsigned int data);
78 virJSONValuePtr virJSONValueNewNumberLong(long long data);
+0
-739
debian/patches/Revert-Switch-from-yajl-to-Jansson.patch less more
0 From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
1 Date: Mon, 13 Aug 2018 13:40:18 +0200
2 Subject: Revert "Switch from yajl to Jansson"
3 MIME-Version: 1.0
4 Content-Type: text/plain; charset="utf-8"
5 Content-Transfer-Encoding: 8bit
6
7 This reverts commit 9cf38263d05ca7f27dbbd9b1a0b48d338d9280e2.
8
9 Jansson cannot parse QEMU's quirky JSON.
10 Revert back to yajl.
11
12 https://bugzilla.redhat.com/show_bug.cgi?id=1614569
13
14 Signed-off-by: Ján Tomko <jtomko@redhat.com>
15 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
16 ---
17 libvirt.spec.in | 4 +-
18 m4/virt-nss.m4 | 4 +-
19 m4/virt-yajl.m4 | 27 +++-
20 src/Makefile.am | 8 +-
21 src/qemu/qemu_driver.c | 2 +-
22 src/util/Makefile.inc.am | 4 +-
23 src/util/virjson.c | 211 -------------------------------
24 tests/Makefile.am | 12 +-
25 tests/cputest.c | 16 +--
26 tests/libxlxml2domconfigtest.c | 4 +-
27 tests/qemuagenttest.c | 2 +-
28 tests/qemublocktest.c | 1 -
29 tests/qemucapabilitiestest.c | 2 +-
30 tests/qemucaps2xmltest.c | 2 +-
31 tests/qemucommandutiltest.c | 2 +-
32 tests/qemuhotplugtest.c | 2 +-
33 tests/qemumigparamsdata/empty.json | 4 +-
34 tests/qemumigparamsdata/unsupported.json | 4 +-
35 tests/qemumigparamstest.c | 2 +-
36 tests/qemumonitorjsontest.c | 2 +-
37 tests/virmacmaptestdata/empty.json | 4 +-
38 tests/virmocklibxl.c | 4 +-
39 tests/virnetdaemontest.c | 2 +-
40 tests/virstoragetest.c | 4 +-
41 24 files changed, 72 insertions(+), 257 deletions(-)
42
43 diff --git a/libvirt.spec.in b/libvirt.spec.in
44 index 4113579..ab8e97a 100644
45 --- a/libvirt.spec.in
46 +++ b/libvirt.spec.in
47 @@ -292,7 +292,7 @@ BuildRequires: libblkid-devel >= 2.17
48 BuildRequires: augeas
49 BuildRequires: systemd-devel >= 185
50 BuildRequires: libpciaccess-devel >= 0.10.9
51 -BuildRequires: jansson-devel
52 +BuildRequires: yajl-devel
53 %if %{with_sanlock}
54 BuildRequires: sanlock-devel >= 2.4
55 %endif
56 @@ -1226,7 +1226,7 @@ rm -f po/stamp-po
57 --without-apparmor \
58 --without-hal \
59 --with-udev \
60 - --with-jansson \
61 + --with-yajl \
62 %{?arg_sanlock} \
63 --with-libpcap \
64 --with-macvtap \
65 diff --git a/m4/virt-nss.m4 b/m4/virt-nss.m4
66 index 082b7b1..951a74e 100644
67 --- a/m4/virt-nss.m4
68 +++ b/m4/virt-nss.m4
69 @@ -27,9 +27,9 @@ AC_DEFUN([LIBVIRT_CHECK_NSS],[
70 bsd_nss=no
71 fail=0
72 if test "x$with_nss_plugin" != "xno" ; then
73 - if test "x$with_jansson" != "xyes" ; then
74 + if test "x$with_yajl" != "xyes" ; then
75 if test "x$with_nss_plugin" = "xyes" ; then
76 - AC_MSG_ERROR([Can't build nss plugin without JSON support])
77 + AC_MSG_ERROR([Can't build nss plugin without yajl])
78 else
79 with_nss_plugin=no
80 fi
81 diff --git a/m4/virt-yajl.m4 b/m4/virt-yajl.m4
82 index 8d4c43a..c4ea010 100644
83 --- a/m4/virt-yajl.m4
84 +++ b/m4/virt-yajl.m4
85 @@ -23,10 +23,31 @@ AC_DEFUN([LIBVIRT_ARG_YAJL],[
86
87 AC_DEFUN([LIBVIRT_CHECK_YAJL],[
88 dnl YAJL JSON library http://lloyd.github.com/yajl/
89 - if test "$with_yajl" = yes; then
90 - AC_MSG_ERROR([Compilation with YAJL is no longer supported])
91 + if test "$with_qemu:$with_yajl" = yes:check; then
92 + dnl Some versions of qemu require the use of yajl; try to detect them
93 + dnl here, although we do not require qemu to exist in order to compile.
94 + dnl This check mirrors src/qemu/qemu_capabilities.c
95 + AC_PATH_PROGS([QEMU], [qemu-kvm qemu kvm qemu-system-x86_64],
96 + [], [$PATH:/usr/bin:/usr/libexec])
97 + if test -x "$QEMU"; then
98 + if $QEMU -help 2>/dev/null | grep -q libvirt; then
99 + with_yajl=yes
100 + else
101 + [qemu_version_sed='s/.*ersion \([0-9.,]*\).*/\1/']
102 + qemu_version=`$QEMU -version | sed "$qemu_version_sed"`
103 + case $qemu_version in
104 + [[1-9]].* | 0.15.* ) with_yajl=yes ;;
105 + 0.* | '' ) ;;
106 + *) AC_MSG_ERROR([Unexpected qemu version string]) ;;
107 + esac
108 + fi
109 + fi
110 fi
111 - with_yajl=no
112 +
113 + LIBVIRT_CHECK_LIB_ALT([YAJL], [yajl],
114 + [yajl_parse_complete], [yajl/yajl_common.h],
115 + [YAJL2], [yajl],
116 + [yajl_tree_parse], [yajl/yajl_common.h])
117 ])
118
119 AC_DEFUN([LIBVIRT_RESULT_YAJL],[
120 diff --git a/src/Makefile.am b/src/Makefile.am
121 index 702e900..db0a29c 100644
122 --- a/src/Makefile.am
123 +++ b/src/Makefile.am
124 @@ -544,7 +544,7 @@ libvirt_admin_la_CFLAGS = \
125 libvirt_admin_la_CFLAGS += \
126 $(XDR_CFLAGS) \
127 $(CAPNG_CFLAGS) \
128 - $(JANSSON_CFLAGS) \
129 + $(YAJL_CFLAGS) \
130 $(SSH2_CFLAGS) \
131 $(SASL_CFLAGS) \
132 $(GNUTLS_CFLAGS) \
133 @@ -552,7 +552,7 @@ libvirt_admin_la_CFLAGS += \
134
135 libvirt_admin_la_LIBADD += \
136 $(CAPNG_LIBS) \
137 - $(JANSSON_LIBS) \
138 + $(YAJL_LIBS) \
139 $(DEVMAPPER_LIBS) \
140 $(LIBXML_LIBS) \
141 $(SSH2_LIBS) \
142 @@ -993,14 +993,14 @@ libvirt_nss_la_SOURCES = \
143 libvirt_nss_la_CFLAGS = \
144 -DLIBVIRT_NSS \
145 $(AM_CFLAGS) \
146 - $(JANSSON_CFLAGS) \
147 + $(YAJL_CFLAGS) \
148 $(NULL)
149 libvirt_nss_la_LDFLAGS = \
150 $(AM_LDFLAGS) \
151 $(NULL)
152
153 libvirt_nss_la_LIBADD = \
154 - $(JANSSON_LIBS) \
155 + $(YAJL_LIBS) \
156 $(NULL)
157 endif WITH_NSS
158
159 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
160 index fb0d4a8..d4a2379 100644
161 --- a/src/qemu/qemu_driver.c
162 +++ b/src/qemu/qemu_driver.c
163 @@ -2092,7 +2092,7 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
164 */
165 if ((!useAgent) ||
166 (ret < 0 && (acpiRequested || !flags))) {
167 -#if !WITH_JANSSON
168 +#if !WITH_YAJL
169 virReportError(VIR_ERR_OPERATION_INVALID, "%s",
170 _("ACPI reboot is not supported without the JSON monitor"));
171 goto endjob;
172 diff --git a/src/util/Makefile.inc.am b/src/util/Makefile.inc.am
173 index 71b2b93..a222656 100644
174 --- a/src/util/Makefile.inc.am
175 +++ b/src/util/Makefile.inc.am
176 @@ -251,7 +251,7 @@ libvirt_util_la_SOURCES = \
177 $(NULL)
178 libvirt_util_la_CFLAGS = \
179 $(CAPNG_CFLAGS) \
180 - $(JANSSON_CFLAGS) \
181 + $(YAJL_CFLAGS) \
182 $(LIBNL_CFLAGS) \
183 $(AM_CFLAGS) \
184 $(AUDIT_CFLAGS) \
185 @@ -264,7 +264,7 @@ libvirt_util_la_CFLAGS = \
186 $(NULL)
187 libvirt_util_la_LIBADD = \
188 $(CAPNG_LIBS) \
189 - $(JANSSON_LIBS) \
190 + $(YAJL_LIBS) \
191 $(LIBNL_LIBS) \
192 $(THREAD_LIBS) \
193 $(AUDIT_LIBS) \
194 diff --git a/src/util/virjson.c b/src/util/virjson.c
195 index 608ba85..29530dc 100644
196 --- a/src/util/virjson.c
197 +++ b/src/util/virjson.c
198 @@ -1985,217 +1985,6 @@ virJSONValueToString(virJSONValuePtr object,
199 }
200
201
202 -#elif WITH_JANSSON
203 -# include <jansson.h>
204 -
205 -static virJSONValuePtr
206 -virJSONValueFromJansson(json_t *json)
207 -{
208 - virJSONValuePtr ret = NULL;
209 - const char *key;
210 - json_t *cur;
211 - size_t i;
212 -
213 - switch (json_typeof(json)) {
214 - case JSON_OBJECT:
215 - ret = virJSONValueNewObject();
216 - if (!ret)
217 - goto error;
218 -
219 - json_object_foreach(json, key, cur) {
220 - virJSONValuePtr val = virJSONValueFromJansson(cur);
221 - if (!val)
222 - goto error;
223 -
224 - if (virJSONValueObjectAppend(ret, key, val) < 0) {
225 - virJSONValueFree(val);
226 - goto error;
227 - }
228 - }
229 -
230 - break;
231 -
232 - case JSON_ARRAY:
233 - ret = virJSONValueNewArray();
234 - if (!ret)
235 - goto error;
236 -
237 - json_array_foreach(json, i, cur) {
238 - virJSONValuePtr val = virJSONValueFromJansson(cur);
239 - if (!val)
240 - goto error;
241 -
242 - if (virJSONValueArrayAppend(ret, val) < 0) {
243 - virJSONValueFree(val);
244 - goto error;
245 - }
246 - }
247 - break;
248 -
249 - case JSON_STRING:
250 - ret = virJSONValueNewString(json_string_value(json));
251 - break;
252 -
253 - case JSON_INTEGER:
254 - ret = virJSONValueNewNumberLong(json_integer_value(json));
255 - break;
256 -
257 - case JSON_REAL:
258 - ret = virJSONValueNewNumberDouble(json_real_value(json));
259 - break;
260 -
261 - case JSON_TRUE:
262 - ret = virJSONValueNewBoolean(true);
263 - break;
264 -
265 - case JSON_FALSE:
266 - ret = virJSONValueNewBoolean(false);
267 - break;
268 -
269 - case JSON_NULL:
270 - ret = virJSONValueNewNull();
271 - break;
272 - }
273 -
274 - return ret;
275 -
276 - error:
277 - virJSONValueFree(ret);
278 - return NULL;
279 -}
280 -
281 -virJSONValuePtr
282 -virJSONValueFromString(const char *jsonstring)
283 -{
284 - virJSONValuePtr ret = NULL;
285 - json_t *json;
286 - json_error_t error;
287 - size_t flags = JSON_REJECT_DUPLICATES |
288 - JSON_DECODE_ANY;
289 -
290 - if (!(json = json_loads(jsonstring, flags, &error))) {
291 - virReportError(VIR_ERR_INTERNAL_ERROR,
292 - _("failed to parse JSON %d:%d: %s"),
293 - error.line, error.column, error.text);
294 - return NULL;
295 - }
296 -
297 - ret = virJSONValueFromJansson(json);
298 - json_decref(json);
299 - return ret;
300 -}
301 -
302 -
303 -static json_t *
304 -virJSONValueToJansson(virJSONValuePtr object)
305 -{
306 - json_t *ret = NULL;
307 - size_t i;
308 -
309 - switch ((virJSONType)object->type) {
310 - case VIR_JSON_TYPE_OBJECT:
311 - ret = json_object();
312 - if (!ret)
313 - goto no_memory;
314 - for (i = 0; i < object->data.object.npairs; i++) {
315 - virJSONObjectPairPtr cur = object->data.object.pairs + i;
316 - json_t *val = virJSONValueToJansson(cur->value);
317 -
318 - if (!val)
319 - goto error;
320 - if (json_object_set_new(ret, cur->key, val) < 0) {
321 - json_decref(val);
322 - goto no_memory;
323 - }
324 - }
325 - break;
326 -
327 - case VIR_JSON_TYPE_ARRAY:
328 - ret = json_array();
329 - if (!ret)
330 - goto no_memory;
331 - for (i = 0; i < object->data.array.nvalues; i++) {
332 - virJSONValuePtr cur = object->data.array.values[i];
333 - json_t *val = virJSONValueToJansson(cur);
334 -
335 - if (!val)
336 - goto error;
337 - if (json_array_append_new(ret, val) < 0) {
338 - json_decref(val);
339 - goto no_memory;
340 - }
341 - }
342 - break;
343 -
344 - case VIR_JSON_TYPE_STRING:
345 - ret = json_string(object->data.string);
346 - break;
347 -
348 - case VIR_JSON_TYPE_NUMBER: {
349 - long long ll_val;
350 - double d_val;
351 - if (virStrToLong_ll(object->data.number, NULL, 10, &ll_val) < 0) {
352 - if (virStrToDouble(object->data.number, NULL, &d_val) < 0) {
353 - virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
354 - _("JSON value is not a number"));
355 - return NULL;
356 - }
357 - ret = json_real(d_val);
358 - } else {
359 - ret = json_integer(ll_val);
360 - }
361 - }
362 - break;
363 -
364 - case VIR_JSON_TYPE_BOOLEAN:
365 - ret = json_boolean(object->data.boolean);
366 - break;
367 -
368 - case VIR_JSON_TYPE_NULL:
369 - ret = json_null();
370 - break;
371 -
372 - default:
373 - virReportEnumRangeError(virJSONType, object->type);
374 - goto error;
375 - }
376 - if (!ret)
377 - goto no_memory;
378 - return ret;
379 -
380 - no_memory:
381 - virReportOOMError();
382 - error:
383 - json_decref(ret);
384 - return NULL;
385 -}
386 -
387 -
388 -char *
389 -virJSONValueToString(virJSONValuePtr object,
390 - bool pretty)
391 -{
392 - size_t flags = JSON_ENCODE_ANY;
393 - json_t *json;
394 - char *str = NULL;
395 -
396 - if (pretty)
397 - flags |= JSON_INDENT(2);
398 - else
399 - flags |= JSON_COMPACT;
400 -
401 - json = virJSONValueToJansson(object);
402 - if (!json)
403 - return NULL;
404 -
405 - str = json_dumps(json, flags);
406 - if (!str)
407 - virReportOOMError();
408 - json_decref(json);
409 - return str;
410 -}
411 -
412 -
413 #else
414 virJSONValuePtr
415 virJSONValueFromString(const char *jsonstring ATTRIBUTE_UNUSED)
416 diff --git a/tests/Makefile.am b/tests/Makefile.am
417 index 302b50e..21a6c82 100644
418 --- a/tests/Makefile.am
419 +++ b/tests/Makefile.am
420 @@ -46,7 +46,7 @@ AM_CFLAGS = \
421 $(SASL_CFLAGS) \
422 $(SELINUX_CFLAGS) \
423 $(APPARMOR_CFLAGS) \
424 - $(JANSSON_CFLAGS) \
425 + $(YAJL_CFLAGS) \
426 $(COVERAGE_CFLAGS) \
427 $(XDR_CFLAGS) \
428 $(WARN_CFLAGS)
429 @@ -331,9 +331,9 @@ if WITH_CIL
430 test_programs += objectlocking
431 endif WITH_CIL
432
433 -if WITH_JANSSON
434 +if WITH_YAJL
435 test_programs += virjsontest
436 -endif WITH_JANSSON
437 +endif WITH_YAJL
438
439 test_programs += \
440 networkxml2xmltest \
441 @@ -1219,15 +1219,15 @@ virdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)
442
443 test_libraries += virdeterministichashmock.la
444
445 -if WITH_JANSSON
446 +if WITH_YAJL
447 virmacmaptest_SOURCES = \
448 virmacmaptest.c testutils.h testutils.c
449 virmacmaptest_LDADD = $(LDADDS)
450
451 test_programs += virmacmaptest
452 -else ! WITH_JANSSON
453 +else ! WITH_YAJL
454 EXTRA_DIST += virmacmaptest.c
455 -endif ! WITH_JANSSON
456 +endif ! WITH_YAJL
457
458 virnetdevtest_SOURCES = \
459 virnetdevtest.c testutils.h testutils.c
460 diff --git a/tests/cputest.c b/tests/cputest.c
461 index 9cc361d..baf2b3c 100644
462 --- a/tests/cputest.c
463 +++ b/tests/cputest.c
464 @@ -40,7 +40,7 @@
465 #include "cpu/cpu_map.h"
466 #include "virstring.h"
467
468 -#if WITH_QEMU && WITH_JANSSON
469 +#if WITH_QEMU && WITH_YAJL
470 # include "testutilsqemu.h"
471 # include "qemumonitortestutils.h"
472 # define __QEMU_CAPSPRIV_H_ALLOW__
473 @@ -67,7 +67,7 @@ struct data {
474 int result;
475 };
476
477 -#if WITH_QEMU && WITH_JANSSON
478 +#if WITH_QEMU && WITH_YAJL
479 static virQEMUDriver driver;
480 #endif
481
482 @@ -479,7 +479,7 @@ typedef enum {
483 JSON_MODELS_REQUIRED,
484 } cpuTestCPUIDJson;
485
486 -#if WITH_QEMU && WITH_JANSSON
487 +#if WITH_QEMU && WITH_YAJL
488 static virQEMUCapsPtr
489 cpuTestMakeQEMUCaps(const struct data *data)
490 {
491 @@ -554,7 +554,7 @@ cpuTestGetCPUModels(const struct data *data,
492 return 0;
493 }
494
495 -#else /* if WITH_QEMU && WITH_JANSSON */
496 +#else /* if WITH_QEMU && WITH_YAJL */
497
498 static int
499 cpuTestGetCPUModels(const struct data *data,
500 @@ -834,7 +834,7 @@ cpuTestUpdateLive(const void *arg)
501 }
502
503
504 -#if WITH_QEMU && WITH_JANSSON
505 +#if WITH_QEMU && WITH_YAJL
506 static int
507 cpuTestJSONCPUID(const void *arg)
508 {
509 @@ -911,7 +911,7 @@ mymain(void)
510 virDomainCapsCPUModelsPtr ppc_models = NULL;
511 int ret = 0;
512
513 -#if WITH_QEMU && WITH_JANSSON
514 +#if WITH_QEMU && WITH_YAJL
515 if (qemuTestDriverInit(&driver) < 0)
516 return EXIT_FAILURE;
517
518 @@ -1004,7 +1004,7 @@ mymain(void)
519 host "/" cpu " (" #models ")", \
520 host, cpu, models, 0, result)
521
522 -#if WITH_QEMU && WITH_JANSSON
523 +#if WITH_QEMU && WITH_YAJL
524 # define DO_TEST_JSON(arch, host, json) \
525 do { \
526 if (json == JSON_MODELS) { \
527 @@ -1205,7 +1205,7 @@ mymain(void)
528 DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-X5460", JSON_NONE);
529
530 cleanup:
531 -#if WITH_QEMU && WITH_JANSSON
532 +#if WITH_QEMU && WITH_YAJL
533 qemuTestDriverFree(&driver);
534 #endif
535
536 diff --git a/tests/libxlxml2domconfigtest.c b/tests/libxlxml2domconfigtest.c
537 index a9758c4..b814461 100644
538 --- a/tests/libxlxml2domconfigtest.c
539 +++ b/tests/libxlxml2domconfigtest.c
540 @@ -33,7 +33,7 @@
541
542 #include "testutils.h"
543
544 -#if defined(WITH_LIBXL) && defined(WITH_JANSSON) && defined(HAVE_LIBXL_DOMAIN_CONFIG_FROM_JSON)
545 +#if defined(WITH_LIBXL) && defined(WITH_YAJL) && defined(HAVE_LIBXL_DOMAIN_CONFIG_FROM_JSON)
546
547 # include "internal.h"
548 # include "viralloc.h"
549 @@ -228,4 +228,4 @@ int main(void)
550 return EXIT_AM_SKIP;
551 }
552
553 -#endif /* WITH_LIBXL && WITH_JANSSON && HAVE_LIBXL_DOMAIN_CONFIG_FROM_JSON */
554 +#endif /* WITH_LIBXL && WITH_YAJL && HAVE_LIBXL_DOMAIN_CONFIG_FROM_JSON */
555 diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c
556 index 232b34f..2f79986 100644
557 --- a/tests/qemuagenttest.c
558 +++ b/tests/qemuagenttest.c
559 @@ -907,7 +907,7 @@ mymain(void)
560 {
561 int ret = 0;
562
563 -#if !WITH_JANSSON
564 +#if !WITH_YAJL
565 fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
566 return EXIT_AM_SKIP;
567 #endif
568 diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
569 index 9a387cf..0c335ab 100644
570 --- a/tests/qemublocktest.c
571 +++ b/tests/qemublocktest.c
572 @@ -309,7 +309,6 @@ testQemuDiskXMLToPropsValidateFile(const void *opaque)
573 goto cleanup;
574
575 virBufferAdd(&buf, jsonstr, -1);
576 - virBufferAddLit(&buf, "\n");
577 VIR_FREE(jsonstr);
578 }
579
580 diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c
581 index 641ec4f..4aec175 100644
582 --- a/tests/qemucapabilitiestest.c
583 +++ b/tests/qemucapabilitiestest.c
584 @@ -141,7 +141,7 @@ mymain(void)
585 int ret = 0;
586 testQemuData data;
587
588 -#if !WITH_JANSSON
589 +#if !WITH_YAJL
590 fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
591 return EXIT_AM_SKIP;
592 #endif
593 diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c
594 index e3b7b97..5b9152b 100644
595 --- a/tests/qemucaps2xmltest.c
596 +++ b/tests/qemucaps2xmltest.c
597 @@ -165,7 +165,7 @@ mymain(void)
598
599 testQemuData data;
600
601 -#if !WITH_JANSSON
602 +#if !WITH_YAJL
603 fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
604 return EXIT_AM_SKIP;
605 #endif
606 diff --git a/tests/qemucommandutiltest.c b/tests/qemucommandutiltest.c
607 index 8e57a1b..f0921e3 100644
608 --- a/tests/qemucommandutiltest.c
609 +++ b/tests/qemucommandutiltest.c
610 @@ -76,7 +76,7 @@ mymain(void)
611 int ret = 0;
612 testQemuCommandBuildObjectFromJSONData data1;
613
614 -#if !WITH_JANSSON
615 +#if !WITH_YAJL
616 fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
617 return EXIT_AM_SKIP;
618 #endif
619 diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
620 index 2fb96c6..5b1e0db 100644
621 --- a/tests/qemuhotplugtest.c
622 +++ b/tests/qemuhotplugtest.c
623 @@ -593,7 +593,7 @@ mymain(void)
624 struct qemuHotplugTestData data = {0};
625 struct testQemuHotplugCpuParams cpudata;
626
627 -#if !WITH_JANSSON
628 +#if !WITH_YAJL
629 fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
630 return EXIT_AM_SKIP;
631 #endif
632 diff --git a/tests/qemumigparamsdata/empty.json b/tests/qemumigparamsdata/empty.json
633 index 0967ef4..0db3279 100644
634 --- a/tests/qemumigparamsdata/empty.json
635 +++ b/tests/qemumigparamsdata/empty.json
636 @@ -1 +1,3 @@
637 -{}
638 +{
639 +
640 +}
641 diff --git a/tests/qemumigparamsdata/unsupported.json b/tests/qemumigparamsdata/unsupported.json
642 index 0967ef4..0db3279 100644
643 --- a/tests/qemumigparamsdata/unsupported.json
644 +++ b/tests/qemumigparamsdata/unsupported.json
645 @@ -1 +1,3 @@
646 -{}
647 +{
648 +
649 +}
650 diff --git a/tests/qemumigparamstest.c b/tests/qemumigparamstest.c
651 index b8af682..0532053 100644
652 --- a/tests/qemumigparamstest.c
653 +++ b/tests/qemumigparamstest.c
654 @@ -203,7 +203,7 @@ mymain(void)
655 virQEMUDriver driver;
656 int ret = 0;
657
658 -#if !WITH_JANSSON
659 +#if !WITH_YAJL
660 fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
661 return EXIT_AM_SKIP;
662 #endif
663 diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
664 index c11615f..e9b2632 100644
665 --- a/tests/qemumonitorjsontest.c
666 +++ b/tests/qemumonitorjsontest.c
667 @@ -2863,7 +2863,7 @@ mymain(void)
668 virJSONValuePtr metaschema = NULL;
669 char *metaschemastr = NULL;
670
671 -#if !WITH_JANSSON
672 +#if !WITH_YAJL
673 fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
674 return EXIT_AM_SKIP;
675 #endif
676 diff --git a/tests/virmacmaptestdata/empty.json b/tests/virmacmaptestdata/empty.json
677 index fe51488..41b42e6 100644
678 --- a/tests/virmacmaptestdata/empty.json
679 +++ b/tests/virmacmaptestdata/empty.json
680 @@ -1 +1,3 @@
681 -[]
682 +[
683 +
684 +]
685 diff --git a/tests/virmocklibxl.c b/tests/virmocklibxl.c
686 index 0a047c2..546c6d6 100644
687 --- a/tests/virmocklibxl.c
688 +++ b/tests/virmocklibxl.c
689 @@ -22,7 +22,7 @@
690
691 #include <config.h>
692
693 -#if defined(WITH_LIBXL) && defined(WITH_JANSSON)
694 +#if defined(WITH_LIBXL) && defined(WITH_YAJL)
695 # include "virmock.h"
696 # include <sys/stat.h>
697 # include <unistd.h>
698 @@ -136,4 +136,4 @@ VIR_MOCK_IMPL_RET_ARGS(stat, int,
699 return real_stat(path, sb);
700 }
701
702 -#endif /* WITH_LIBXL && WITH_JANSSON */
703 +#endif /* WITH_LIBXL && WITH_YAJL */
704 diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c
705 index cbc961d..6f4957f 100644
706 --- a/tests/virnetdaemontest.c
707 +++ b/tests/virnetdaemontest.c
708 @@ -26,7 +26,7 @@
709
710 #define VIR_FROM_THIS VIR_FROM_RPC
711
712 -#if defined(HAVE_SOCKETPAIR) && defined(WITH_JANSSON)
713 +#if defined(HAVE_SOCKETPAIR) && defined(WITH_YAJL)
714 struct testClientPriv {
715 int magic;
716 };
717 diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
718 index b20b5a8..68d0307 100644
719 --- a/tests/virstoragetest.c
720 +++ b/tests/virstoragetest.c
721 @@ -1317,7 +1317,7 @@ mymain(void)
722 " <host name='example.org' port='6000'/>\n"
723 "</source>\n");
724
725 -#ifdef WITH_JANSSON
726 +#ifdef WITH_YAJL
727 TEST_BACKING_PARSE("json:", NULL);
728 TEST_BACKING_PARSE("json:asdgsdfg", NULL);
729 TEST_BACKING_PARSE("json:{}", NULL);
730 @@ -1581,7 +1581,7 @@ mymain(void)
731 "<source protocol='vxhs' name='c6718f6b-0401-441d-a8c3-1f0064d75ee0'>\n"
732 " <host name='example.com' port='9999'/>\n"
733 "</source>\n");
734 -#endif /* WITH_JANSSON */
735 +#endif /* WITH_YAJL */
736
737 cleanup:
738 /* Final cleanup */
+0
-92
debian/patches/Revert-build-add-with-jansson.patch less more
0 From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
1 Date: Mon, 13 Aug 2018 13:41:14 +0200
2 Subject: Revert "build: add --with-jansson"
3 MIME-Version: 1.0
4 Content-Type: text/plain; charset="utf-8"
5 Content-Transfer-Encoding: 8bit
6
7 This reverts commit 12b34f094e2f1c7f414f4bb8f880a9d65c8fcd85.
8
9 Jansson cannot parse QEMU's quirky JSON.
10 Revert back to yajl.
11
12 https://bugzilla.redhat.com/show_bug.cgi?id=1614569
13
14 Conflicts:
15 configure.ac:
16 Commit 8aa85e0b introduced LIBVIRT_*_LIBISCSI macros.
17
18 Signed-off-by: Ján Tomko <jtomko@redhat.com>
19 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
20 ---
21 configure.ac | 6 +++---
22 m4/virt-jansson.m4 | 29 -----------------------------
23 2 files changed, 3 insertions(+), 32 deletions(-)
24 delete mode 100644 m4/virt-jansson.m4
25
26 diff --git a/configure.ac b/configure.ac
27 index 71666ba..411fbe5 100644
28 --- a/configure.ac
29 +++ b/configure.ac
30 @@ -250,7 +250,7 @@ LIBVIRT_ARG_FIREWALLD
31 LIBVIRT_ARG_FUSE
32 LIBVIRT_ARG_GLUSTER
33 LIBVIRT_ARG_HAL
34 -LIBVIRT_ARG_JANSSON
35 +LIBVIRT_ARG_LIBISCSI
36 LIBVIRT_ARG_LIBPCAP
37 LIBVIRT_ARG_LIBSSH
38 LIBVIRT_ARG_LIBXML
39 @@ -291,7 +291,7 @@ LIBVIRT_CHECK_FUSE
40 LIBVIRT_CHECK_GLUSTER
41 LIBVIRT_CHECK_GNUTLS
42 LIBVIRT_CHECK_HAL
43 -LIBVIRT_CHECK_JANSSON
44 +LIBVIRT_CHECK_LIBISCSI
45 LIBVIRT_CHECK_LIBNL
46 LIBVIRT_CHECK_LIBPARTED
47 LIBVIRT_CHECK_LIBPCAP
48 @@ -972,7 +972,7 @@ LIBVIRT_RESULT_FUSE
49 LIBVIRT_RESULT_GLUSTER
50 LIBVIRT_RESULT_GNUTLS
51 LIBVIRT_RESULT_HAL
52 -LIBVIRT_RESULT_JANSSON
53 +LIBVIRT_RESULT_LIBISCSI
54 LIBVIRT_RESULT_LIBNL
55 LIBVIRT_RESULT_LIBPCAP
56 LIBVIRT_RESULT_LIBSSH
57 diff --git a/m4/virt-jansson.m4 b/m4/virt-jansson.m4
58 deleted file mode 100644
59 index 206d6a5..0000000
60 --- a/m4/virt-jansson.m4
61 +++ /dev/null
62 @@ -1,29 +0,0 @@
63 -dnl The jansson library
64 -dnl
65 -dnl This library is free software; you can redistribute it and/or
66 -dnl modify it under the terms of the GNU Lesser General Public
67 -dnl License as published by the Free Software Foundation; either
68 -dnl version 2.1 of the License, or (at your option) any later version.
69 -dnl
70 -dnl This library is distributed in the hope that it will be useful,
71 -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
72 -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
73 -dnl Lesser General Public License for more details.
74 -dnl
75 -dnl You should have received a copy of the GNU Lesser General Public
76 -dnl License along with this library. If not, see
77 -dnl <http://www.gnu.org/licenses/>.
78 -dnl
79 -
80 -AC_DEFUN([LIBVIRT_ARG_JANSSON],[
81 - LIBVIRT_ARG_WITH_FEATURE([JANSSON], [jansson], [check])
82 -])
83 -
84 -AC_DEFUN([LIBVIRT_CHECK_JANSSON],[
85 - dnl Jansson http://www.digip.org/jansson/
86 - LIBVIRT_CHECK_PKG([JANSSON], [jansson], [2.5])
87 -])
88 -
89 -AC_DEFUN([LIBVIRT_RESULT_JANSSON],[
90 - LIBVIRT_RESULT_LIB([JANSSON])
91 -])
+0
-33
debian/patches/Revert-build-remove-references-to-WITH_YAJL-for-SETUID_RP.patch less more
0 From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
1 Date: Mon, 13 Aug 2018 13:40:02 +0200
2 Subject: Revert "build: remove references to WITH_YAJL for SETUID_RPC_CLIENT"
3 MIME-Version: 1.0
4 Content-Type: text/plain; charset="utf-8"
5 Content-Transfer-Encoding: 8bit
6
7 This reverts commit 1caf8441604b58e4a89aa2c09975b8346928c52a.
8
9 Jansson cannot parse QEMU's quirky JSON.
10 Revert back to yajl.
11
12 https://bugzilla.redhat.com/show_bug.cgi?id=1614569
13
14 Signed-off-by: Ján Tomko <jtomko@redhat.com>
15 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
16 ---
17 config-post.h | 2 ++
18 1 file changed, 2 insertions(+)
19
20 diff --git a/config-post.h b/config-post.h
21 index 0567212..24117bb 100644
22 --- a/config-post.h
23 +++ b/config-post.h
24 @@ -44,6 +44,8 @@
25 # undef WITH_SSH2
26 # undef WITH_SYSTEMD_DAEMON
27 # undef WITH_VIRTUALPORT
28 +# undef WITH_YAJL
29 +# undef WITH_YAJL2
30 #endif
31
32 /*
+0
-34
debian/patches/Revert-build-require-Jansson-if-QEMU-driver-is-enabled.patch less more
0 From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
1 Date: Mon, 13 Aug 2018 13:39:39 +0200
2 Subject: Revert "build: require Jansson if QEMU driver is enabled"
3 MIME-Version: 1.0
4 Content-Type: text/plain; charset="utf-8"
5 Content-Transfer-Encoding: 8bit
6
7 This reverts commit 01ce04375c3348fd683475e5aa5231149ef6a78a.
8
9 Jansson cannot parse QEMU's quirky JSON.
10 Revert back to yajl.
11
12 https://bugzilla.redhat.com/show_bug.cgi?id=1614569
13
14 Signed-off-by: Ján Tomko <jtomko@redhat.com>
15 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
16 ---
17 m4/virt-driver-qemu.m4 | 3 ---
18 1 file changed, 3 deletions(-)
19
20 diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4
21 index 2d9992d..ddb2834 100644
22 --- a/m4/virt-driver-qemu.m4
23 +++ b/m4/virt-driver-qemu.m4
24 @@ -27,9 +27,6 @@ AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [
25
26 AC_DEFUN([LIBVIRT_DRIVER_CHECK_QEMU], [
27 AC_REQUIRE([LIBVIRT_CHECK_JANSSON])
28 - if test "$with_qemu:$with_jansson" = "yes:no"; then
29 - AC_MSG_ERROR([Jansson >= 2.5 is required to build QEMU driver])
30 - fi
31 if test "$with_qemu" = "check"; then
32 with_qemu=$with_jansson
33 fi
+0
-44
debian/patches/Revert-build-switch-with-qemu-default-from-yes-to-check.patch less more
0 From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
1 Date: Mon, 13 Aug 2018 13:39:48 +0200
2 Subject: Revert "build: switch --with-qemu default from yes to check"
3 MIME-Version: 1.0
4 Content-Type: text/plain; charset="utf-8"
5 Content-Transfer-Encoding: 8bit
6
7 This reverts commit c5ae8e0c2b4b6bb3c667cfadaf65a66c3f4f3d85.
8
9 Jansson cannot parse QEMU's quirky JSON.
10 Revert back to yajl.
11
12 https://bugzilla.redhat.com/show_bug.cgi?id=1614569
13
14 Signed-off-by: Ján Tomko <jtomko@redhat.com>
15 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
16 ---
17 m4/virt-driver-qemu.m4 | 6 +-----
18 1 file changed, 1 insertion(+), 5 deletions(-)
19
20 diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4
21 index ddb2834..80e1d3a 100644
22 --- a/m4/virt-driver-qemu.m4
23 +++ b/m4/virt-driver-qemu.m4
24 @@ -18,7 +18,7 @@ dnl <http://www.gnu.org/licenses/>.
25 dnl
26
27 AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [
28 - LIBVIRT_ARG_WITH_FEATURE([QEMU], [QEMU/KVM], [check])
29 + LIBVIRT_ARG_WITH_FEATURE([QEMU], [QEMU/KVM], [yes])
30 LIBVIRT_ARG_WITH([QEMU_USER], [username to run QEMU system instance as],
31 ['platform dependent'])
32 LIBVIRT_ARG_WITH([QEMU_GROUP], [groupname to run QEMU system instance as],
33 @@ -26,10 +26,6 @@ AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [
34 ])
35
36 AC_DEFUN([LIBVIRT_DRIVER_CHECK_QEMU], [
37 - AC_REQUIRE([LIBVIRT_CHECK_JANSSON])
38 - if test "$with_qemu" = "check"; then
39 - with_qemu=$with_jansson
40 - fi
41 if test "$with_qemu" = "yes" ; then
42 AC_DEFINE_UNQUOTED([WITH_QEMU], 1, [whether QEMU driver is enabled])
43 fi
+0
-32
debian/patches/Revert-build-undef-WITH_JANSSON-for-SETUID_RPC_CLIENT.patch less more
0 From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
1 Date: Mon, 13 Aug 2018 13:40:25 +0200
2 Subject: Revert "build: undef WITH_JANSSON for SETUID_RPC_CLIENT"
3 MIME-Version: 1.0
4 Content-Type: text/plain; charset="utf-8"
5 Content-Transfer-Encoding: 8bit
6
7 This reverts commit 93fdc9e0b0cbb2eec32745a868ac4633f0912ad5.
8
9 Jansson cannot parse QEMU's quirky JSON.
10 Revert back to yajl.
11
12 https://bugzilla.redhat.com/show_bug.cgi?id=1614569
13
14 Signed-off-by: Ján Tomko <jtomko@redhat.com>
15 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
16 ---
17 config-post.h | 1 -
18 1 file changed, 1 deletion(-)
19
20 diff --git a/config-post.h b/config-post.h
21 index 24117bb..063e30f 100644
22 --- a/config-post.h
23 +++ b/config-post.h
24 @@ -36,7 +36,6 @@
25 # undef WITH_DEVMAPPER
26 # undef WITH_DTRACE_PROBES
27 # undef WITH_GNUTLS
28 -# undef WITH_JANSSON
29 # undef WITH_LIBSSH
30 # undef WITH_MACVTAP
31 # undef WITH_NUMACTL
+0
-187
debian/patches/Revert-m4-Introduce-STABLE_ORDERING_JANSSON.patch less more
0 From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
1 Date: Mon, 13 Aug 2018 13:39:33 +0200
2 Subject: Revert "m4: Introduce STABLE_ORDERING_JANSSON"
3 MIME-Version: 1.0
4 Content-Type: text/plain; charset="utf-8"
5 Content-Transfer-Encoding: 8bit
6
7 This reverts commit 4dd60540007042bfc0087a67f57f3e9f3311a84a.
8
9 Jansson cannot parse QEMU's quirky JSON.
10 Revert back to yajl.
11
12 https://bugzilla.redhat.com/show_bug.cgi?id=1614569
13
14 Signed-off-by: Ján Tomko <jtomko@redhat.com>
15 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
16 ---
17 m4/virt-jansson.m4 | 3 ---
18 tests/qemublocktest.c | 5 -----
19 tests/qemucapabilitiestest.c | 5 -----
20 tests/qemucommandutiltest.c | 5 -----
21 tests/qemuhotplugtest.c | 5 -----
22 tests/qemumigparamstest.c | 5 -----
23 tests/qemumonitorjsontest.c | 5 -----
24 tests/virjsontest.c | 5 -----
25 tests/virmacmaptest.c | 5 -----
26 tests/virnetdaemontest.c | 5 -----
27 10 files changed, 48 deletions(-)
28
29 diff --git a/m4/virt-jansson.m4 b/m4/virt-jansson.m4
30 index ab4c020..206d6a5 100644
31 --- a/m4/virt-jansson.m4
32 +++ b/m4/virt-jansson.m4
33 @@ -22,9 +22,6 @@ AC_DEFUN([LIBVIRT_ARG_JANSSON],[
34 AC_DEFUN([LIBVIRT_CHECK_JANSSON],[
35 dnl Jansson http://www.digip.org/jansson/
36 LIBVIRT_CHECK_PKG([JANSSON], [jansson], [2.5])
37 - dnl Older versions of Jansson did not preserve the order of object keys
38 - dnl use this check to guard the tests that are sensitive to this
39 - LIBVIRT_CHECK_PKG([STABLE_ORDERING_JANSSON], [jansson], [2.8], [true])
40 ])
41
42 AC_DEFUN([LIBVIRT_RESULT_JANSSON],[
43 diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
44 index d22b4b7..9a387cf 100644
45 --- a/tests/qemublocktest.c
46 +++ b/tests/qemublocktest.c
47 @@ -337,11 +337,6 @@ mymain(void)
48 char *capslatest_x86_64 = NULL;
49 virQEMUCapsPtr caps_x86_64 = NULL;
50
51 -#if !WITH_STABLE_ORDERING_JANSSON
52 - fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
53 - return EXIT_AM_SKIP;
54 -#endif
55 -
56 if (qemuTestDriverInit(&driver) < 0)
57 return EXIT_FAILURE;
58
59 diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c
60 index 28f903a..641ec4f 100644
61 --- a/tests/qemucapabilitiestest.c
62 +++ b/tests/qemucapabilitiestest.c
63 @@ -141,11 +141,6 @@ mymain(void)
64 int ret = 0;
65 testQemuData data;
66
67 -#if !WITH_STABLE_ORDERING_JANSSON
68 - fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
69 - return EXIT_AM_SKIP;
70 -#endif
71 -
72 #if !WITH_JANSSON
73 fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
74 return EXIT_AM_SKIP;
75 diff --git a/tests/qemucommandutiltest.c b/tests/qemucommandutiltest.c
76 index 9b13dde..8e57a1b 100644
77 --- a/tests/qemucommandutiltest.c
78 +++ b/tests/qemucommandutiltest.c
79 @@ -76,11 +76,6 @@ mymain(void)
80 int ret = 0;
81 testQemuCommandBuildObjectFromJSONData data1;
82
83 -#if !WITH_STABLE_ORDERING_JANSSON
84 - fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
85 - return EXIT_AM_SKIP;
86 -#endif
87 -
88 #if !WITH_JANSSON
89 fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
90 return EXIT_AM_SKIP;
91 diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
92 index 3c0eecb..2fb96c6 100644
93 --- a/tests/qemuhotplugtest.c
94 +++ b/tests/qemuhotplugtest.c
95 @@ -593,11 +593,6 @@ mymain(void)
96 struct qemuHotplugTestData data = {0};
97 struct testQemuHotplugCpuParams cpudata;
98
99 -#if !WITH_STABLE_ORDERING_JANSSON
100 - fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
101 - return EXIT_AM_SKIP;
102 -#endif
103 -
104 #if !WITH_JANSSON
105 fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
106 return EXIT_AM_SKIP;
107 diff --git a/tests/qemumigparamstest.c b/tests/qemumigparamstest.c
108 index 5e12430..b8af682 100644
109 --- a/tests/qemumigparamstest.c
110 +++ b/tests/qemumigparamstest.c
111 @@ -203,11 +203,6 @@ mymain(void)
112 virQEMUDriver driver;
113 int ret = 0;
114
115 -#if !WITH_STABLE_ORDERING_JANSSON
116 - fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
117 - return EXIT_AM_SKIP;
118 -#endif
119 -
120 #if !WITH_JANSSON
121 fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
122 return EXIT_AM_SKIP;
123 diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
124 index 1826c4f..c11615f 100644
125 --- a/tests/qemumonitorjsontest.c
126 +++ b/tests/qemumonitorjsontest.c
127 @@ -2863,11 +2863,6 @@ mymain(void)
128 virJSONValuePtr metaschema = NULL;
129 char *metaschemastr = NULL;
130
131 -#if !WITH_STABLE_ORDERING_JANSSON
132 - fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
133 - return EXIT_AM_SKIP;
134 -#endif
135 -
136 #if !WITH_JANSSON
137 fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
138 return EXIT_AM_SKIP;
139 diff --git a/tests/virjsontest.c b/tests/virjsontest.c
140 index d352d37..d42413d 100644
141 --- a/tests/virjsontest.c
142 +++ b/tests/virjsontest.c
143 @@ -479,11 +479,6 @@ mymain(void)
144 {
145 int ret = 0;
146
147 -#if !WITH_STABLE_ORDERING_JANSSON
148 - fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
149 - return EXIT_AM_SKIP;
150 -#endif
151 -
152 #define DO_TEST_FULL(name, cmd, doc, expect, pass) \
153 do { \
154 struct testInfo info = { doc, expect, pass }; \
155 diff --git a/tests/virmacmaptest.c b/tests/virmacmaptest.c
156 index 420531d..6e3e998 100644
157 --- a/tests/virmacmaptest.c
158 +++ b/tests/virmacmaptest.c
159 @@ -157,11 +157,6 @@ mymain(void)
160 int ret = 0;
161 virMacMapPtr mgr = NULL;
162
163 -#if !WITH_STABLE_ORDERING_JANSSON
164 - fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
165 - return EXIT_AM_SKIP;
166 -#endif
167 -
168 #define DO_TEST_BASIC(f, d, ...) \
169 do { \
170 const char * const m[] = {__VA_ARGS__, NULL }; \
171 diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c
172 index 277fb06..cbc961d 100644
173 --- a/tests/virnetdaemontest.c
174 +++ b/tests/virnetdaemontest.c
175 @@ -375,11 +375,6 @@ mymain(void)
176 int ret = 0;
177 const char *server_names[] = { "testServer0", "testServer1" };
178
179 -# if !WITH_STABLE_ORDERING_JANSSON
180 - fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
181 - return EXIT_AM_SKIP;
182 -# endif
183 -
184 if (virInitialize() < 0 ||
185 virEventRegisterDefaultImpl() < 0) {
186 virDispatchError(NULL);
+0
-59
debian/patches/Revert-remote-daemon-Make-sure-that-JSON-symbols-are-prop.patch less more
0 From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
1 Date: Mon, 13 Aug 2018 13:38:38 +0200
2 Subject: Revert "remote: daemon: Make sure that JSON symbols are properly
3 loaded at startup"
4 MIME-Version: 1.0
5 Content-Type: text/plain; charset="utf-8"
6 Content-Transfer-Encoding: 8bit
7
8 This reverts commit 3251fc9c9b9639c3fec3181530599415523d671a.
9
10 Jansson cannot parse QEMU's quirky JSON.
11 Revert back to yajl.
12
13 https://bugzilla.redhat.com/show_bug.cgi?id=1614569
14
15 Signed-off-by: Ján Tomko <jtomko@redhat.com>
16 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
17 ---
18 src/libvirt_private.syms | 4 ----
19 src/remote/remote_daemon.c | 4 ----
20 2 files changed, 8 deletions(-)
21
22 diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
23 index 70dfcc5..fc386e1 100644
24 --- a/src/libvirt_private.syms
25 +++ b/src/libvirt_private.syms
26 @@ -2135,10 +2135,6 @@ virJSONValueObjectStealObject;
27 virJSONValueToString;
28
29
30 -# util/virjsoncompat.h
31 -virJSONInitialize;
32 -
33 -
34 # util/virkeycode.h
35 virKeycodeSetTypeFromString;
36 virKeycodeSetTypeToString;
37 diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c
38 index 8bbc381..9f3a5f3 100644
39 --- a/src/remote/remote_daemon.c
40 +++ b/src/remote/remote_daemon.c
41 @@ -59,7 +59,6 @@
42 #include "virutil.h"
43 #include "virgettext.h"
44 #include "util/virnetdevopenvswitch.h"
45 -#include "virjsoncompat.h"
46
47 #include "driver.h"
48
49 @@ -1184,9 +1183,6 @@ int main(int argc, char **argv) {
50 exit(EXIT_FAILURE);
51 }
52
53 - if (virJSONInitialize() < 0)
54 - exit(EXIT_FAILURE);
55 -
56 daemonSetupNetDevOpenvswitch(config);
57
58 if (daemonSetupAccessManager(config) < 0) {
+0
-35
debian/patches/Revert-tests-also-skip-qemuagenttest-with-old-jansson.patch less more
0 From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
1 Date: Mon, 13 Aug 2018 13:39:25 +0200
2 Subject: Revert "tests: also skip qemuagenttest with old jansson"
3 MIME-Version: 1.0
4 Content-Type: text/plain; charset="utf-8"
5 Content-Transfer-Encoding: 8bit
6
7 This reverts commit c31146685f5c8558ff88d52d03a68533c9220feb.
8
9 Jansson cannot parse QEMU's quirky JSON.
10 Revert back to yajl.
11
12 https://bugzilla.redhat.com/show_bug.cgi?id=1614569
13
14 Signed-off-by: Ján Tomko <jtomko@redhat.com>
15 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
16 ---
17 tests/qemuagenttest.c | 4 ++--
18 1 file changed, 2 insertions(+), 2 deletions(-)
19
20 diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c
21 index b3d737d..232b34f 100644
22 --- a/tests/qemuagenttest.c
23 +++ b/tests/qemuagenttest.c
24 @@ -907,8 +907,8 @@ mymain(void)
25 {
26 int ret = 0;
27
28 -#if !WITH_STABLE_ORDERING_JANSSON
29 - fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
30 +#if !WITH_JANSSON
31 + fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
32 return EXIT_AM_SKIP;
33 #endif
34
+0
-40
debian/patches/Revert-tests-qemucapsprobe-Fix-output-after-switching-to-.patch less more
0 From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
1 Date: Mon, 13 Aug 2018 13:39:09 +0200
2 Subject: Revert "tests: qemucapsprobe: Fix output after switching to jansson"
3 MIME-Version: 1.0
4 Content-Type: text/plain; charset="utf-8"
5 Content-Transfer-Encoding: 8bit
6
7 This reverts commit 397447f80588438545994a86883792a5999cad15.
8
9 Jansson cannot parse QEMU's quirky JSON.
10 Revert back to yajl.
11
12 https://bugzilla.redhat.com/show_bug.cgi?id=1614569
13
14 Signed-off-by: Ján Tomko <jtomko@redhat.com>
15 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
16 ---
17 tests/qemucapsprobemock.c | 2 --
18 1 file changed, 2 deletions(-)
19
20 diff --git a/tests/qemucapsprobemock.c b/tests/qemucapsprobemock.c
21 index 049b162..5936975 100644
22 --- a/tests/qemucapsprobemock.c
23 +++ b/tests/qemucapsprobemock.c
24 @@ -76,7 +76,6 @@ qemuMonitorSend(qemuMonitorPtr mon,
25 printLineSkipEmpty("\n", stdout);
26
27 printLineSkipEmpty(reformatted, stdout);
28 - printLineSkipEmpty("\n", stdout);
29 VIR_FREE(reformatted);
30
31 return realQemuMonitorSend(mon, msg);
32 @@ -117,7 +116,6 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
33 printLineSkipEmpty("\n", stdout);
34
35 printLineSkipEmpty(json, stdout);
36 - printLineSkipEmpty("\n", stdout);
37 }
38
39 cleanup:
+0
-509
debian/patches/Revert-util-avoid-symbol-clash-between-json-libraries.patch less more
0 From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
1 Date: Mon, 13 Aug 2018 13:39:16 +0200
2 Subject: Revert "util: avoid symbol clash between json libraries"
3 MIME-Version: 1.0
4 Content-Type: text/plain; charset="utf-8"
5 Content-Transfer-Encoding: 8bit
6
7 This reverts commit ce3c6ef6843f98d81be5423ece11fad79eaab920.
8
9 Jansson cannot parse QEMU's quirky JSON.
10 Revert back to yajl.
11
12 https://bugzilla.redhat.com/show_bug.cgi?id=1614569
13
14 Signed-off-by: Ján Tomko <jtomko@redhat.com>
15 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
16 ---
17 libvirt.spec.in | 2 -
18 src/Makefile.am | 8 +-
19 src/util/Makefile.inc.am | 3 +-
20 src/util/virjson.c | 9 +-
21 src/util/virjsoncompat.c | 274 -----------------------------------------------
22 src/util/virjsoncompat.h | 88 ---------------
23 6 files changed, 7 insertions(+), 377 deletions(-)
24 delete mode 100644 src/util/virjsoncompat.c
25 delete mode 100644 src/util/virjsoncompat.h
26
27 diff --git a/libvirt.spec.in b/libvirt.spec.in
28 index 19ae55c..4113579 100644
29 --- a/libvirt.spec.in
30 +++ b/libvirt.spec.in
31 @@ -898,8 +898,6 @@ Requires: ncurses
32 Requires: gettext
33 # Needed by virt-pki-validate script.
34 Requires: gnutls-utils
35 -# We dlopen(libjansson.so.4), so need an explicit dep
36 -Requires: jansson
37 %if %{with_bash_completion}
38 Requires: %{name}-bash-completion = %{version}-%{release}
39 %endif
40 diff --git a/src/Makefile.am b/src/Makefile.am
41 index 5cefccf..702e900 100644
42 --- a/src/Makefile.am
43 +++ b/src/Makefile.am
44 @@ -552,6 +552,7 @@ libvirt_admin_la_CFLAGS += \
45
46 libvirt_admin_la_LIBADD += \
47 $(CAPNG_LIBS) \
48 + $(JANSSON_LIBS) \
49 $(DEVMAPPER_LIBS) \
50 $(LIBXML_LIBS) \
51 $(SSH2_LIBS) \
52 @@ -689,7 +690,6 @@ libvirt_setuid_rpc_client_la_SOURCES = \
53 util/virhashcode.c \
54 util/virhostcpu.c \
55 util/virjson.c \
56 - util/virjsoncompat.c \
57 util/virlog.c \
58 util/virobject.c \
59 util/virpidfile.c \
60 @@ -960,8 +960,6 @@ libvirt_nss_la_SOURCES = \
61 util/virhashcode.h \
62 util/virjson.c \
63 util/virjson.h \
64 - util/virjsoncompat.c \
65 - util/virjsoncompat.h \
66 util/virkmod.c \
67 util/virkmod.h \
68 util/virlease.c \
69 @@ -1000,6 +998,10 @@ libvirt_nss_la_CFLAGS = \
70 libvirt_nss_la_LDFLAGS = \
71 $(AM_LDFLAGS) \
72 $(NULL)
73 +
74 +libvirt_nss_la_LIBADD = \
75 + $(JANSSON_LIBS) \
76 + $(NULL)
77 endif WITH_NSS
78
79
80 diff --git a/src/util/Makefile.inc.am b/src/util/Makefile.inc.am
81 index 8ef9ee1..71b2b93 100644
82 --- a/src/util/Makefile.inc.am
83 +++ b/src/util/Makefile.inc.am
84 @@ -86,8 +86,6 @@ UTIL_SOURCES = \
85 util/viriscsi.h \
86 util/virjson.c \
87 util/virjson.h \
88 - util/virjsoncompat.c \
89 - util/virjsoncompat.h \
90 util/virkeycode.c \
91 util/virkeycode.h \
92 util/virkeyfile.c \
93 @@ -266,6 +264,7 @@ libvirt_util_la_CFLAGS = \
94 $(NULL)
95 libvirt_util_la_LIBADD = \
96 $(CAPNG_LIBS) \
97 + $(JANSSON_LIBS) \
98 $(LIBNL_LIBS) \
99 $(THREAD_LIBS) \
100 $(AUDIT_LIBS) \
101 diff --git a/src/util/virjson.c b/src/util/virjson.c
102 index 5bab662..01a387b 100644
103 --- a/src/util/virjson.c
104 +++ b/src/util/virjson.c
105 @@ -1437,8 +1437,7 @@ virJSONValueCopy(const virJSONValue *in)
106
107
108 #if WITH_JANSSON
109 -
110 -# include "virjsoncompat.h"
111 +# include <jansson.h>
112
113 static virJSONValuePtr
114 virJSONValueFromJansson(json_t *json)
115 @@ -1525,9 +1524,6 @@ virJSONValueFromString(const char *jsonstring)
116 size_t flags = JSON_REJECT_DUPLICATES |
117 JSON_DECODE_ANY;
118
119 - if (virJSONInitialize() < 0)
120 - return NULL;
121 -
122 if (!(json = json_loads(jsonstring, flags, &error))) {
123 virReportError(VIR_ERR_INTERNAL_ERROR,
124 _("failed to parse JSON %d:%d: %s"),
125 @@ -1634,9 +1630,6 @@ virJSONValueToString(virJSONValuePtr object,
126 json_t *json;
127 char *str = NULL;
128
129 - if (virJSONInitialize() < 0)
130 - return NULL;
131 -
132 if (pretty)
133 flags |= JSON_INDENT(2);
134 else
135 diff --git a/src/util/virjsoncompat.c b/src/util/virjsoncompat.c
136 deleted file mode 100644
137 index 6c853e9..0000000
138 --- a/src/util/virjsoncompat.c
139 +++ /dev/null
140 @@ -1,274 +0,0 @@
141 -/*
142 - * virjsoncompat.c: JSON object parsing/formatting
143 - *
144 - * Copyright (C) 2018 Red Hat, Inc.
145 - *
146 - * This library is free software; you can redistribute it and/or
147 - * modify it under the terms of the GNU Lesser General Public
148 - * License as published by the Free Software Foundation; either
149 - * version 2.1 of the License, or (at your option) any later version.
150 - *
151 - * This library is distributed in the hope that it will be useful,
152 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
153 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
154 - * Lesser General Public License for more details.
155 - *
156 - * You should have received a copy of the GNU Lesser General Public
157 - * License along with this library. If not, see
158 - * <http://www.gnu.org/licenses/>.
159 - *
160 - */
161 -
162 -#include <config.h>
163 -
164 -#include "virthread.h"
165 -#include "virerror.h"
166 -#define VIR_JSON_COMPAT_IMPL
167 -#include "virjsoncompat.h"
168 -
169 -#define VIR_FROM_THIS VIR_FROM_NONE
170 -
171 -#if WITH_JANSSON
172 -
173 -# include <dlfcn.h>
174 -
175 -json_t *(*json_array_ptr)(void);
176 -int (*json_array_append_new_ptr)(json_t *array, json_t *value);
177 -json_t *(*json_array_get_ptr)(const json_t *array, size_t index);
178 -size_t (*json_array_size_ptr)(const json_t *array);
179 -void (*json_delete_ptr)(json_t *json);
180 -char *(*json_dumps_ptr)(const json_t *json, size_t flags);
181 -json_t *(*json_false_ptr)(void);
182 -json_t *(*json_integer_ptr)(json_int_t value);
183 -json_int_t (*json_integer_value_ptr)(const json_t *integer);
184 -json_t *(*json_loads_ptr)(const char *input, size_t flags, json_error_t *error);
185 -json_t *(*json_null_ptr)(void);
186 -json_t *(*json_object_ptr)(void);
187 -void *(*json_object_iter_ptr)(json_t *object);
188 -const char *(*json_object_iter_key_ptr)(void *iter);
189 -void *(*json_object_iter_next_ptr)(json_t *object, void *iter);
190 -json_t *(*json_object_iter_value_ptr)(void *iter);
191 -void *(*json_object_key_to_iter_ptr)(const char *key);
192 -int (*json_object_set_new_ptr)(json_t *object, const char *key, json_t *value);
193 -json_t *(*json_real_ptr)(double value);
194 -double (*json_real_value_ptr)(const json_t *real);
195 -json_t *(*json_string_ptr)(const char *value);
196 -const char *(*json_string_value_ptr)(const json_t *string);
197 -json_t *(*json_true_ptr)(void);
198 -
199 -
200 -static int
201 -virJSONJanssonOnceInit(void)
202 -{
203 - void *handle = dlopen("libjansson.so.4", RTLD_LAZY|RTLD_LOCAL|RTLD_NODELETE);
204 - if (!handle) {
205 - virReportError(VIR_ERR_NO_SUPPORT,
206 - _("libjansson.so.4 JSON library not available: %s"), dlerror());
207 - return -1;
208 - }
209 -
210 -# define LOAD(name) \
211 - do { \
212 - if (!(name ## _ptr = dlsym(handle, #name))) { \
213 - virReportError(VIR_ERR_NO_SUPPORT, \
214 - _("missing symbol '%s' in libjansson.so.4: %s"), #name, dlerror()); \
215 - return -1; \
216 - } \
217 - } while (0)
218 -
219 - LOAD(json_array);
220 - LOAD(json_array_append_new);
221 - LOAD(json_array_get);
222 - LOAD(json_array_size);
223 - LOAD(json_delete);
224 - LOAD(json_dumps);
225 - LOAD(json_false);
226 - LOAD(json_integer);
227 - LOAD(json_integer_value);
228 - LOAD(json_loads);
229 - LOAD(json_null);
230 - LOAD(json_object);
231 - LOAD(json_object_iter);
232 - LOAD(json_object_iter_key);
233 - LOAD(json_object_iter_next);
234 - LOAD(json_object_iter_value);
235 - LOAD(json_object_key_to_iter);
236 - LOAD(json_object_set_new);
237 - LOAD(json_real);
238 - LOAD(json_real_value);
239 - LOAD(json_string);
240 - LOAD(json_string_value);
241 - LOAD(json_true);
242 -
243 - return 0;
244 -}
245 -
246 -VIR_ONCE_GLOBAL_INIT(virJSONJansson);
247 -
248 -int
249 -virJSONInitialize(void)
250 -{
251 - return virJSONJanssonInitialize();
252 -}
253 -
254 -json_t *
255 -json_array_impl(void)
256 -{
257 - return json_array_ptr();
258 -}
259 -
260 -
261 -int
262 -json_array_append_new_impl(json_t *array, json_t *value)
263 -{
264 - return json_array_append_new_ptr(array, value);
265 -}
266 -
267 -
268 -json_t *
269 -json_array_get_impl(const json_t *array, size_t index)
270 -{
271 - return json_array_get_ptr(array, index);
272 -}
273 -
274 -
275 -size_t
276 -json_array_size_impl(const json_t *array)
277 -{
278 - return json_array_size_ptr(array);
279 -}
280 -
281 -
282 -void
283 -json_delete_impl(json_t *json)
284 -{
285 - return json_delete_ptr(json);
286 -}
287 -
288 -
289 -char *
290 -json_dumps_impl(const json_t *json, size_t flags)
291 -{
292 - return json_dumps_ptr(json, flags);
293 -}
294 -
295 -
296 -json_t *
297 -json_false_impl(void)
298 -{
299 - return json_false_ptr();
300 -}
301 -
302 -
303 -json_t *
304 -json_integer_impl(json_int_t value)
305 -{
306 - return json_integer_ptr(value);
307 -}
308 -
309 -
310 -json_int_t
311 -json_integer_value_impl(const json_t *integer)
312 -{
313 - return json_integer_value_ptr(integer);
314 -}
315 -
316 -
317 -json_t *
318 -json_loads_impl(const char *input, size_t flags, json_error_t *error)
319 -{
320 - return json_loads_ptr(input, flags, error);
321 -}
322 -
323 -
324 -json_t *
325 -json_null_impl(void)
326 -{
327 - return json_null_ptr();
328 -}
329 -
330 -
331 -json_t *
332 -json_object_impl(void)
333 -{
334 - return json_object_ptr();
335 -}
336 -
337 -
338 -void *
339 -json_object_iter_impl(json_t *object)
340 -{
341 - return json_object_iter_ptr(object);
342 -}
343 -
344 -
345 -const char *
346 -json_object_iter_key_impl(void *iter)
347 -{
348 - return json_object_iter_key_ptr(iter);
349 -}
350 -
351 -
352 -void *
353 -json_object_iter_next_impl(json_t *object, void *iter)
354 -{
355 - return json_object_iter_next_ptr(object, iter);
356 -}
357 -
358 -
359 -json_t *
360 -json_object_iter_value_impl(void *iter)
361 -{
362 - return json_object_iter_value_ptr(iter);
363 -}
364 -
365 -
366 -void *
367 -json_object_key_to_iter_impl(const char *key)
368 -{
369 - return json_object_key_to_iter_ptr(key);
370 -}
371 -
372 -
373 -int
374 -json_object_set_new_impl(json_t *object, const char *key, json_t *value)
375 -{
376 - return json_object_set_new_ptr(object, key, value);
377 -}
378 -
379 -
380 -json_t *
381 -json_real_impl(double value)
382 -{
383 - return json_real_ptr(value);
384 -}
385 -
386 -
387 -double
388 -json_real_value_impl(const json_t *real)
389 -{
390 - return json_real_value_ptr(real);
391 -}
392 -
393 -
394 -json_t *
395 -json_string_impl(const char *value)
396 -{
397 - return json_string_ptr(value);
398 -}
399 -
400 -
401 -const char *
402 -json_string_value_impl(const json_t *string)
403 -{
404 - return json_string_value_ptr(string);
405 -}
406 -
407 -
408 -json_t *
409 -json_true_impl(void)
410 -{
411 - return json_true_ptr();
412 -}
413 -
414 -#endif /* WITH_JANSSON */
415 diff --git a/src/util/virjsoncompat.h b/src/util/virjsoncompat.h
416 deleted file mode 100644
417 index d9b7765..0000000
418 --- a/src/util/virjsoncompat.h
419 +++ /dev/null
420 @@ -1,88 +0,0 @@
421 -/*
422 - * virjsoncompat.h: JSON object parsing/formatting
423 - *
424 - * Copyright (C) 2018 Red Hat, Inc.
425 - *
426 - * This library is free software; you can redistribute it and/or
427 - * modify it under the terms of the GNU Lesser General Public
428 - * License as published by the Free Software Foundation; either
429 - * version 2.1 of the License, or (at your option) any later version.
430 - *
431 - * This library is distributed in the hope that it will be useful,
432 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
433 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
434 - * Lesser General Public License for more details.
435 - *
436 - * You should have received a copy of the GNU Lesser General Public
437 - * License along with this library. If not, see
438 - * <http://www.gnu.org/licenses/>.
439 - *
440 - */
441 -
442 -
443 -#ifndef __VIR_JSON_COMPAT_H_
444 -# define __VIR_JSON_COMPAT_H_
445 -
446 -# if WITH_JANSSON
447 -# ifndef VIR_JSON_COMPAT_IMPL
448 -
449 -# define json_array json_array_impl
450 -# define json_array_append_new json_array_append_new_impl
451 -# define json_array_get json_array_get_impl
452 -# define json_array_size json_array_size_impl
453 -# define json_delete json_delete_impl
454 -# define json_dumps json_dumps_impl
455 -# define json_false json_false_impl
456 -# define json_integer json_integer_impl
457 -# define json_integer_value json_integer_value_impl
458 -# define json_loads json_loads_impl
459 -# define json_null json_null_impl
460 -# define json_object json_object_impl
461 -# define json_object_iter json_object_iter_impl
462 -# define json_object_iter_key json_object_iter_key_impl
463 -# define json_object_iter_next json_object_iter_next_impl
464 -# define json_object_iter_value json_object_iter_value_impl
465 -# define json_object_key_to_iter json_object_key_to_iter_impl
466 -# define json_object_set_new json_object_set_new_impl
467 -# define json_real json_real_impl
468 -# define json_real_value json_real_value_impl
469 -# define json_string json_string_impl
470 -# define json_string_value json_string_value_impl
471 -# define json_true json_true_impl
472 -
473 -# endif /* ! VIR_JSON_COMPAT_IMPL */
474 -
475 -# include <jansson.h>
476 -
477 -# ifdef VIR_JSON_COMPAT_IMPL
478 -
479 -json_t *json_array_impl(void);
480 -int json_array_append_new_impl(json_t *array, json_t *value);
481 -json_t *json_array_get_impl(const json_t *array, size_t index);
482 -size_t json_array_size_impl(const json_t *array);
483 -void json_delete_impl(json_t *json);
484 -char *json_dumps_impl(const json_t *json, size_t flags);
485 -json_t *json_false_impl(void);
486 -json_t *json_integer_impl(json_int_t value);
487 -json_int_t json_integer_value_impl(const json_t *integer);
488 -json_t *json_loads_impl(const char *input, size_t flags, json_error_t *error);
489 -json_t *json_null_impl(void);
490 -json_t *json_object_impl(void);
491 -void *json_object_iter_impl(json_t *object);
492 -const char *json_object_iter_key_impl(void *iter);
493 -void *json_object_iter_next_impl(json_t *object, void *iter);
494 -json_t *json_object_iter_value_impl(void *iter);
495 -void *json_object_key_to_iter_impl(const char *key);
496 -int json_object_set_new_impl(json_t *object, const char *key, json_t *value);
497 -json_t *json_real_impl(double value);
498 -double json_real_value_impl(const json_t *real);
499 -json_t *json_string_impl(const char *value);
500 -const char *json_string_value_impl(const json_t *string);
501 -json_t *json_true_impl(void);
502 -
503 -# endif /* VIR_JSON_COMPAT_IMPL */
504 -# endif /* WITH_JANSSON */
505 -
506 -int virJSONInitialize(void);
507 -
508 -#endif /* __VIR_JSON_COMPAT_H_ */
+0
-42
debian/patches/Revert-util-jsoncompat-Stub-out-virJSONInitialize-when-co.patch less more
0 From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
1 Date: Mon, 13 Aug 2018 13:38:46 +0200
2 Subject: Revert "util: jsoncompat: Stub out virJSONInitialize when compiling
3 without jansson"
4 MIME-Version: 1.0
5 Content-Type: text/plain; charset="utf-8"
6 Content-Transfer-Encoding: 8bit
7
8 This reverts commit 9e44c2db8ad94d3c20acc1d081538c280af198b4.
9
10 Jansson cannot parse QEMU's quirky JSON.
11 Revert back to yajl.
12
13 https://bugzilla.redhat.com/show_bug.cgi?id=1614569
14
15 Signed-off-by: Ján Tomko <jtomko@redhat.com>
16 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
17 ---
18 src/util/virjsoncompat.c | 13 +------------
19 1 file changed, 1 insertion(+), 12 deletions(-)
20
21 diff --git a/src/util/virjsoncompat.c b/src/util/virjsoncompat.c
22 index ffbeb54..6c853e9 100644
23 --- a/src/util/virjsoncompat.c
24 +++ b/src/util/virjsoncompat.c
25 @@ -271,15 +271,4 @@ json_true_impl(void)
26 return json_true_ptr();
27 }
28
29 -
30 -#else /* !WITH_JANSSON */
31 -
32 -
33 -int
34 -virJSONInitialize(void)
35 -{
36 - return 0;
37 -}
38 -
39 -
40 -#endif /* !WITH_JANSSON */
41 +#endif /* WITH_JANSSON */
88 2 files changed, 2 insertions(+), 4 deletions(-)
99
1010 diff --git a/src/Makefile.in b/src/Makefile.in
11 index 6b93a2b..c1530a4 100644
11 index 0372d58..126e072 100644
1212 --- a/src/Makefile.in
1313 +++ b/src/Makefile.in
14 @@ -13124,8 +13124,7 @@ lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
14 @@ -13214,8 +13214,7 @@ lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
1515 @WITH_NETWORK_TRUE@ $(DESTDIR)$(confdir)/qemu/networks/default.xml && \
1616 @WITH_NETWORK_TRUE@ rm $(DESTDIR)$(confdir)/qemu/networks/default.xml.t; }
1717 @WITH_NETWORK_TRUE@ ( cd $(DESTDIR)$(confdir)/qemu/networks/autostart && \
1010 1 file changed, 1 insertion(+), 1 deletion(-)
1111
1212 diff --git a/configure.ac b/configure.ac
13 index c6287f6..71666ba 100644
13 index da940e3..a676b86 100644
1414 --- a/configure.ac
1515 +++ b/configure.ac
1616 @@ -110,7 +110,7 @@ then
99 3 files changed, 4 insertions(+), 5 deletions(-)
1010
1111 diff --git a/src/Makefile.am b/src/Makefile.am
12 index a4f2134..5cefccf 100644
12 index 2a3ed0d..562c91c 100644
1313 --- a/src/Makefile.am
1414 +++ b/src/Makefile.am
15 @@ -812,7 +812,6 @@ else ! WITH_LIBVIRTD
15 @@ -807,7 +807,6 @@ else ! WITH_LIBVIRTD
1616 install-logrotate:
1717 uninstall-logrotate:
1818 endif ! WITH_LIBVIRTD
2121 install-init:: $(SYSVINIT_FILES) install-sysconfig
2222 $(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2323 diff --git a/src/Makefile.in b/src/Makefile.in
24 index c1530a4..bb942b4 100644
24 index 126e072..42e92bc 100644
2525 --- a/src/Makefile.in
2626 +++ b/src/Makefile.in
27 @@ -13173,12 +13173,12 @@ lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
27 @@ -13263,12 +13263,12 @@ lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
2828 @WITH_LIBVIRTD_TRUE@@WITH_POLKIT_TRUE@ $(DESTDIR)$(policydir)/org.libvirt.unix.policy
2929 @WITH_LIBVIRTD_TRUE@@WITH_POLKIT_TRUE@ $(MKDIR_P) $(DESTDIR)$(datadir)/polkit-1/rules.d
3030 @WITH_LIBVIRTD_TRUE@@WITH_POLKIT_TRUE@ $(INSTALL_DATA) $(srcdir)/remote/libvirtd.rules \
1919 #include <local/usr.lib.libvirt.virt-aa-helper>
2020 }
2121 diff --git a/examples/apparmor/usr.sbin.libvirtd b/examples/apparmor/usr.sbin.libvirtd
22 index 3102cab..3a6c7d6 100644
22 index f0ffc53..c7c52c6 100644
2323 --- a/examples/apparmor/usr.sbin.libvirtd
2424 +++ b/examples/apparmor/usr.sbin.libvirtd
25 @@ -126,4 +126,7 @@
25 @@ -128,4 +128,7 @@
2626
2727 /usr/{lib,lib64,lib/qemu,libexec}/qemu-bridge-helper rmix,
2828 }
66 1 file changed, 1 insertion(+), 1 deletion(-)
77
88 diff --git a/tools/virsh.pod b/tools/virsh.pod
9 index a5e02c6..e9ef5c0 100644
9 index 86c041d..9a11fef 100644
1010 --- a/tools/virsh.pod
1111 +++ b/tools/virsh.pod
1212 @@ -119,7 +119,7 @@ virsh is coming from and which options and driver are compiled in.
1414 Pass-GPG_TTY-env-var-to-the-ssh-binary.patch
1515 apparmor-Allow-virt-aa-helper-to-access-the-name-service-.patch
1616 debian/Prefer-sbin-over-usr-sbin.patch
17 Revert-remote-daemon-Make-sure-that-JSON-symbols-are-prop.patch
18 Revert-util-jsoncompat-Stub-out-virJSONInitialize-when-co.patch
19 Revert-tests-qemucapsprobe-Fix-output-after-switching-to-.patch
20 Revert-util-avoid-symbol-clash-between-json-libraries.patch
21 Revert-tests-also-skip-qemuagenttest-with-old-jansson.patch
22 Revert-m4-Introduce-STABLE_ORDERING_JANSSON.patch
23 Revert-build-require-Jansson-if-QEMU-driver-is-enabled.patch
24 Revert-build-switch-with-qemu-default-from-yes-to-check.patch
25 Revert-Remove-virJSONValueNewStringLen.patch
26 Revert-build-remove-references-to-WITH_YAJL-for-SETUID_RP.patch
27 Revert-Remove-functions-using-yajl.patch
28 Revert-Switch-from-yajl-to-Jansson.patch
29 Revert-build-undef-WITH_JANSSON-for-SETUID_RPC_CLIENT.patch
30 Revert-build-add-with-jansson.patch