search for: xmltextwriterptr

Displaying 20 results from an estimated 69 matches for "xmltextwriterptr".

2012 Mar 31
2
[PATCH v6] hivexml: Add byte run reporting functions
...git a/xml/hivexml.c b/xml/hivexml.c index 54d9049..a4bc7eb 100644 --- a/xml/hivexml.c +++ b/xml/hivexml.c @@ -210,11 +210,40 @@ filetime_to_8601 (int64_t windows_ticks) return ret; } +#define BYTE_RUN_BUF_LEN 32 + +static int +node_byte_runs (hive_h *h, void *writer_v, hive_node_h node) +{ + xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v; + char buf[1+BYTE_RUN_BUF_LEN]; + errno = 0; + size_t node_struct_length = hivex_node_struct_length (h, node); + if (errno) { + if (errno == EINVAL) { + fprintf (stderr, "node_byte_runs: Invoked on what does not seem to be a node (%zu).\n"...
2011 Dec 08
1
[hivex] [PATCH 8/8] hivexml: Add byte run reporting functions
...-git a/xml/hivexml.c b/xml/hivexml.c index d38e9d4..6591c98 100644 --- a/xml/hivexml.c +++ b/xml/hivexml.c @@ -210,6 +210,34 @@ filetime_to_8601 (int64_t windows_ticks) return ret; } +#define BYTE_RUN_BUF_LEN 32 + +static int +node_byte_runs (hive_h *h, void *writer_v, hive_node_h node) +{ + xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v; + char buf[1+BYTE_RUN_BUF_LEN]; + errno = 0; + size_t node_struct_length = hivex_node_struct_length (h, node); + if (errno) { + if (errno == EINVAL) { + fprintf (stderr, "node_byte_runs: Invoked on what does not seem to be a node (%zu).\n"...
2011 Sep 17
3
[PATCH 1/1] hivexml: Base64-encode non-printable data
...e" : "base64"; +} + +static int +safe_print_string_attribute (hive_h *h, void *writer_v, const char *attr_name, const char *attr_encoding, const char *attr_data) +{ + int ret = 0; + char *encoding_to_use = NULL; + if (attr_name && attr_data && attr_encoding) { + xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v; + encoding_to_use = encoding_recommendation (attr_data); + + if (strcmp (encoding_to_use, "none") == 0) + XML_CHECK (xmlTextWriterWriteAttribute, (writer, BAD_CAST attr_name, BAD_CAST attr_data)); + else if (strcmp (encoding_to_use, &quo...
2011 Dec 13
1
[hivex] [PATCH 1/1] hivexml: Change value type output to standard names
...G_RESOURCE_LIST"; break; + case 9: return "REG_FULL_RESOURCE_DESCRIPTOR"; break; + case 10: return "REG_RESOURCE_REQUIREMENTS_LIST"; break; + case 11: return "REG_QWORD"; break; + default: return "unknown"; break; + } +} + static void start_value (xmlTextWriterPtr writer, const char *key, const char *type, const char *encoding) @@ -294,7 +320,7 @@ value_string (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value, type = "unknown"; } - start_value (writer, key, type, NULL); + start_value (writer, key, value_type...
2011 Sep 02
1
[PATCH 6/7] hivexml: Report attributes in values instead of text.
...ons(+), 5 deletions(-) diff --git a/xml/hivexml.c b/xml/hivexml.c index f29c80c..4789dbc 100644 --- a/xml/hivexml.c +++ b/xml/hivexml.c @@ -199,6 +199,7 @@ 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_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "node")); @@ -278,7 +279,9 @@ value_string (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value, } start_value (writer, key, type, NULL); - XML_CHECK (xmlTextWriterWriteSt...
2017 Oct 05
2
[PATCH] inspector: Fix virt-inspector on *BSD guests (RHBZ#1144138).
--- inspector/inspector.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/inspector/inspector.c b/inspector/inspector.c index 3583c61df..30d279987 100644 --- a/inspector/inspector.c +++ b/inspector/inspector.c @@ -347,6 +347,7 @@ output_root (xmlTextWriterPtr xo, char *root) char buf[32]; char *canonical_root; size_t size; + int is_bsd; XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "operatingsystem")); @@ -362,6 +363,10 @@ output_root (xmlTextWriterPtr xo, char *root) if (STRNEQ (str, "unknown")) XMLE...
2011 Aug 31
1
[PATCH] hivex: Add byte runs for nodes and values
...git a/xml/hivexml.c b/xml/hivexml.c index f29c80c..db9cd7d 100644 --- a/xml/hivexml.c +++ b/xml/hivexml.c @@ -194,11 +194,39 @@ filetime_to_8601 (int64_t windows_ticks) return ret; } +#define BYTE_RUN_BUF_LEN 32 + +static int +node_byte_runs (hive_h *h, void *writer_v, hive_node_h node) +{ + xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v; + char buf[1+BYTE_RUN_BUF_LEN]; + size_t node_struct_length = hivex_node_struct_length (h, node); + if (errno) { + if (errno == EINVAL) { + fprintf (stderr, "node_byte_runs: Invoked on what does not seem to be a node (%zu).\n", node); +...
2020 Feb 10
0
Re: [RFC] lib: allow to specify physical/logical block size for disks
...b/lib/launch-libvirt.c > index f2cad9300..4ce2fa683 100644 > --- a/lib/launch-libvirt.c > +++ b/lib/launch-libvirt.c > @@ -1043,6 +1043,7 @@ static int construct_libvirt_xml_disk (guestfs_h *g, const struct backend_libvir > static int construct_libvirt_xml_disk_target (guestfs_h *g, xmlTextWriterPtr xo, size_t drv_index); > static int construct_libvirt_xml_disk_driver_qemu (guestfs_h *g, const struct backend_libvirt_data *data, struct drive *drv, xmlTextWriterPtr xo, const char *format, const char *cachemode, enum discard discard, bool copyonread); > static int construct_libvirt_xml_di...
2014 Mar 10
5
[PATCH 0/3] Add discard support.
These patches contain the beginnings of discard (a.k.a. trim or unmap) support. This will allow us to change virt-sparsify to work on disk images in-place (instead of using slow & inefficient copying). The approach used is to add an optional 'discard' parameter to add-drive. It has 3 possible settings: - 'disable' : the default, no discard is done - 'besteffort' :
2020 Feb 07
8
[RFC] lib: allow to specify physical/logical block size for disks
...t a/lib/launch-libvirt.c b/lib/launch-libvirt.c index f2cad9300..4ce2fa683 100644 --- a/lib/launch-libvirt.c +++ b/lib/launch-libvirt.c @@ -1043,6 +1043,7 @@ static int construct_libvirt_xml_disk (guestfs_h *g, const struct backend_libvir static int construct_libvirt_xml_disk_target (guestfs_h *g, xmlTextWriterPtr xo, size_t drv_index); static int construct_libvirt_xml_disk_driver_qemu (guestfs_h *g, const struct backend_libvirt_data *data, struct drive *drv, xmlTextWriterPtr xo, const char *format, const char *cachemode, enum discard discard, bool copyonread); static int construct_libvirt_xml_disk_address...
2016 Oct 10
2
[PATCH] aarch64: Enable virtio-pci, replacing virtio-mmio.
This patch causes aarch64 to use virtio-pci instead of virtio-mmio. Virtio-pci is considerably faster than virtio-mmio, it's more like how other architectures work, and it supports hotplugging (although it's not likely we'd use the latter feature). I'm not necessarily suggesting that we apply this. Laine (CC'd) has some further patches to libvirt lined up which AIUI would
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.
2012 Feb 01
1
[PATCH] hivexml
...0) > + return 0; > + pos += charlen; > + 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 (x...
2016 Oct 10
0
[PATCH] aarch64: Enable virtio-pci, replacing virtio-mmio.
....c index d8479dc..1ac5604 100644 --- a/src/launch-libvirt.c +++ b/src/launch-libvirt.c @@ -950,6 +950,13 @@ static int construct_libvirt_xml_disk_source_hosts (guestfs_h *g, xmlTextWriterP static int construct_libvirt_xml_disk_source_seclabel (guestfs_h *g, const struct backend_libvirt_data *data, xmlTextWriterPtr xo); static int construct_libvirt_xml_appliance (guestfs_h *g, const struct libvirt_xml_params *params, xmlTextWriterPtr xo); +static int construct_libvirt_xml_virtio_pci_address (guestfs_h *g, xmlTextWriterPtr xo, int slot); +/* Don't use slot 1, since can be used by video. */ +#define VIRT...
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.
2017 Oct 05
2
Re: [PATCH] inspector: Fix virt-inspector on *BSD guests (RHBZ#1144138).
...t; > 1 file changed, 11 insertions(+), 1 deletion(-) > > > > diff --git a/inspector/inspector.c b/inspector/inspector.c > > index 3583c61df..30d279987 100644 > > --- a/inspector/inspector.c > > +++ b/inspector/inspector.c > > @@ -347,6 +347,7 @@ output_root (xmlTextWriterPtr xo, char *root) > > char buf[32]; > > char *canonical_root; > > size_t size; > > + int is_bsd; > > > > XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "operatingsystem")); > > > > @@ -362,6 +363,10 @@ output_root (xmlT...
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 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
2018 Oct 04
0
[PATCH v2 3/4] inspector: Use libxml writer macros.
...nspector.c @@ -43,6 +43,7 @@ #include "structs-cleanups.h" #include "options.h" #include "display-options.h" +#include "libxml2-writer-macros.h" /* Currently open libguestfs handle. */ guestfs_h *g; @@ -69,6 +70,14 @@ static void output_drive_mappings (xmlTextWriterPtr xo, char *root); static void output_applications (xmlTextWriterPtr xo, char *root); static void do_xpath (const char *query); +/* This macro is used by the macros in "libxml2-writer-macros.h" + * when an error occurs. + */ +#define xml_error(fn)...
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.