Displaying 20 results from an estimated 631 matches for "streq".
2011 Dec 14
1
[PATCH] mkfs: optimization and code cleanup
Optimizations by reducing the STREQ operations and do some
code cleanup.
Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com>
---
daemon/mkfs.c | 29 +++++++++++++----------------
1 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/daemon/mkfs.c b/daemon/mkfs.c
index a2c2366..7757623 100644
--- a/daemon/mk...
2017 Mar 07
0
[PATCH v4 2/9] lib: extract osinfo DB traversing API
...nternal.h"
+
+#include "osinfo.h"
+
+gl_lock_define_initialized (static, osinfo_db_lock);
+static ssize_t osinfo_db_size = 0; /* 0 = unread, -1 = error, >= 1 = #records */
+static struct osinfo *osinfo_db = NULL;
+
+static void free_osinfo_db_entry (struct osinfo *);
+
+#define XMLSTREQ(a,b) (xmlStrEqual((a),(b)) == 1)
+
+static int read_osinfo_db_xml (guestfs_h *g, const char *pathname, void *data);
+
+/* Given one or more fields from the header of a CD/DVD/ISO, look up
+ * the media in the libosinfo database and return our best guess for
+ * the operating system.
+ *
+ * This re...
2017 Feb 10
0
[PATCH v3 05/10] lib: extract osinfo DB traversing API
...ernal.h"
+
+#include "osinfo.h"
+
+gl_lock_define_initialized (static, osinfo_db_lock);
+static ssize_t osinfo_db_size = 0; /* 0 = unread, -1 = error, >= 1 = #records */
+static struct osinfo *osinfo_db = NULL;
+
+
+static void free_osinfo_db_entry (struct osinfo *);
+
+#define XMLSTREQ(a,b) (xmlStrEqual((a),(b)) == 1)
+
+static int
+read_osinfo_db_xml (guestfs_h *g, const char *pathname, void *data);
+
+/* Given one or more fields from the header of a CD/DVD/ISO, look up
+ * the media in the libosinfo database and return our best guess for
+ * the operating system.
+ *
+ * This r...
2017 Jun 19
0
[PATCH v7 2/9] lib: extract osinfo DB traversing API
...nternal.h"
+
+#include "osinfo.h"
+
+gl_lock_define_initialized (static, osinfo_db_lock);
+static ssize_t osinfo_db_size = 0; /* 0 = unread, -1 = error, >= 1 = #records */
+static struct osinfo *osinfo_db = NULL;
+
+static void free_osinfo_db_entry (struct osinfo *);
+
+#define XMLSTREQ(a,b) (xmlStrEqual((a),(b)) == 1)
+
+static int read_osinfo_db_xml (guestfs_h *g, const char *pathname, void *data);
+
+/* Given one or more fields from the header of a CD/DVD/ISO, look up
+ * the media in the libosinfo database and return our best guess for
+ * the operating system.
+ *
+ * This re...
2017 Apr 12
0
[PATCH v6 02/10] lib: extract osinfo DB traversing API
...nternal.h"
+
+#include "osinfo.h"
+
+gl_lock_define_initialized (static, osinfo_db_lock);
+static ssize_t osinfo_db_size = 0; /* 0 = unread, -1 = error, >= 1 = #records */
+static struct osinfo *osinfo_db = NULL;
+
+static void free_osinfo_db_entry (struct osinfo *);
+
+#define XMLSTREQ(a,b) (xmlStrEqual((a),(b)) == 1)
+
+static int read_osinfo_db_xml (guestfs_h *g, const char *pathname, void *data);
+
+/* Given one or more fields from the header of a CD/DVD/ISO, look up
+ * the media in the libosinfo database and return our best guess for
+ * the operating system.
+ *
+ * This re...
2014 Nov 26
5
[PATCH] tools: implement --short-options
...q' },
+ { "short-options", 0, 0, 0 },
{ "uuid", 0, 0, 0, },
{ "verbose", 0, 0, 'v' },
{ "version", 0, 0, 'V' },
@@ -143,6 +144,8 @@ main (int argc, char *argv[])
case 0: /* options which are long only */
if (STREQ (long_options[option_index].name, "long-options"))
display_long_options (long_options);
+ else if (STREQ (long_options[option_index].name, "short-options"))
+ display_short_options (options);
else if (STREQ (long_options[option_index].name, "form...
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 STRCAS...
2020 Feb 13
0
[PATCH v3 1/1] tools: add '--blocksize' option for C-based tools
...truct drv *drvs = NULL;
const char *format = NULL;
bool format_consumed = true;
+ int blocksize = 0;
+ bool blocksize_consumed = true;
int c;
int option_index;
int exit_code;
@@ -153,6 +158,8 @@ main (int argc, char *argv[])
display_short_options (options);
else if (STREQ (long_options[option_index].name, "format")) {
OPTION_format;
+ } else if (STREQ (long_options[option_index].name, "blocksize")) {
+ OPTION_blocksize;
} else if (STREQ (long_options[option_index].name, "uuid")) {
uuid = 1;
}...
2017 Feb 07
0
[PATCH v2 3/7] mllib: expose libosinfo DB reading functions in mllib
...ernal.h"
+
+#include "osinfo.h"
+
+gl_lock_define_initialized (static, osinfo_db_lock);
+static ssize_t osinfo_db_size = 0; /* 0 = unread, -1 = error, >= 1 = #records */
+static struct osinfo *osinfo_db = NULL;
+
+
+static void free_osinfo_db_entry (struct osinfo *);
+
+#define XMLSTREQ(a,b) (xmlStrEqual((a),(b)) == 1)
+
+static int
+read_osinfo_db_xml (guestfs_h *g, const char *pathname, void *data);
+
+/* Given one or more fields from the header of a CD/DVD/ISO, look up
+ * the media in the libosinfo database and return our best guess for
+ * the operating system.
+ *
+ * This r...
2020 Feb 12
0
[PATCH v2 1/1] tools: add '--blocksize' option for C-based tools
...truct drv *drvs = NULL;
const char *format = NULL;
bool format_consumed = true;
+ int blocksize = 0;
+ bool blocksize_consumed = true;
int c;
int option_index;
int exit_code;
@@ -153,6 +158,8 @@ main (int argc, char *argv[])
display_short_options (options);
else if (STREQ (long_options[option_index].name, "format")) {
OPTION_format;
+ } else if (STREQ (long_options[option_index].name, "blocksize")) {
+ OPTION_blocksize;
} else if (STREQ (long_options[option_index].name, "uuid")) {
uuid = 1;
}...
2015 Aug 25
2
[PATCH 1/2] inspect: recognize the ALT Linux distribution
Check its presence ahead of /etc/redhat-release, as the distro provides
it and thus previously it was recognized as "redhat-based".
---
generator/actions.ml | 4 ++++
src/guestfs-internal.h | 1 +
src/inspect-fs-unix.c | 21 +++++++++++++++++++++
src/inspect-fs.c | 2 ++
src/inspect-icon.c | 1 +
src/inspect.c | 1 +
6 files changed, 30 insertions(+)
diff
2020 Feb 13
2
[PATCH v3 0/1] tools: add '--blocksize' option for C-based tools
From: Nikolay Ivanets <stenavin@gmail.com>
This patch depends on changes in 'common' sub-module posted here:
https://www.redhat.com/archives/libguestfs/2020-February/msg00150.html
v3 fixes issue found during code review:
- options now appear in alphabetical order
v2:
Almost the same as v1 except '--blocksize' option description is moved
into a common submodule (similar to
2020 Feb 12
3
[PATCH v2 0/1] tools: add '--blocksize' option for C-based tools
From: Nikolay Ivanets <stenavin@gmail.com>
This patch depends on changes in 'common' sub-module posted here:
https://www.redhat.com/archives/libguestfs/2020-February/msg00099.html
v2:
Almost the same as v1 except '--blocksize' option description is moved
into a common submodule (similar to key-option.pod).
v1 was here:
2020 Feb 11
0
[PATCH 1/1] tools: add '--blocksize' option for C-based tools
...truct drv *drvs = NULL;
const char *format = NULL;
bool format_consumed = true;
+ int blocksize = 0;
+ bool blocksize_consumed = true;
int c;
int option_index;
int exit_code;
@@ -153,6 +158,8 @@ main (int argc, char *argv[])
display_short_options (options);
else if (STREQ (long_options[option_index].name, "format")) {
OPTION_format;
+ } else if (STREQ (long_options[option_index].name, "blocksize")) {
+ OPTION_blocksize;
} else if (STREQ (long_options[option_index].name, "uuid")) {
uuid = 1;
}...
2020 Feb 11
2
[PATCH 0/1] tools: add '--blocksize' option for C-based tools
From: Nikolay Ivanets <stenavin@gmail.com>
This patch depends on changes in 'common' sub-module posted here:
https://www.redhat.com/archives/libguestfs/2020-February/msg00096.html
Nikolay Ivanets (1):
tools: add '--blocksize' option for C-based tools
align/scan.c | 8 ++++++++
align/virt-alignment-scan.pod | 12 ++++++++++++
cat/cat.c
2015 Jul 13
1
[PATCH] daemon: add a space after func name to fit code-style
...me_show (const char *subvolume)
}
/* Read the lines and split into "key: value". */
- p = analyze_line(p, &key, &value, ':');
+ p = analyze_line (p, &key, &value, ':');
while (key) {
/* snapshot is special, see the output above */
if (STREQLEN (key, "Snapshot(s)", sizeof ("Snapshot(s)") - 1)) {
@@ -1093,7 +1093,7 @@ do_btrfs_subvolume_show (const char *subvolume)
if (add_string (&ret, key) == -1)
return NULL;
- p = analyze_line(p, &key, &value, ':');
+ p = analyze_lin...
2016 Jul 26
1
[PATCH] osinfo: map "sled" as "sles"
...e changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/osinfo.c b/src/osinfo.c
index 907580e..7fdaf1c 100644
--- a/src/osinfo.c
+++ b/src/osinfo.c
@@ -625,7 +625,7 @@ parse_distro (guestfs_h *g, xmlNodePtr node, struct osinfo *osinfo)
osinfo->distro = OS_DISTRO_OPENSUSE;
else if (STREQ (content, "rhel"))
osinfo->distro = OS_DISTRO_RHEL;
- else if (STREQ (content, "sles"))
+ else if (STREQ (content, "sled") || STREQ (content, "sles"))
osinfo->distro = OS_DISTRO_SLES;
else if (STREQ (content, "ubuntu")...
2013 Dec 09
1
[PATCH] launch: switch from -nographic to -display none
...t;-machine");
guestfs___cmd_add_arg (cmd3, "accel=kvm:tcg");
guestfs___cmd_add_arg (cmd3, "-device");
diff --git a/src/launch.c b/src/launch.c
index 60f6811..9c1c33a 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -295,6 +295,7 @@ guestfs__config (guestfs_h *g,
if (STREQ (hv_param, "-kernel") ||
STREQ (hv_param, "-initrd") ||
STREQ (hv_param, "-nographic") ||
+ STREQ (hv_param, "-display") ||
STREQ (hv_param, "-serial") ||
STREQ (hv_param, "-full-screen") ||
STREQ (h...
2020 Oct 06
2
Re: [PATCH common v2 4/4] options: Ignore errors from guestfs_luks_uuid.
...dbool.h>
> #include <string.h>
> #include <libintl.h>
> #include <error.h>
>@@ -82,11 +83,23 @@ inspect_do_decrypt (guestfs_h *g, struct key_store *ks)
> CLEANUP_FREE char *type = guestfs_vfs_type (g, partitions[i]);
> if (type &&
> (STREQ (type, "crypto_LUKS") || STREQ (type, "BitLocker"))) {
>+ bool is_bitlocker = STREQ (type, "BitLocker");
> char mapname[32];
> make_mapname (partitions[i], mapname, sizeof mapname);
>
> #ifdef GUESTFS_HAVE_LUKS_UUID
>- CLEANUP_FR...
2014 Nov 16
2
[PATCH] list-applications: Add support for pacman
...if (local_db == NULL)
+ return NULL;
+
+ /* Allocate 'apps' list. */
+ apps = safe_malloc (g, sizeof *apps);
+ apps->len = 0;
+ apps->val = NULL;
+
+
+ for (i = 0; i < local_db->len; i++) {
+ curr = &local_db->val[i];
+
+ if (curr->ftyp != 'd' || STREQ (curr->name, ".") || STREQ (curr->name, ".."))
+ continue;
+
+ free (fname);
+ fname = safe_malloc (g, strlen (curr->name) + path_len + 1);
+ sprintf (fname, "/var/lib/pacman/local/%s/desc", curr->name);
+ free (desc_file);
+ desc_file =...