search for: xmltextwriterendelement

Displaying 20 results from an estimated 41 matches for "xmltextwriterendelement".

2014 Jan 17
0
[PATCH INCOMPLETE] launch: libvirt: Use C macros to simplify XML generation.
...BAD_CAST "host-passthrough")); XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "model")); XMLERROR (-1, xmlTextWriterWriteAttribute (xo, BAD_CAST "fallback", BAD_CAST "allow")); XMLERROR (-1, xmlTextWriterEndElement (xo)); XMLERROR (-1, xmlTextWriterEndElement (xo)); The new code looks like this: start_element ("cpu") { attribute ("mode", "host-passthrough"); start_element ("model") { attribute ("fallback", "allow"); } en...
2012 Jul 21
8
[PATCH libguestfs 0/4] Add a libvirt backend to libguestfs.
This preliminary patch series adds a libvirt backend to libguestfs. It's for review only because although it launches the guest OK, there are some missing features that need to be implemented. The meat of the patch is in part 4/4. To save you the trouble of interpreting libxml2 fragments, an example of the generated XML and the corresponding qemu command line are attached below. Note the
2012 Mar 31
2
[PATCH v6] hivexml: Add byte run reporting functions
...quot;, node); + XML_CHECK (xmlTextWriterWriteAttribute, (writer, BAD_CAST "file_offset", BAD_CAST buf)); + snprintf (buf, 1+BYTE_RUN_BUF_LEN, "%zu", node_struct_length); + XML_CHECK (xmlTextWriterWriteAttribute, (writer, BAD_CAST "len", BAD_CAST buf)); + XML_CHECK (xmlTextWriterEndElement, (writer)); + XML_CHECK (xmlTextWriterEndElement, (writer)); + return 0; +} + static int node_start (hive_h *h, void *writer_v, hive_node_h node, const char *name) { int64_t last_modified; char *timebuf; + int ret = 0; xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v; XML_C...
2018 Oct 04
0
[PATCH v2 3/4] inspector: Use libxml writer macros.
...ocument"); } static void @@ -340,10 +349,10 @@ output_roots (xmlTextWriterPtr xo, char **roots) { size_t i; - XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "operatingsystems")); - for (i = 0; roots[i] != NULL; ++i) - output_root (xo, roots[i]); - XMLERROR (-1, xmlTextWriterEndElement (xo)); + start_element ("operatingsystems") { + for (i = 0; roots[i] != NULL; ++i) + output_root (xo, roots[i]); + } end_element (); } static void @@ -351,152 +360,129 @@ output_root (xmlTextWriterPtr xo, char *root) { char *str; int i; - char buf[32]; char *canon...
2012 Feb 01
1
[PATCH] hivexml
...harlen; > + charlen = len - pos; > + } > + return 1; > +} > + > +static int > node_start (hive_h *h, void *writer_v, hive_node_h node, const char *name) > { > int64_t last_modified; > @@ -265,6 +282,20 @@ end_value (xmlTextWriterPtr writer) > XML_CHECK (xmlTextWriterEndElement, (writer)); > } > > +static void > +start_string(xmlTextWriterPtr writer, const char *encoding) > +{ > + XML_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "string")); > + if (encoding) > + XML_CHECK (xmlTextWriterWriteAttribute, (writer, BAD_CAST >...
2018 Nov 02
7
[PATCH v3 0/4] common/utils: Move libxml2 writer macros to a common header file.
v1 was here: https://www.redhat.com/archives/libguestfs/2018-October/msg00047.html v2 was here: https://www.redhat.com/archives/libguestfs/2018-October/msg00051.html v3: - Back to using string/string_format and attribute/attribute_format. - Add both single_element and single_element_format. - Rebased and retested. Rich.
2011 Dec 08
1
[hivex] [PATCH 8/8] hivexml: Add byte run reporting functions
...", node); + XML_CHECK (xmlTextWriterWriteAttribute, (writer, BAD_CAST "file_offset", BAD_CAST buf)); + snprintf (buf, 1+BYTE_RUN_BUF_LEN, "%d", node_struct_length); + XML_CHECK (xmlTextWriterWriteAttribute, (writer, BAD_CAST "len", BAD_CAST buf)); + XML_CHECK (xmlTextWriterEndElement, (writer)); + XML_CHECK (xmlTextWriterEndElement, (writer)); + return 0; +} + static int node_start (hive_h *h, void *writer_v, hive_node_h node, const char *name) { @@ -236,7 +264,8 @@ node_start (hive_h *h, void *writer_v, hive_node_h node, const char *name) } } - return 0; + ret...
2018 Oct 04
2
[PATCH 0/2] Use common macros to help with libxml2 writer.
Consolidate and extend the use of funky start_element() etc macros. Rich.
2018 Nov 02
0
[PATCH v3 2/4] common/utils: Move libxml2 writer macros to a common header file.
...;...</name> >>> + */ +#define start_element(element) \ + if (xmlTextWriterStartElement (xo, BAD_CAST (element)) == -1) { \ + xml_error ("xmlTextWriterStartElement"); \ + } \ + do + +#define end_element() \ + while (0); \ + do { \ + if (xmlTextWriterEndElement (xo) == -1) { \ + xml_error ("xmlTextWriterEndElement"); \ + } \ + } while (0) + +/** + * To define an empty element: + * + * empty_element ("name"); + * + * which produces C<<< <name/> >>> + */ +#define empty_element(element)...
2014 Jan 16
3
[PATCH 0/2] Don't use snapshot=on
QEMU upstream has broken snapshot=on ... again. These two patches stop using it entirely. Instead we run 'qemu-img create' to create overlay disks as required. Note that the libvirt and UML backends were already doing this: The libvirt backend because <transient/> has never worked, and the UML backend was running uml_mkcow because the UML-equivalent syntax of snapshot=on was
2018 Oct 04
6
[PATCH v2 0/4] common/utils: Move libxml2 writer macros to a common header file.
v1 was here: https://www.redhat.com/archives/libguestfs/2018-October/msg00047.html However it was broken in a few ways. First of all the documentation was broken because "/**" enhanced comments were not permitted on macros. This is fixed in the new 1/4 patch. Secondly we didn't use single_element() everywhere possible, which is fixed in the new 4/4 patch. Lastly I've
2016 Mar 07
0
[PATCH] inspector: add --no-applications and --no-icon
...ICON_FAVICON, 0, + -1); + if (!str) exit (EXIT_FAILURE); + if (size > 0) { + XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "icon")); + XMLERROR (-1, xmlTextWriterWriteBase64 (xo, str, 0, size)); + XMLERROR (-1, xmlTextWriterEndElement (xo)); + } + /* Note we must free (str) even if size == 0, because that indicates + * there was no icon. + */ + free (str); + } - /* Don't return favicon. RHEL 7 and Fedora have crappy 16x16 - * favicons in the base distro. - */ - str = guestfs_inspect_get...
2013 Feb 28
5
[PATCH v2 0/5] Fix SELinux security contexts so we can access shared disks (RHBZ#912499).
Link to version 1: https://www.redhat.com/archives/libguestfs/2013-February/thread.html#00122 Changes since version 1: - I've pushed two (of the three) code refactoring patches. The third one proved rather hard to move. - selinuxnorelabel option is no more. Instead there is a second internal API (internal_set_libvirt_selinux_norelabel_disks). - fixed bogus commit message -
2018 Oct 04
0
[PATCH v2 2/4] common/utils: Move libxml2 writer macros to a common header file.
...;...</name> >>> + */ +#define start_element(element) \ + if (xmlTextWriterStartElement (xo, BAD_CAST (element)) == -1) { \ + xml_error ("xmlTextWriterStartElement"); \ + } \ + do + +#define end_element() \ + while (0); \ + do { \ + if (xmlTextWriterEndElement (xo) == -1) { \ + xml_error ("xmlTextWriterEndElement"); \ + } \ + } while (0) + +/** + * To define an empty element: + * + * empty_element ("name"); + * + * which produces C<<< <name/> >>> + */ +#define empty_element(element)...
2012 Oct 08
3
[PATCH v3 0/3] Add support for disk labels and hotplugging.
This is, I guess, version 3 of this patch series which adds disk labels and hotplugging (only hot-add implemented so far). The good news is .. it works! Rich.
2013 Feb 28
7
[PATCH 0/7] Fix SELinux security contexts so we can access shared disks (RHBZ#912499).
https://bugzilla.redhat.com/show_bug.cgi?id=912499 (especially comments 7 & 10) This patch set is the final fix so that we can access disks in use by other guests when SELinux and sVirt are enabled. Previously such disks were inaccessible because sVirt labels the disks with a random SELinux label to prevent other instances of qemu from being able to read them. So naturally the libguestfs
2011 Aug 31
1
[PATCH] hivex: Add byte runs for nodes and values
...ot;%d", node); + XML_CHECK (xmlTextWriterWriteAttribute, (writer, BAD_CAST "offset", BAD_CAST buf)); + snprintf (buf, 1+BYTE_RUN_BUF_LEN, "%d", node_struct_length); + XML_CHECK (xmlTextWriterWriteAttribute, (writer, BAD_CAST "len", BAD_CAST buf)); + XML_CHECK (xmlTextWriterEndElement, (writer)); + XML_CHECK (xmlTextWriterEndElement, (writer)); + return 0; +} + static int node_start (hive_h *h, void *writer_v, hive_node_h node, const char *name) { int64_t last_modified; char *timebuf; + int ret = 0; xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v; XML_C...
2013 Mar 15
0
[PATCH] lib: Add direct support for the NBD (Network Block Device) protocol.
...urce")); + XMLERROR (-1, + xmlTextWriterWriteAttribute (xo, BAD_CAST "file", + BAD_CAST drv_priv->u.path)); + if (construct_libvirt_xml_disk_source_seclabel (g, xo) == -1) + return -1; + XMLERROR (-1, xmlTextWriterEndElement (xo)); + } + else { + XMLERROR (-1, + xmlTextWriterWriteAttribute (xo, BAD_CAST "type", + BAD_CAST "block")); + + XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "source")); + XMLERRO...
2012 Oct 08
5
[PATCH v4 0/5] Finish hotplugging support.
This rounds off hotplugging support by allowing you to add and remove drives at any stage (before and after launch). Rich.
2011 Sep 17
3
[PATCH 1/1] hivexml: Base64-encode non-printable data
...[i] != NULL; ++i) { XML_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "string")); - XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST argv[i])); + ret = safe_print_string_attribute (h, writer_v, "value", "value_encoding", argv[i]); XML_CHECK (xmlTextWriterEndElement, (writer)); } end_value (writer); - return 0; + return ret; } static int -- 1.7.4.4