search for: strneq

Displaying 20 results from an estimated 142 matches for "strneq".

Did you mean: streq
2018 Oct 04
0
[PATCH v2 3/4] inspector: Use libxml writer macros.
...vice_name (g, root); - if (canonical_root == NULL) - exit (EXIT_FAILURE); - XMLERROR (-1, - xmlTextWriterWriteElement (xo, BAD_CAST "root", BAD_CAST canonical_root)); - free (canonical_root); - - str = guestfs_inspect_get_type (g, root); - if (!str) exit (EXIT_FAILURE); - if (STRNEQ (str, "unknown")) - XMLERROR (-1, - xmlTextWriterWriteElement (xo, BAD_CAST "name", BAD_CAST str)); - free (str); - - str = guestfs_inspect_get_arch (g, root); - if (!str) exit (EXIT_FAILURE); - if (STRNEQ (str, "unknown")) - XMLERROR (-1, - xmlTe...
2017 Jun 25
0
Re: [PATCH 1/2] launch: add support for autodetection of appliance image format
...16 insertions(+), 8 deletions(-) > > diff --git a/lib/create.c b/lib/create.c > index bd4c32ef7..aedfe8670 100644 > --- a/lib/create.c > +++ b/lib/create.c > @@ -272,7 +272,8 @@ disk_create_qcow2 (guestfs_h *g, const char *orig_filename, int64_t size, > */ > if (STRNEQ (backingformat, "raw") && > STRNEQ (backingformat, "qcow2") && > - STRNEQ (backingformat, "vmdk")) { > + STRNEQ (backingformat, "vmdk") && > + STRNEQ (backingformat, AUTODETECTION_FORMAT)) { &g...
2012 Apr 02
2
[PATCH 0/2] Fix btrfs blocksize and bind mkfs.btrfs (RHBZ#807905).
https://bugzilla.redhat.com/show_bug.cgi?id=807905 Currently if you specify the blocksize parameter to mkfs-opts with a btrfs filesystem, then it fails, because mkfs.btrfs interprets the -b option as meaning filesystem size. The first patch fixes this by disallowing blocksize (it cannot be mapped meaningfully into btrfs parameters). The second patch adds the full /sbin/mkfs.btrfs utility to the
2014 Nov 23
0
[PATCH 1/3] lib: guestfs_disk_create: Allow vmdk as a valid backingformat.
...index 621ace5..bfb8b76 100644 --- a/src/create.c +++ b/src/create.c @@ -261,7 +261,12 @@ disk_create_qcow2 (guestfs_h *g, const char *orig_filename, int64_t size, if (optargs->bitmask & GUESTFS_DISK_CREATE_BACKINGFORMAT_BITMASK) { backingformat = optargs->backingformat; - if (STRNEQ (backingformat, "raw") && STRNEQ (backingformat, "qcow2")) { + /* Conservative whitelist. This can be extended with other + * valid formats as required. + */ + if (STRNEQ (backingformat, "raw") && + STRNEQ (backingformat, "qco...
2011 Nov 11
3
[PATCH v2] Add mdadm-create, list-md-devices APIs.
This adds the mdadm-create API for creating RAID devices, and includes various fixes for the other two patches. Rich.
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
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 Nov 24
1
[PATCH] Rename mdadm_ apis to md_
...1; @@ -84,7 +84,7 @@ do_mdadm_create (const char *name, char *const *devices, else nrdevices = count_strings (devices) + count_bits (umissingbitmap); - if (optargs_bitmask & GUESTFS_MDADM_CREATE_LEVEL_BITMASK) { + if (optargs_bitmask & GUESTFS_MD_CREATE_LEVEL_BITMASK) { if (STRNEQ (level, "linear") && STRNEQ (level, "raid0") && STRNEQ (level, "0") && STRNEQ (level, "stripe") && STRNEQ (level, "raid1") && STRNEQ (level, "1") && @@ -100,7 +100,7 @@ do_m...
2016 May 18
1
[PATCH] drives: force format=raw for /dev/null dummy drives
...++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/drives.c b/src/drives.c index c55b87e..1a4ae27 100644 --- a/src/drives.c +++ b/src/drives.c @@ -410,9 +410,15 @@ create_drive_dev_null (guestfs_h *g, { CLEANUP_FREE char *tmpfile = NULL; - if (data->format && STRNEQ (data->format, "raw")) { - error (g, _("for device '/dev/null', format must be 'raw'")); - return NULL; + if (data->format) { + if (data->format && STRNEQ (data->format, "raw")) { + error (g, _("for device '/d...
2016 May 18
1
[PATCH v2] drives: force format=raw for /dev/null dummy drives
...++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/drives.c b/src/drives.c index c55b87e..5e7eb12 100644 --- a/src/drives.c +++ b/src/drives.c @@ -410,9 +410,15 @@ create_drive_dev_null (guestfs_h *g, { CLEANUP_FREE char *tmpfile = NULL; - if (data->format && STRNEQ (data->format, "raw")) { - error (g, _("for device '/dev/null', format must be 'raw'")); - return NULL; + if (data->format) { + if (STRNEQ (data->format, "raw")) { + error (g, _("for device '/dev/null', format must b...
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
2009 Nov 09
1
use STREQ(a,b), not strcmp(a,b) == 0
The series below makes changes like these mechanically, one class of change per change-set: strcmp(...) == 0 to STREQ(...) strcmp(...) != 0 to STRNEQ(...) strncmp(...) == 0 to STREQLEN(...) strncmp(...) != 0 to STRNEQLEN(...) strcasecmp(...) == 0 to STRCASEEQ(...) strcasecmp(...) != 0 to STRCASENEQ(...) strncasecmp(...) == 0 to STRCASEEQLEN(...) strncasecmp(...) != 0 to STRCASENEQLEN(...) Then it enables the "...
2014 Nov 23
7
[PATCH 0/3] patches needed for virt-bmap
See http://rwmj.wordpress.com/2014/11/23/mapping-files-to-disk/
2019 Nov 26
6
[PATCH options v2 0/3] options: Allow multiple and default --key parameters.
v1: https://www.redhat.com/archives/libguestfs/2019-November/msg00036.html
2017 Jun 08
1
[PATCH] lib: create: Allow any [[:alnum:]]+ string as a backingfmt parameter.
...uestfs_h *g, const char *orig_filename, int64_t size, if (optargs->bitmask & GUESTFS_DISK_CREATE_BACKINGFORMAT_BITMASK) { backingformat = optargs->backingformat; - /* Conservative whitelist. This can be extended with other - * valid formats as required. - */ - if (STRNEQ (backingformat, "raw") && - STRNEQ (backingformat, "qcow2") && - STRNEQ (backingformat, "vmdk")) { + if (!VALID_FORMAT (backingformat)) { error (g, _("invalid value for backingformat parameter ā€˜%sā€™"), back...
2019 May 24
0
[PATCH 2/2] launch: libvirt: fix custom hypervisor check
...a); xml = construct_libvirt_xml (g, &params); if (!xml) @@ -873,13 +873,15 @@ parse_domcapabilities (guestfs_h *g, const char *domcapabilities_xml, } static int -is_custom_hv (guestfs_h *g) +is_custom_hv (guestfs_h *g, struct backend_libvirt_data *data) { + if (g->hv && STRNEQ (g->hv, data->default_qemu)) + return 1; #ifdef QEMU - return g->hv && STRNEQ (g->hv, QEMU); -#else - return 1; + if (STRNEQ (data->default_qemu, QEMU)) + return 1; #endif + return 0; } #if HAVE_LIBSELINUX @@ -1265,7 +1267,7 @@ construct_libvirt_xml_devices (g...
2019 Nov 26
0
[PATCH common v2 3/3] options: Allow default --key parameters.
...--git a/options/keys.c b/options/keys.c index 782bdb6..817508b 100644 --- a/options/keys.c +++ b/options/keys.c @@ -148,7 +148,8 @@ get_keys (struct key_store *ks, const char *device) for (i = 0; i < ks->nr_keys; ++i) { struct key_store_key *key = &ks->keys[i]; - if (STRNEQ (key->device, device)) + if (STRNEQ (key->device, "") && + STRNEQ (key->device, device)) continue; switch (key->type) { diff --git a/options/options.h b/options/options.h index 510e8a8..2f6bc5c 100644 --- a/options/options.h +++ b/option...
2019 Nov 29
8
[PATCH 0/1] Allow UUIDs for --key identifiers.
This combined patch series enables to decrypt LUKS devices on inspection by allowing the UUID of the LUKS device with the --key syntax. I opted for reusing the option instead of adding another one, as I think that device names and UUIDs are different enough that can be properly distinguished. A test for this (patch #4) can be applied only when the patches for common are applied, and the
2019 Nov 29
0
[common PATCH 2/2] options: allow a UUID as identifier for --key
...ce) +get_keys (struct key_store *ks, const char *device, const char *uuid) { size_t i, j, len; char **r; @@ -148,7 +148,7 @@ get_keys (struct key_store *ks, const char *device) for (i = 0; i < ks->nr_keys; ++i) { struct key_store_key *key = &ks->keys[i]; - if (STRNEQ (key->id, device)) + if (STRNEQ (key->id, device) && (uuid && STRNEQ (key->id, uuid))) continue; switch (key->type) { diff --git a/options/options.h b/options/options.h index b83a92b..9b78302 100644 --- a/options/options.h +++ b/options/options.h @...
2017 Oct 05
2
[PATCH] inspector: Fix virt-inspector on *BSD guests (RHBZ#1144138).
...47,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")) XMLERROR (-1, xmlTextWriterWriteElement (xo, BAD_CAST "name", BAD_CAST str)); + is_bsd = + STREQ (str, "freebsd") || + STREQ (str, "netbsd") || + STREQ (str, "openbsd"); free (str); str = guestfs_insp...