Skip to contentSkip to conversation

Misc changes to allow building with Windows Clang

PATCH In review Kostiantyn Kostiuk 4 participants 30 messages Mar 27 – Mar 30

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v2 cover Misc changes to allow building with Windows Clang

v2 -> v1:
- Added additional commits to remove strcasecmp/strncasecmp usage in favor of g_ascii_strcasecmp/g_ascii_strncasecmp
- Don't remove dirent.h from util/drm.c since it's used there
- Updated commit messages with more explanation

v1: https://patchew.org/QEMU/[email protected]/

Kostiantyn Kostiuk (14):
meson: Use stddef.h instead of unistd.h
qom: Use g_ascii_strcasecmp instead of strcasecmp
block: Use glib2 instead of strcasecmp/strncasecmp
io: Use glib2 instead of strcasecmp/strncasecmp hw/arm: Use glib2 instead of strcasecmp/strncasecmp target/sparc: Use glib2 instead of strcasecmp/strncasecmp target/riscv: Use glib2 instead of strcasecmp/strncasecmp target/ppc: Use glib2 instead of strcasecmp/strncasecmp target/xtensa: Use glib2 instead of strcasecmp/strncasecmp hw/ppc: Use glib2 instead of strcasecmp/strncasecmp
osdep: Remove unused strings.h
util: Remove unused dirent.h
util: Remove unused sys/param.h
meson: Don't require nm for non-modular builds

Paolo Bonzini (1):
storage-daemon: use same link arguments as other tools

 block/curl.c               |  4 ++--
 hw/arm/xilinx_zynq.c       |  8 ++++----
 hw/ppc/spapr_caps.c        |  2 +-
 include/qemu/osdep.h       |  1 -
 io/channel-websock.c       |  4 ++--
 meson.build                | 35 +++++++++++++++++++----------------
 qom/object.c               |  4 ++--
 storage-daemon/meson.build | 16 ++++++++--------
 target/ppc/kvm.c           |  2 +-
 target/riscv/monitor.c     |  4 ++--
 target/sparc/cpu.c         |  8 ++++----
 target/xtensa/xtensa-isa.c |  4 ++--
 util/path.c                |  2 --
 13 files changed, 47 insertions(+), 47 deletions(-)

--
2.52.0

#1 lore raw

PATCH v2 1/15 meson: Use stddef.h instead of unistd.h

POSIX says stddef.h provides size_t, which is the only thing we care about here. unistd.h can be missing in non-POSIX runtimes, so include stddef.h instead.

---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
index 6c712f8b0d..1087e8c106 100644
@@ -1057,7 +1057,7 @@ endif
 
 if not cc.compiles('''
   #include <glib.h>
-  #include <unistd.h>
+  #include <stddef.h>
 
   #define QEMU_BUILD_BUG_ON(x) \
   typedef char qemu_build_bug_on[(x)?-1:1] __attribute__((unused));
Signature · 1 line
2.52.0
#3 lore raw

PATCH v2 2/15 qom: Use g_ascii_strcasecmp instead of strcasecmp

In reply to Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here
(2) we want the comparison on class names to be a plain ASCII one, not to do weird things with "I" in Turkish locales, so g_ascii_strcasecmp() is better as it's explicit about that

---
 qom/object.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
qom/object.c +2 -2
index ff8ede8a32..e5c0c2f53e 100644
@@ -1193,8 +1193,8 @@ GSList *object_class_get_list(const char *implements_type,
 
 static gint object_class_cmp(gconstpointer a, gconstpointer b, gpointer d)
 {
-    return strcasecmp(object_class_get_name((ObjectClass *)a),
-                      object_class_get_name((ObjectClass *)b));
+    return g_ascii_strcasecmp(object_class_get_name((ObjectClass *)a),
+                              object_class_get_name((ObjectClass *)b));
 }
 
 GSList *object_class_get_list_sorted(const char *implements_type,
Signature · 1 line
2.52.0
#4 lore raw

PATCH v2 3/15 block: Use glib2 instead of strcasecmp/strncasecmp

In reply to Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here
(2) we want the comparison on url prefix and it should be a plain ASCII one, not to do weird things with "I" in Turkish locales, so g_ascii_strcasecmp() is better as it's explicit about that

---
 block/curl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
block/curl.c +2 -2
index 66aecfb20e..bb72962d25 100644
@@ -871,8 +871,8 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
         goto out;
     }
 
-    if ((!strncasecmp(s->url, "http://", strlen("http://"))
-        || !strncasecmp(s->url, "https://", strlen("https://")))
+    if ((!g_ascii_strncasecmp(s->url, "http://", strlen("http://"))
+        || !g_ascii_strncasecmp(s->url, "https://", strlen("https://")))
         && !s->accept_range) {
         pstrcpy(state->errmsg, CURL_ERROR_SIZE,
                 "Server does not support 'range' (byte ranges).");
Signature · 1 line
2.52.0
Reviewed-by on v2 3/15
#5 lore raw

Re: [PATCH v2 03/15] block: Use glib2 instead of strcasecmp/strncasecmp

Quoted 11 lines · Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here
(2) we want the comparison on url prefix and it should be a plain ASCII one, not to do weird things with "I" in Turkish locales, so g_ascii_strcasecmp() is better as it's explicit about that

---

thanks
-- PMM

#6 lore raw

PATCH v2 4/15 io: Use glib2 instead of strcasecmp/strncasecmp

In reply to Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here
(2) we want the comparison data in HTTP header and it should be a plain ASCII one, not to do weird things with "I" in Turkish locales, so g_ascii_strcasecmp() is better as it's explicit about that

---
 io/channel-websock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
io/channel-websock.c +2 -2
index 9902b014f7..85b22a8822 100644
@@ -457,7 +457,7 @@ static void qio_channel_websock_handshake_process(QIOChannelWebsock *ioc,
     connectionv = g_strsplit(connection, ",", 0);
     for (i = 0; connectionv != NULL && connectionv[i] != NULL; i++) {
         g_strstrip(connectionv[i]);
-        if (strcasecmp(connectionv[i],
+        if (g_ascii_strcasecmp(connectionv[i],
                        QIO_CHANNEL_WEBSOCK_CONNECTION_UPGRADE) == 0) {
             upgraded = true;
         }
@@ -468,7 +468,7 @@ static void qio_channel_websock_handshake_process(QIOChannelWebsock *ioc,
         goto bad_request;
     }
 
-    if (strcasecmp(upgrade, QIO_CHANNEL_WEBSOCK_UPGRADE_WEBSOCKET) != 0) {
+    if (g_ascii_strcasecmp(upgrade, QIO_CHANNEL_WEBSOCK_UPGRADE_WEBSOCKET) != 0) {
         error_setg(errp, "Incorrect upgrade method '%s'", upgrade);
         goto bad_request;
     }
Signature · 1 line
2.52.0
Reviewed-by on v2 4/15
#7 lore raw

Re: [PATCH v2 04/15] io: Use glib2 instead of strcasecmp/strncasecmp

Quoted 10 lines · Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here
(2) we want the comparison data in HTTP header and it should be a plain ASCII one, not to do weird things with "I" in Turkish locales, so g_ascii_strcasecmp() is better as it's explicit about that

thanks
-- PMM

#8 lore raw

PATCH v2 5/15 hw/arm: Use glib2 instead of strcasecmp/strncasecmp

In reply to Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here
(2) we want the comparison on boot names to be a plain ASCII one, not to do weird things with "I" in Turkish locales, so g_ascii_strcasecmp() is better as it's explicit about that

---
 hw/arm/xilinx_zynq.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/arm/xilinx_zynq.c +4 -4
index d43f36b718..e3cfeb4c08 100644
@@ -186,13 +186,13 @@ static void zynq_set_boot_mode(Object *obj, const char *str,
     ZynqMachineState *m = ZYNQ_MACHINE(obj);
     uint8_t mode = 0;
 
-    if (!strncasecmp(str, "qspi", 4)) {
+    if (!g_ascii_strncasecmp(str, "qspi", 4)) {
         mode = 1;
-    } else if (!strncasecmp(str, "sd", 2)) {
+    } else if (!g_ascii_strncasecmp(str, "sd", 2)) {
         mode = 5;
-    } else if (!strncasecmp(str, "nor", 3)) {
+    } else if (!g_ascii_strncasecmp(str, "nor", 3)) {
         mode = 2;
-    } else if (!strncasecmp(str, "jtag", 4)) {
+    } else if (!g_ascii_strncasecmp(str, "jtag", 4)) {
         mode = 0;
     } else {
         error_setg(errp, "%s boot mode not supported", str);
Signature · 1 line
2.52.0
Reviewed-by on v2 5/15
#9 lore raw

Re: [PATCH v2 05/15] hw/arm: Use glib2 instead of strcasecmp/strncasecmp

Quoted 37 lines · Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here
(2) we want the comparison on boot names to be a plain ASCII one, not to do weird things with "I" in Turkish locales, so g_ascii_strcasecmp() is better as it's explicit about that

---
 hw/arm/xilinx_zynq.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/arm/xilinx_zynq.c +4 -5
index d43f36b718..e3cfeb4c08 100644
@@ -186,13 +186,13 @@ static void zynq_set_boot_mode(Object *obj, const char *str,
     ZynqMachineState *m = ZYNQ_MACHINE(obj);
     uint8_t mode = 0;
 
-    if (!strncasecmp(str, "qspi", 4)) {
+    if (!g_ascii_strncasecmp(str, "qspi", 4)) {
         mode = 1;
-    } else if (!strncasecmp(str, "sd", 2)) {
+    } else if (!g_ascii_strncasecmp(str, "sd", 2)) {
         mode = 5;
-    } else if (!strncasecmp(str, "nor", 3)) {
+    } else if (!g_ascii_strncasecmp(str, "nor", 3)) {
         mode = 2;
-    } else if (!strncasecmp(str, "jtag", 4)) {
+    } else if (!g_ascii_strncasecmp(str, "jtag", 4)) {
         mode = 0;
     } else {
         error_setg(errp, "%s boot mode not supported", str);
--
Quoted 1 line

2.52.0

(I suspect this code really ought to be doing a strcasecmp, because why would we want "-machine boot-mode=sdXYZZY" to act like "-machine boot-mode=sd" ? But that's a separate bug.)

thanks
-- PMM

#10 lore raw

PATCH v2 6/15 target/sparc: Use glib2 instead of strcasecmp/strncasecmp

In reply to Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here
(2) we want the comparison on boolean property value to be a plain ASCII one, not to do weird things with "I" in Turkish locales, so g_ascii_strcasecmp() is better as it's explicit about that

---
 target/sparc/cpu.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
target/sparc/cpu.c +4 -4
index 1493336e7a..7704610428 100644
@@ -174,10 +174,10 @@ static void sparc_cpu_parse_features(const char *typename, char *features,
              * TODO: remove minus-override-plus semantics after
              *       warning for a few releases
              */
-            if (!strcasecmp(val, "on") ||
-                !strcasecmp(val, "off") ||
-                !strcasecmp(val, "true") ||
-                !strcasecmp(val, "false")) {
+            if (!g_ascii_strcasecmp(val, "on") ||
+                !g_ascii_strcasecmp(val, "off") ||
+                !g_ascii_strcasecmp(val, "true") ||
+                !g_ascii_strcasecmp(val, "false")) {
                 error_setg(errp, "Boolean properties in format %s=%s"
                                  " are not supported", name, val);
                 return;
Signature · 1 line
2.52.0
Reviewed-by on v2 6/15
#11 lore raw

Re: [PATCH v2 06/15] target/sparc: Use glib2 instead of strcasecmp/strncasecmp

Quoted 11 lines · Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here
(2) we want the comparison on boolean property value to be a plain ASCII one, not to do weird things with "I" in Turkish locales, so g_ascii_strcasecmp() is better as it's explicit about that

---

thanks
-- PMM

#12 lore raw

PATCH v2 7/15 target/riscv: Use glib2 instead of strcasecmp/strncasecmp

In reply to Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here

---
 target/riscv/monitor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/riscv/monitor.c +2 -2
index a9d3111444..bca04a7580 100644
@@ -303,7 +303,7 @@ static bool reg_is_vreg(const char *name)
     }
 
     for (int i = 0; i < 32; i++) {
-        if (strcasecmp(name, riscv_rvv_regnames[i]) == 0) {
+        if (g_ascii_strcasecmp(name, riscv_rvv_regnames[i]) == 0) {
             return true;
         }
     }
@@ -358,7 +358,7 @@ int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval)
             continue;
         }
 
-        if (strcasecmp(csr_ops[csrno].name, name) != 0) {
+        if (g_ascii_strcasecmp(csr_ops[csrno].name, name) != 0) {
             continue;
         }
 
Signature · 1 line
2.52.0
Reviewed-by on v2 7/15
#13 lore raw

Re: [PATCH v2 07/15] target/riscv: Use glib2 instead of strcasecmp/strncasecmp

Quoted 7 lines · Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here

thanks
-- PMM

Reviewed-by on v2 7/15
#14 lore raw

Re: [PATCH v2 07/15] target/riscv: Use glib2 instead of strcasecmp/strncasecmp

In reply to Kostiantyn Kostiuk
Quoted 4 lines · Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here

Thanks,
Chao

Quoted 32 lines
---
 target/riscv/monitor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/riscv/monitor.c +2 -2
index a9d3111444..bca04a7580 100644
@@ -303,7 +303,7 @@ static bool reg_is_vreg(const char *name)
     }
 
     for (int i = 0; i < 32; i++) {
-        if (strcasecmp(name, riscv_rvv_regnames[i]) == 0) {
+        if (g_ascii_strcasecmp(name, riscv_rvv_regnames[i]) == 0) {
             return true;
         }
     }
@@ -358,7 +358,7 @@ int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval)
             continue;
         }
 
-        if (strcasecmp(csr_ops[csrno].name, name) != 0) {
+        if (g_ascii_strcasecmp(csr_ops[csrno].name, name) != 0) {
             continue;
         }
 
Signature · 1 line
2.52.0
Reviewed-by on v2 7/15
#15 lore raw

Re: [PATCH v2 07/15] target/riscv: Use glib2 instead of strcasecmp/strncasecmp

In reply to Kostiantyn Kostiuk
Quoted 7 lines · Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here

Alistair

Quoted 30 lines
---
 target/riscv/monitor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/riscv/monitor.c +2 -3
index a9d3111444..bca04a7580 100644
@@ -303,7 +303,7 @@ static bool reg_is_vreg(const char *name)
     }
 
     for (int i = 0; i < 32; i++) {
-        if (strcasecmp(name, riscv_rvv_regnames[i]) == 0) {
+        if (g_ascii_strcasecmp(name, riscv_rvv_regnames[i]) == 0) {
             return true;
         }
     }
@@ -358,7 +358,7 @@ int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval)
             continue;
         }
 
-        if (strcasecmp(csr_ops[csrno].name, name) != 0) {
+        if (g_ascii_strcasecmp(csr_ops[csrno].name, name) != 0) {
             continue;
         }
 
--

2.52.0

#16 lore raw

PATCH v2 8/15 target/ppc: Use glib2 instead of strcasecmp/strncasecmp

In reply to Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here

---
 target/ppc/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/ppc/kvm.c +1 -1
index 41bd03ec2a..25c28ad089 100644
@@ -2653,7 +2653,7 @@ static int kvm_ppc_register_host_cpu_type(void)
      */
     dc = DEVICE_CLASS(ppc_cpu_get_family_class(pvr_pcc));
     for (i = 0; ppc_cpu_aliases[i].alias != NULL; i++) {
-        if (strcasecmp(ppc_cpu_aliases[i].alias, dc->desc) == 0) {
+        if (g_ascii_strcasecmp(ppc_cpu_aliases[i].alias, dc->desc) == 0) {
             char *suffix;
 
             ppc_cpu_aliases[i].model = g_strdup(object_class_get_name(oc));
Signature · 1 line
2.52.0
Reviewed-by on v2 8/15
#17 lore raw

Re: [PATCH v2 08/15] target/ppc: Use glib2 instead of strcasecmp/strncasecmp

Quoted 7 lines · Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here

thanks
-- PMM

#18 lore raw

PATCH v2 9/15 target/xtensa: Use glib2 instead of strcasecmp/strncasecmp

In reply to Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here

---
 target/xtensa/xtensa-isa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/xtensa/xtensa-isa.c +2 -2
index 630b4f9da1..c564af340f 100644
@@ -370,7 +370,7 @@ int xtensa_isa_name_compare(const void *v1, const void *v2)
     xtensa_lookup_entry *e1 = (xtensa_lookup_entry *)v1;
     xtensa_lookup_entry *e2 = (xtensa_lookup_entry *)v2;
 
-    return strcasecmp(e1->key, e2->key);
+    return g_ascii_strcasecmp(e1->key, e2->key);
 }
 
 
@@ -513,7 +513,7 @@ xtensa_format xtensa_format_lookup(xtensa_isa isa, const char *fmtname)
     }
 
     for (fmt = 0; fmt < intisa->num_formats; fmt++) {
-        if (strcasecmp(fmtname, intisa->formats[fmt].name) == 0) {
+        if (g_ascii_strcasecmp(fmtname, intisa->formats[fmt].name) == 0) {
             return fmt;
         }
     }
Signature · 1 line
2.52.0
Reviewed-by on v2 9/15
#19 lore raw

Re: [PATCH v2 09/15] target/xtensa: Use glib2 instead of strcasecmp/strncasecmp

Quoted 9 lines · Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here

---
 target/xtensa/xtensa-isa.c | 4 ++--

thanks
-- PMM

#20 lore raw

PATCH v2 10/15 hw/ppc: Use glib2 instead of strcasecmp/strncasecmp

In reply to Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here

---
 hw/ppc/spapr_caps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/spapr_caps.c +1 -1
index 170795ad6a..f4a26a85b5 100644
@@ -129,7 +129,7 @@ static void spapr_cap_set_string(Object *obj, Visitor *v, const char *name,
         return;
     }
     for (i = 0; i < cap->possible->num; i++) {
-        if (!strcasecmp(val, cap->possible->vals[i])) {
+        if (!g_ascii_strcasecmp(val, cap->possible->vals[i])) {
             spapr->cmd_line_caps[cap->index] = true;
             spapr->eff.caps[cap->index] = i;
             return;
Signature · 1 line
2.52.0
Reviewed-by on v2 10/15
#21 lore raw

Re: [PATCH v2 10/15] hw/ppc: Use glib2 instead of strcasecmp/strncasecmp

Quoted 7 lines · Kostiantyn Kostiuk

This is a change in semantics. g_ascii_strcasecmp() doesn't honour locale but strcasecmp() does. But this is OK for at least one reason:
(1) QEMU always runs with the C locale so there's not an actual behaviour change here

thanks
-- PMM

#22 lore raw

PATCH v2 11/15 osdep: Remove unused strings.h

In reply to Kostiantyn Kostiuk

We don't use strcasecmp/strncasecmp anymore. Also, we don't use any other strings.h function. So this include is no more needed.

---
 include/qemu/osdep.h | 1 -
 1 file changed, 1 deletion(-)
include/qemu/osdep.h +0 -1
index 92856decd4..3718fae351 100644
@@ -114,7 +114,6 @@ QEMU_EXTERN_C int daemon(int, int);
 #include <stdio.h>
 
 #include <string.h>
-#include <strings.h>
 #include <inttypes.h>
 #include <limits.h>
 /* Put unistd.h before time.h as that triggers localtime_r/gmtime_r
Signature · 1 line
2.52.0
#24 lore raw

PATCH v2 12/15 util: Remove unused dirent.h

In reply to Kostiantyn Kostiuk

This one is OK to drop, because the rewrite of path.c in commit f3a8bdc1d5b26 removed the uses of the dirent.h functions.

---
 util/path.c | 1 -
 1 file changed, 1 deletion(-)
util/path.c +0 -1
index 8e174eb436..72a255890e 100644
@@ -5,7 +5,6 @@
 */
 #include "qemu/osdep.h"
 #include <sys/param.h>
-#include <dirent.h>
 #include "qemu/cutils.h"
 #include "qemu/path.h"
 #include "qemu/thread.h"
Signature · 1 line
2.52.0
#26 lore raw

PATCH v2 13/15 util: Remove unused sys/param.h

In reply to Kostiantyn Kostiuk

We dropped the use of PATH_MAX in commit f3a8bdc1d5b26 (which basically completely rewrote the path handling). Now we don't need any sys/param.h defines.

---
 util/path.c | 1 -
 1 file changed, 1 deletion(-)
util/path.c +0 -1
index 72a255890e..e1565894d2 100644
@@ -4,7 +4,6 @@
    The assumption is that this area does not change.
 */
 #include "qemu/osdep.h"
-#include <sys/param.h>
 #include "qemu/cutils.h"
 #include "qemu/path.h"
 #include "qemu/thread.h"
Signature · 1 line
2.52.0
Reviewed-by on v2 13/15
#27 lore raw

Re: [PATCH v2 13/15] util: Remove unused sys/param.h

Quoted 7 lines · Kostiantyn Kostiuk

We dropped the use of PATH_MAX in commit f3a8bdc1d5b26 (which basically completely rewrote the path handling). Now we don't need any sys/param.h defines.

(If you need to do a v3 for some reason you could merge this with the previous patch; but it's not worth respinning just to do that.)

thanks
-- PMM

#28 lore raw

PATCH v2 14/15 storage-daemon: use same link arguments as other tools

In reply to Kostiantyn Kostiuk

From: Paolo Bonzini <[email protected]>

---
 meson.build                |  8 ++++----
 storage-daemon/meson.build | 16 ++++++++--------
 2 files changed, 12 insertions(+), 12 deletions(-)
meson.build +4 -4
index 1087e8c106..4a3fc306b7 100644
@@ -4507,15 +4507,15 @@ if xkbcommon.found()
 endif
 
 if have_tools
-  link_args = enable_modules ? ['@block.syms'] : []
+  tools_link_args = enable_modules ? ['@block.syms'] : []
   qemu_img = executable('qemu-img', [files('qemu-img.c'), hxdep],
-             link_args: link_args, link_depends: block_syms,
+             link_args: tools_link_args, link_depends: block_syms,
              dependencies: [authz, block, crypto, io, qom, qemuutil], install: true)
   qemu_io = executable('qemu-io', files('qemu-io.c'),
-             link_args: link_args, link_depends: block_syms,
+             link_args: tools_link_args, link_depends: block_syms,
              dependencies: [block, qemuutil], install: true)
   qemu_nbd = executable('qemu-nbd', files('qemu-nbd.c'),
-               link_args: link_args, link_depends: block_syms,
+               link_args: tools_link_args, link_depends: block_syms,
                dependencies: [blockdev, qemuutil, selinux],
                install: true)
 
storage-daemon/meson.build +8 -8
index 5e61a9d1bd..fc088cbea7 100644
@@ -1,14 +1,14 @@
+assert(have_tools)
+
 qsd_ss = ss.source_set()
 qsd_ss.add(files('qemu-storage-daemon.c'))
 qsd_ss.add(blockdev, chardev, qmp, qom, qemuutil)
 
 subdir('qapi')
 
-if have_tools
-  qsd_ss = qsd_ss.apply({})
-  qsd = executable('qemu-storage-daemon',
-                   qsd_ss.sources(),
-                   link_args: '@block.syms', link_depends: block_syms,
-                   dependencies: qsd_ss.dependencies(),
-                   install: true)
-endif
+qsd_ss = qsd_ss.apply({})
+qsd = executable('qemu-storage-daemon',
+                 qsd_ss.sources(),
+                 link_args: tools_link_args, link_depends: block_syms,
+                 dependencies: qsd_ss.dependencies(),
+                 install: true)
Signature · 1 line
2.52.0
#29 lore raw

PATCH v2 15/15 meson: Don't require nm for non-modular builds

In reply to Kostiantyn Kostiuk

In the MSVC build environment, nm is missing; at the same time, scripts/undefsym.py exits with code 0 at the beginning for non-modular builds.

So, this change is harmless because it already didn't do anything in non-modular builds, but remove the additional tool requirements.

---
 meson.build | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)
meson.build +14 -11
index 4a3fc306b7..cc9e9784e9 100644
@@ -3908,6 +3908,9 @@ modinfo_generate = find_program('scripts/modinfo-generate.py')
 modinfo_files = []
 audio_modinfo_files = []
 
+block_syms = []
+qemu_syms = []
+
 block_mods = []
 system_mods = []
 emulator_modules = []
@@ -4023,18 +4026,18 @@ if enable_modules
   if emulator_modules.length() > 0
     alias_target('modules', emulator_modules)
   endif
-endif
 
-nm = find_program('nm')
-undefsym = find_program('scripts/undefsym.py')
-block_syms = custom_target('block.syms', output: 'block.syms',
-                             input: [libqemuutil, block_mods],
-                             capture: true,
-                             command: [undefsym, nm, '@INPUT@'])
-qemu_syms = custom_target('qemu.syms', output: 'qemu.syms',
-                             input: [libqemuutil, system_mods],
-                             capture: true,
-                             command: [undefsym, nm, '@INPUT@'])
+  nm = find_program('nm')
+  undefsym = find_program('scripts/undefsym.py')
+  block_syms = custom_target('block.syms', output: 'block.syms',
+                              input: [libqemuutil, block_mods],
+                              capture: true,
+                              command: [undefsym, nm, '@INPUT@'])
+  qemu_syms = custom_target('qemu.syms', output: 'qemu.syms',
+                              input: [libqemuutil, system_mods],
+                              capture: true,
+                              command: [undefsym, nm, '@INPUT@'])
+endif
 
 authz_ss = authz_ss.apply({})
 libauthz = static_library('authz', authz_ss.sources() + genh,
Signature · 1 line
2.52.0