Skip to contentSkip to conversation

Configure and build fix for VirtFS

PATCH Applied Harsh Prateek Bora 2 participants 4 messages Jun 7, 2012 – Jun 8, 2012

lore
Share & tools
lore
#0 lore raw

cover Configure and build fix for VirtFS

Minor fixes:
============

1) glib2 deprecated g_atomic_int_exchange_and_add in favour of g_atomic_int_add since ver 2.30 and therefore build breaks with newer glib2 library.
2) Configure needs to report appropriate error on missing libraries for VirtFS.

Harsh Prateek Bora (2):
trace/simple.c: fix deprecated glib2 interface
configure: report appropriate error on missing library

 configure      |    3 ++-
 trace/simple.c |    5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.10.2
#1 lore raw

PATCH 1/2 trace/simple.c: fix deprecated glib2 interface

---
 trace/simple.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
trace/simple.c +4 -1
index 33ae486..b4a3c6e 100644
@@ -161,8 +161,11 @@ static void trace(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3,
     }
 
     timestamp = get_clock();
-
+#if GLIB_CHECK_VERSION(2, 30, 0)
+    idx = g_atomic_int_add((gint *)&trace_idx, 1) % TRACE_BUF_LEN;
+#else
     idx = g_atomic_int_exchange_and_add((gint *)&trace_idx, 1) % TRACE_BUF_LEN;
+#endif
     trace_buf[idx] = (TraceRecord){
         .event = event,
         .timestamp_ns = timestamp,
Signature · 1 line
1.7.10.2
#2 lore raw

PATCH 2/2 configure: report appropriate error on missing library

In reply to Harsh Prateek Bora
---
 configure |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
configure +2 -1
index 76dd57f..e8f0172 100755
@@ -2915,7 +2915,8 @@ if test "$softmmu" = yes ; then
       tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)"
     else
       if test "$virtfs" = yes; then
-        feature_not_found "virtfs"
+        echo "VirtFS is supported only on Linux and requires libcap-devel and libattr-devel"
+        exit 1
       fi
       virtfs=no
     fi
Signature · 1 line
1.7.10.2
#3 lore raw
In reply to Harsh Prateek Bora
Quoted 7 lines · Harsh Prateek Bora

Minor fixes:
============

1) glib2 deprecated g_atomic_int_exchange_and_add in favour of g_atomic_int_add since ver 2.30 and therefore build breaks with newer glib2 library.
2) Configure needs to report appropriate error on missing libraries for VirtFS.

Quoted 11 lines

Harsh Prateek Bora (2):
trace/simple.c: fix deprecated glib2 interface
configure: report appropriate error on missing library

 configure      |    3 ++-
 trace/simple.c |    5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.10.2

Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches

Stefan