search for: attribute_format

Displaying 20 results from an estimated 21 matches for "attribute_format".

2018 Oct 04
0
[PATCH v2 2/4] common/utils: Move libxml2 writer macros to a common header file.
...ent() and empty_element() macros are now available everywhere. - Error handling has been made generic. - Added do..while(0) around some of the macros to make them safe to use in all contexts. - Both string() and attribute() take a format string (previously there were string_format() and attribute_format() variants). The last point causes the most churn since we must change the callers to avoid format string security bugs. --- common/utils/Makefile.am | 1 + common/utils/libxml2-writer-macros.h | 143 +++++++++++++++++++++++ docs/C_SOURCE_FILES | 1 + lib/launch-l...
2018 Nov 02
0
[PATCH v3 2/4] common/utils: Move libxml2 writer macros to a common header file.
...+ */ +#define empty_element(element) \ + do { start_element ((element)) {} end_element (); } while (0) + +/** + * To define an XML element with attributes, use: + * + * start_element ("name") { + * attribute ("foo", "bar"); + * attribute_format ("count", "%d", count); + * ... + * } end_element (); + * + * which produces C<<< <name foo="bar" count="123">...</name> >>> + */ +#define attribute(key,value) \ + do {...
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 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.
2017 Mar 16
0
[PATCH 1/4] p2v: Pass host CPU details to virt-v2v.
..."allow"); + string (config->cpu.model); + } end_element (); + } + if (config->cpu.sockets || config->cpu.cores || config->cpu.threads) { + start_element ("topology") { + if (config->cpu.sockets) + attribute_format ("sockets", "%u", config->cpu.sockets); + if (config->cpu.cores) + attribute_format ("cores", "%u", config->cpu.cores); + if (config->cpu.threads) + attribute_format ("threads", "%u&qu...
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
2020 Feb 10
0
Re: [RFC] lib: allow to specify physical/logical block size for disks
...g, > + xmlTextWriterPtr xo, > + int pblocksize, int lblocksize) > +{ > + if (pblocksize || lblocksize) { > + start_element ("blockio") { > + if (pblocksize) > + attribute_format ("physical_block_size", "%d", pblocksize); > + if (lblocksize) > + attribute_format ("logical_block_size", "%d", lblocksize); > + } end_element (); > + } > + > + return 0; > +} > + > static int > construct_libv...
2020 Feb 07
8
[RFC] lib: allow to specify physical/logical block size for disks
...bvirt_xml_disk_blockio (guestfs_h *g, + xmlTextWriterPtr xo, + int pblocksize, int lblocksize) +{ + if (pblocksize || lblocksize) { + start_element ("blockio") { + if (pblocksize) + attribute_format ("physical_block_size", "%d", pblocksize); + if (lblocksize) + attribute_format ("logical_block_size", "%d", lblocksize); + } end_element (); + } + + return 0; +} + static int construct_libvirt_xml_disk_source_hosts (guestfs_h *g,...
2016 Oct 10
0
[PATCH] aarch64: Enable virtio-pci, replacing virtio-mmio.
..._h *g, + xmlTextWriterPtr xo, + int slot) +{ +#if defined(__aarch64__) + start_element ("address") { + attribute ("type", "pci"); + attribute ("bus", "0"); + attribute_format ("slot", "%d", slot); + } end_element (); +#endif + + return 0; +} + static int is_blk (const char *path) { -- 2.9.3
2020 Feb 11
2
[PATCH v2] lib: add support for disks with 4096 bytes sector size
...construct_libvirt_xml_disk_address (guestfs_h *g, xmlTextWriterPtr xo, return 0; } +static int +construct_libvirt_xml_disk_blockio (guestfs_h *g, xmlTextWriterPtr xo, + int blocksize) +{ + if (blocksize) { + start_element ("blockio") { + attribute_format ("physical_block_size", "%d", blocksize); + attribute_format ("logical_block_size", "%d", blocksize); + } end_element (); + } + + return 0; +} + static int construct_libvirt_xml_disk_source_hosts (guestfs_h *g,...
2017 Mar 21
0
[PATCH] p2v: Calculate offset of the Real Time Clock from UTC.
...UTC: + start_element ("clock") { + if (config->rtc.offset == 0) + attribute ("offset", "utc"); + else { + attribute ("offset", "variable"); + attribute ("basis", "utc"); + attribute_format ("adjustment", "%d", config->rtc.offset); + } + } end_element (); + break; + case BASIS_LOCALTIME: + start_element ("clock") { + attribute ("offset", "localtime"); + /* config->rtc.offset is always 0 in t...
2017 Mar 16
7
[PATCH 0/4] Pass CPU vendor, model and topology from source to target.
This is tangentially related to: https://bugzilla.redhat.com/show_bug.cgi?id=1372668 The problem in that bug is that we didn't pass the source CPU model (Sandybridge in that case) through to the target RHV hypervisor. So when the Windows guest booted on the target it gives an error about CPU hardware being disconnected (although it otherwise boots and works fine). This patch series
2020 Feb 10
1
[PATCH] lib: allow to specify physical/logical block size for disks
...construct_libvirt_xml_disk_address (guestfs_h *g, xmlTextWriterPtr xo, return 0; } +static int +construct_libvirt_xml_disk_blockio (guestfs_h *g, xmlTextWriterPtr xo, + int blocksize) +{ + if (blocksize) { + start_element ("blockio") { + attribute_format ("physical_block_size", "%d", blocksize); + attribute_format ("logical_block_size", "%d", blocksize); + } end_element (); + } + + return 0; +} + static int construct_libvirt_xml_disk_source_hosts (guestfs_h *g,...
2017 Mar 21
2
[PATCH] p2v: Calculate offset of the Real Time Clock from UTC.
Unlike the <cpu> node (see the other thread on the libguestfs ML), reading the Real Time Clock doesn't require libvirt and does work :-) For reference, read: https://libvirt.org/formatdomain.html#elementsTime https://en.wikipedia.org/wiki/Time_zone To test this you can run virt-p2v under qemu with a RTC offset: make -C p2v \ run-virt-p2v-in-a-vm \
2017 Mar 17
7
[PATCH v2 0/6] v2v: Pass CPU vendor, model and topology from source to target.
v1 -> v2: - Support for passing topology through -o glance. - Support for passing topology through -o rhv. - Use bool for acpi/apic/pae struct fields in virt-p2v. - Write the xpath expression in error messages instead of file/line. - Fix more memory leaks in virt-p2v cpuid.c. - Passes make check & check-valgrind. There may be some other minor changes. I believe that everything
2016 Jun 30
4
[PATCH 0/4] p2v: Send ^C to remote end to cancel the conversion.
(I don't have a BZ# for this yet, but I'm expecting it to be filed as an RFE) Currently if the user is in the virt-p2v GUI and cancels the conversion, all that happens is we abruptly close the ssh session to virt-v2v. That is bad .. possibly (or maybe not). But in any case there is an alternative: we can send a ^C key to the virt-v2v process, which it could catch and handle gracefully,
2019 Jul 09
7
[PATCH 0/5] Split virt-p2v in own repository
Hi, as it was already discussed on this list, here it is my attempt in splitting virt-p2v in an own repository. Sadly there are things that must be copied from libguestfs, as it cannot be avoided. The approach taken was to run a script (will send separately) to just get the "p2v" subdirectory with its history as own repository, and then add in few followup commits all the bits needed
2019 Sep 10
3
[PATCH 0/2] Remove virt-p2v from libguestfs
Now that virt-p2v has its own repository [1] and releases [2], it is time to remove it from libguestfs. [1] https://github.com/libguestfs/virt-p2v [2] http://download.libguestfs.org/virt-p2v/ Pino Toscano (2): Remove virt-p2v Remove remaining virt-p2v bits .gitignore | 4 - Makefile.am | 7 +- bash/Makefile.am
2015 Oct 05
0
[PATCH 2/2] Fix whitespace.
...ne empty_element(element) \ do { start_element(element) {} end_element (); } while (0) /* key=value attribute of the current element. */ @@ -646,16 +646,16 @@ cleanup_data_conns (struct data_conn *data_conns, size_t nr) /* key=value, but value is a printf-style format string. */ #define attribute_format(key,fs,...) \ if (xmlTextWriterWriteFormatAttribute (xo, BAD_CAST (key), \ - fs, ##__VA_ARGS__) == -1) { \ + fs, ##__VA_ARGS__) == -1) { \ set_conversion_error ("xmlTextWriterWriteFormatAttrib...