search for: parse_error

Displaying 20 results from an estimated 35 matches for "parse_error".

2018 Feb 12
0
[PATCH v2 1/1] Switch from YAJL to Jansson
...t;= 6 */ -#pragma GCC diagnostic ignored "-Wnull-dereference" -#endif - int optgroup_ldm_available (void) { @@ -72,44 +65,42 @@ do_ldmtool_remove_all (void) return 0; } -static yajl_val +static json_t * parse_json (const char *json, const char *func) { - yajl_val tree; - char parse_error[1024]; + json_t *tree; + json_error_t err; if (verbose) fprintf (stderr, "%s: parsing json: %s\n", func, json); - tree = yajl_tree_parse (json, parse_error, sizeof parse_error); + tree = json_loads (json, 0, &err); if (tree == NULL) { reply_with_error ("pa...
2017 Nov 23
0
[PATCH 1/1] Switch from YAJL to Jansson
...t;= 6 */ -#pragma GCC diagnostic ignored "-Wnull-dereference" -#endif - int optgroup_ldm_available (void) { @@ -72,44 +65,42 @@ do_ldmtool_remove_all (void) return 0; } -static yajl_val +static json_t * parse_json (const char *json, const char *func) { - yajl_val tree; - char parse_error[1024]; + json_t *tree; + json_error_t err; if (verbose) fprintf (stderr, "%s: parsing json: %s\n", func, json); - tree = yajl_tree_parse (json, parse_error, sizeof parse_error); + tree = json_loads (json, 0, &err); if (tree == NULL) { reply_with_error ("pa...
2018 Feb 12
2
[PATCH v2 0/1] RFC: switch from YAJL to Jansson
Hi, recently, there was a discussion in the development list of libvirt on switching to a different JSON library than YAJL [1]. Since we use YAJL, and the points there IMHO apply to libguestfs as well, I decided to give a try in switching to Jansson [2]. The result IMHO is nice, with the additional APIs of Jansson that simplify some of our code. Unlike with YAJL, I did not set a minimum
2017 Nov 23
4
[PATCH 0/1] RFC: switch from YAJL to Jansson
Hi, recently, there was a discussion in the development list of libvirt on switching to a different JSON library than YAJL [1]. Since we use YAJL, and the points there IMHO apply to libguestfs as well, I decided to give a try in switching to Jansson [2]. The result IMHO is nice, with the additional APIs of Jansson that simplify some of our code. Unlike with YAJL, I did not set a minimum
2017 Sep 12
0
[PATCH v2 3/5] lib: qemu: Run QMP ‘query-commands’, ‘query-qmp-schema’ against the qemu binary.
...const char *filename) { @@ -338,6 +406,27 @@ parse_qemu_version (guestfs_h *g, const char *qemu_help, } /** + * Parse the json output from QMP. But don't fail if parsing + * is not possible. + */ +static void +parse_json (guestfs_h *g, const char *json, yajl_val *treep) +{ + char parse_error[256] = ""; + + if (!json) + return; + + *treep = yajl_tree_parse (json, parse_error, sizeof parse_error); + if (*treep == NULL) { + if (strlen (parse_error) > 0) + debug (g, "QMP parse error: %s (ignored)", parse_error); + else + debug (g, "QMP unkn...
2019 Mar 26
0
[PATCH nbdkit v4 07/15] error: Extend the error filter so it can inject errors into block status extents requests.
...error_unload (void) free (pwrite_settings.file); free (trim_settings.file); free (zero_settings.file); + free (extents_settings.file); } static const struct { const char *name; int error; } errors[] = { @@ -162,7 +164,8 @@ error_config (nbdkit_next_config *next, void *nxdata, if (parse_error (key, value, &i) == -1) return -1; pread_settings.error = pwrite_settings.error = - trim_settings.error = zero_settings.error = i; + trim_settings.error = zero_settings.error = + extents_settings.error = i; return 0; } else if (strcmp (key, "error-prea...
2019 Mar 28
0
[PATCH nbdkit v5 FINAL 08/19] error: Extend the error filter so it can inject errors into block status extents requests.
...error_unload (void) free (pwrite_settings.file); free (trim_settings.file); free (zero_settings.file); + free (extents_settings.file); } static const struct { const char *name; int error; } errors[] = { @@ -162,7 +164,8 @@ error_config (nbdkit_next_config *next, void *nxdata, if (parse_error (key, value, &i) == -1) return -1; pread_settings.error = pwrite_settings.error = - trim_settings.error = zero_settings.error = i; + trim_settings.error = zero_settings.error = + extents_settings.error = i; return 0; } else if (strcmp (key, "error-prea...
2012 Dec 07
2
[PATCH] Add support for Windows dynamic disks (libldm / ldmtool).
This is just an initial version of the patch, not to be applied. It implements just the diskgroup functions, ie. corresponding to these ldmtool commands: * ldmtool scan * ldmtool show diskgroup <guid> I have chosen yajl as the JSON parsing library (don't worry, this is optional). You will also, of course, need ldmtool which is not packaged in anything except Fedora. Rich.
2003 Aug 24
1
declarations in non-exported headers and embedding R
...------------------------------------------------------ From non-exported header file ${R_HOME}/src/include/Parse.h ----------------------------------------------------------- extern SEXP R_ParseVector(SEXP, int, int *); #define PARSE_NULL 0 #define PARSE_OK 1 #define PARSE_INCOMPLETE 2 #define PARSE_ERROR 3 #define PARSE_EOF 4 ----------------------------------------------------------- From non-exported header file ${R_HOME}/src/include/Defn.h ----------------------------------------------------------- extern void R_PreserveObject(SEXP); extern void R_ReleaseObject(SEXP); Use: ------------- Th...
2006 Sep 24
1
[patch] buffer overflow in q_parser.y
...y(qp->dynbuf, buf, MAX_WORD_SIZE); + buf = qp->dynbuf; + bufp = buf + MAX_WORD_SIZE; + } } qp->qstrp--; /* check for keywords. There are only four so we have a bit of a hack which @@ -262,7 +276,7 @@ } mutex_unlock(&qp->mutex); RAISE(PARSE_ERROR, "couldn''t parse query ``%s''''. Error message " - " was %se", buf, (char *)msg); + "was: %s", buf, (char *)msg); } return 0; } @@ -707,6 +721,9 @@ if (self->tokenized_fields) { hs_destroy(s...
2005 Jun 07
8
[PATCH] add dom0 vcpu hotplug control
...static DECLARE_WORK(vcpu_hotplug_work, __vcpu_hotplug_handler, NULL); + vcpu_hotplug_t *req = (vcpu_hotplug_t *)&msg->msg[0]; + struct vcpu_hotplug_handler_t *handler = &vcpu_hotplug_handler; + ssize_t ret; + + if ( msg->length != sizeof(vcpu_hotplug_t) ) + goto parse_error; + + /* grab target vcpu from msg */ + handler->vcpu = req->vcpu; + + /* determine which function to call based on msg subtype */ + switch ( msg->subtype ) { + case CMSG_VCPU_HOTPLUG_OFF: + handler->fn = (void *)&cpu_down; + ret = schedule_wo...
2019 Aug 02
3
auth-policy crashing
...est == NULL) fprintf(stderr, "2222222222222222222222222222 context->request == NULL\n"); i_stream_unref(&context->payload); if (context->request == NULL) fprintf(stderr, "1111111111111111111111111111 context->request == NULL\n"); if (context->parse_error) { context->result = (context->set->policy_reject_on_fail ? -1 : 0); } if (context->request == NULL) fprintf(stderr, "AAAAAAAAAAAAAAAAAAAAAAAAAAAA context->request == NULL\n"); context->request->policy_refusal = FALSE; if (context->r...
2017 Sep 11
4
[PATCH 0/4] lib: qemu: Add test for mandatory locking.
The patch I posted last week to disable mandatory locking for readonly drives (https://www.redhat.com/archives/libguestfs/2017-September/msg00013.html) was wrong in a couple of respects. Firstly it didn't work, which I didn't detect because my tests were testing the wrong thing. Oops. Secondly it used a simple version number check to detect qemu binaries implementing mandatory locking.
2010 Jan 07
1
Segfault in GetNewPage, memory.c.
...R_NilValue)); > UNPROTECT(2); > switch (status) { > case PARSE_OK: > break; > case PARSE_INCOMPLETE: > case PARSE_EOF: > caml_raise_with_string(*caml_named_value("Parse_incomplete"), (String_val(s))); > case PARSE_NULL: > case PARSE_ERROR: > caml_raise_with_string(*caml_named_value("Parse_error"), (String_val(s))); > } > CAMLreturn(Val_sexp(VECTOR_ELT(pr,0))); > } But before calling ParseVector, it allocates an R string with the command. > PROTECT(text = mkString(String_val(s))); It is thi...
2017 Sep 12
8
[PATCH v3 0/6] launch: direct: Disable qemu locking when opening drives readonly.
v2 -> v3: - I addressed everything that Pino mentioned last time. - It's tricky to get a stable run when multiple copies of qemu are involved, because the same cache files get overwritten by parallel libguestfs. So I changed the names of the cache files to include the qemu binary key (size, mtime), which removes this conflict. This is in new patch 4/6. Rich.
2017 Sep 12
9
[PATCH v2 0/5] launch: direct: Disable qemu locking when opening drives readonly (RHBZ#1417306)
Patches 1-4 are almost the same as they are when previously posted here: https://www.redhat.com/archives/libguestfs/2017-September/msg00039.html Patch 5 actually uses the mandatory locking test to turn off locking in the narrow case where a drive is opened readonly, and then only for the drive being inspected. Passes ordinary tests (‘check-direct’ and ‘check-valgrind-direct’). Rich.
2019 Aug 06
0
auth-policy crashing
...err, > "2222222222222222222222222222 context->request == NULL\n"); > ??? i_stream_unref(&context->payload); > > ??? if (context->request == NULL) fprintf(stderr, > "1111111111111111111111111111 context->request == NULL\n"); > ??? if (context->parse_error) { > ??????? context->result = (context->set->policy_reject_on_fail ? -1 : 0); > ??? } > > ??? if (context->request == NULL) fprintf(stderr, > "AAAAAAAAAAAAAAAAAAAAAAAAAAAA context->request == NULL\n"); > ??? context->request->policy_refusal = FALSE;...
2005 Dec 09
1
utf-8 BIG problems
...s then fucked up. i get wierd symbols ------------------- Another situation: I have seen a post here to add to environment.rb: $KCODE = ''UTF8'' require ''jcode'' and to application.rb: before_filter :configure_charsets after_filter :fix_unicode_for_safari def parse_errors(obj) return nil if obj.nil? str = "<ul>" obj.errors.each_full do |msg| str += "<li>" + msg +"</li>" end str += "</ul>" return str end def configure_charsets @headers["Content-Type"] = &...
2007 Jan 18
0
Emulating a REPL in frontends
...intValueEnv(R_CurrentExpr, rho); if (R_CollectWarnings) PrintWarnings(); if(do_toplevel_callbacks) { Rf_callToplevelHandlers(R_CurrentExpr, value, TRUE, wasDisplayed); } R_CurrentExpr = value; UNPROTECT(1); R_IoBufferWriteReset(&R_ConsoleIob); R_Busy(0); return value; case PARSE_ERROR: parseError(R_NilValue, 0); R_IoBufferWriteReset(&R_ConsoleIob); break; case PARSE_INCOMPLETE: R_IoBufferReadReset(&R_ConsoleIob); break; case PARSE_EOF: break; } return R_NilValue; } -------------- next part -------------- A non-text attachment was scrubbed... Name: n...
2019 Mar 28
32
[PATCH nbdkit v5 FINAL 00/19] Implement extents.
This has already been pushed upstream. I am simply posting these here so we have a reference in the mailing list in case we find bugs later (as I'm sure we will - it's a complex patch series). Great thanks to Eric Blake for tireless review on this one. It also seems to have identified a few minor bugs in qemu along the way. Rich.