All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raghavendra D Prabhu <rprabhu@wnohang.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Build fixes
Date: Sat, 2 Jul 2011 19:36:46 +0530	[thread overview]
Message-ID: <20110702140646.GA4425@Xye> (raw)

[-- Attachment #1: Type: text/plain, Size: 506 bytes --]

Hi,
     With default configure, the qemu-kvm client build was failing for me
     since Werror is enabled by default in configure.
     Deprecations (gnutls), gcc signed-overflow optimization
     (Werror=strict-overflows) and few unused-but-set variables were
     causing it. I have attached the patches after applying which, I got
     no further errors.

--------------------------
Raghavendra Prabhu
GPG Id : 0xD72BE977
Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977
www: wnohang.net

[-- Attachment #2: 0001-Avoid-the-use-of-deprecated-gnutls-gnutls_-_set_prio.patch --]
[-- Type: text/plain, Size: 2260 bytes --]

>From 51b5cbebc488fc126339651120e923934fe29928 Mon Sep 17 00:00:00 2001
Message-Id: <51b5cbebc488fc126339651120e923934fe29928.1309612724.git.rprabhu@wnohang.net>
From: Raghavendra D Prabhu <rprabhu@wnohang.net>
Date: Sat, 2 Jul 2011 17:33:40 +0530
Subject: [PATCH 1/3] Avoid the use of deprecated gnutls gnutls_*_set_priority
 functions.

The gnutls_*_set_priority family of functions has been marked deprecated
in 2.12.x. These functions have been superceded by
gnutls_priority_set_direct().

Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net>
---
 ui/vnc-tls.c |   20 +-------------------
 1 files changed, 1 insertions(+), 19 deletions(-)

diff --git a/ui/vnc-tls.c b/ui/vnc-tls.c
index dec626c..33a5d8c 100644
--- a/ui/vnc-tls.c
+++ b/ui/vnc-tls.c
@@ -286,10 +286,6 @@ int vnc_tls_validate_certificate(struct VncState *vs)
 
 int vnc_tls_client_setup(struct VncState *vs,
                          int needX509Creds) {
-    static const int cert_type_priority[] = { GNUTLS_CRT_X509, 0 };
-    static const int protocol_priority[]= { GNUTLS_TLS1_1, GNUTLS_TLS1_0, GNUTLS_SSL3, 0 };
-    static const int kx_anon[] = {GNUTLS_KX_ANON_DH, 0};
-    static const int kx_x509[] = {GNUTLS_KX_DHE_DSS, GNUTLS_KX_RSA, GNUTLS_KX_DHE_RSA, GNUTLS_KX_SRP, 0};
 
     VNC_DEBUG("Do TLS setup\n");
     if (vnc_tls_initialize() < 0) {
@@ -310,21 +306,7 @@ int vnc_tls_client_setup(struct VncState *vs,
             return -1;
         }
 
-        if (gnutls_kx_set_priority(vs->tls.session, needX509Creds ? kx_x509 : kx_anon) < 0) {
-            gnutls_deinit(vs->tls.session);
-            vs->tls.session = NULL;
-            vnc_client_error(vs);
-            return -1;
-        }
-
-        if (gnutls_certificate_type_set_priority(vs->tls.session, cert_type_priority) < 0) {
-            gnutls_deinit(vs->tls.session);
-            vs->tls.session = NULL;
-            vnc_client_error(vs);
-            return -1;
-        }
-
-        if (gnutls_protocol_set_priority(vs->tls.session, protocol_priority) < 0) {
+        if (gnutls_priority_set_direct(vs->tls.session, needX509Creds ? "NORMAL" : "NORMAL:+ANON-DH", NULL) < 0) {
             gnutls_deinit(vs->tls.session);
             vs->tls.session = NULL;
             vnc_client_error(vs);
-- 
1.7.6


[-- Attachment #3: 0002-Add-fno-strict-overflow.patch --]
[-- Type: text/plain, Size: 1114 bytes --]

>From bfecbc89c76320fe48a0efaa21fef7085b0d04bb Mon Sep 17 00:00:00 2001
Message-Id: <bfecbc89c76320fe48a0efaa21fef7085b0d04bb.1309612724.git.rprabhu@wnohang.net>
In-Reply-To: <51b5cbebc488fc126339651120e923934fe29928.1309612724.git.rprabhu@wnohang.net>
References: <51b5cbebc488fc126339651120e923934fe29928.1309612724.git.rprabhu@wnohang.net>
From: Raghavendra D Prabhu <rprabhu@wnohang.net>
Date: Sat, 2 Jul 2011 18:24:20 +0530
Subject: [PATCH 2/3] Add fno-strict-overflow

This is to avoid gcc optimizating out the comparison in assert,
due to assumption of signed overflow being undefined by default (-Werror=strict-overflow).

Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net>
---
 Makefile.hw |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.hw b/Makefile.hw
index b9181ab..23dac45 100644
--- a/Makefile.hw
+++ b/Makefile.hw
@@ -9,7 +9,7 @@ include $(SRC_PATH)/rules.mak
 
 $(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
 
-QEMU_CFLAGS+=-I.. -I$(SRC_PATH)/fpu
+QEMU_CFLAGS+=-I.. -I$(SRC_PATH)/fpu -fno-strict-overflow
 
 include $(SRC_PATH)/Makefile.objs
 
-- 
1.7.6


[-- Attachment #4: 0003-Avoid-Wunsed-but-set-warnings-or-errors-in-case-of-W.patch --]
[-- Type: text/plain, Size: 4241 bytes --]

>From 2cb2082c25eadc24d1e22ebbd4293e3e6b53c832 Mon Sep 17 00:00:00 2001
Message-Id: <2cb2082c25eadc24d1e22ebbd4293e3e6b53c832.1309612724.git.rprabhu@wnohang.net>
In-Reply-To: <51b5cbebc488fc126339651120e923934fe29928.1309612724.git.rprabhu@wnohang.net>
References: <51b5cbebc488fc126339651120e923934fe29928.1309612724.git.rprabhu@wnohang.net>
From: Raghavendra D Prabhu <rprabhu@wnohang.net>
Date: Sat, 2 Jul 2011 18:36:39 +0530
Subject: [PATCH 3/3] Avoid Wunsed-but-set warnings (or errors in case of
 Werror)

In a few cases, variable attributed 'unused' has been added, in other cases
unused variable has been either removed or commented out.

Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net>
---
 hw/device-assignment.c |    6 +++---
 simpletrace.c          |    2 +-
 xen-mapcache.c         |    7 ++-----
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index 36ad6b0..19a59b4 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -1654,7 +1654,7 @@ static void reset_assigned_device(DeviceState *dev)
     AssignedDevice *adev = DO_UPCAST(AssignedDevice, dev, pci_dev);
     char reset_file[64];
     const char reset[] = "1";
-    int fd, ret;
+    int fd, __attribute__((unused)) ret;
 
     snprintf(reset_file, sizeof(reset_file),
              "/sys/bus/pci/devices/%04x:%02x:%02x.%01x/reset",
@@ -1682,7 +1682,7 @@ static void reset_assigned_device(DeviceState *dev)
 static int assigned_initfn(struct PCIDevice *pci_dev)
 {
     AssignedDevice *dev = DO_UPCAST(AssignedDevice, dev, pci_dev);
-    uint8_t e_device, e_intx;
+    uint8_t e_intx;
     int r;
 
     if (!kvm_enabled()) {
@@ -1709,7 +1709,7 @@ static int assigned_initfn(struct PCIDevice *pci_dev)
         goto out;
 
     /* handle interrupt routing */
-    e_device = (dev->dev.devfn >> 3) & 0x1f;
+    /*e_device = (dev->dev.devfn >> 3) & 0x1f;*/
     e_intx = dev->dev.config[0x3d] - 1;
     dev->intpin = e_intx;
     dev->run = 0;
diff --git a/simpletrace.c b/simpletrace.c
index f1dbb5e..2ce9cff 100644
--- a/simpletrace.c
+++ b/simpletrace.c
@@ -119,7 +119,7 @@ static void *writeout_thread(void *opaque)
     TraceRecord record;
     unsigned int writeout_idx = 0;
     unsigned int num_available, idx;
-    size_t unused;
+    size_t __attribute__((unused)) unused;
 
     for (;;) {
         wait_for_trace_records_available();
diff --git a/xen-mapcache.c b/xen-mapcache.c
index fac47cd..94642bc 100644
--- a/xen-mapcache.c
+++ b/xen-mapcache.c
@@ -166,7 +166,7 @@ static void qemu_remap_bucket(MapCacheEntry *entry,
 
 uint8_t *qemu_map_cache(target_phys_addr_t phys_addr, target_phys_addr_t size, uint8_t lock)
 {
-    MapCacheEntry *entry, *pentry = NULL;
+    MapCacheEntry *entry;
     target_phys_addr_t address_index  = phys_addr >> MCACHE_BUCKET_SHIFT;
     target_phys_addr_t address_offset = phys_addr & (MCACHE_BUCKET_SIZE - 1);
     target_phys_addr_t __size = size;
@@ -192,12 +192,10 @@ uint8_t *qemu_map_cache(target_phys_addr_t phys_addr, target_phys_addr_t size, u
             (entry->paddr_index != address_index || entry->size != __size ||
              !test_bits(address_offset >> XC_PAGE_SHIFT, size >> XC_PAGE_SHIFT,
                  entry->valid_mapping))) {
-        pentry = entry;
         entry = entry->next;
     }
     if (!entry) {
         entry = qemu_mallocz(sizeof (MapCacheEntry));
-        pentry->next = entry;
         qemu_remap_bucket(entry, __size, address_index);
     } else if (!entry->lock) {
         if (!entry->vaddr_base || entry->paddr_index != address_index ||
@@ -232,7 +230,7 @@ uint8_t *qemu_map_cache(target_phys_addr_t phys_addr, target_phys_addr_t size, u
 
 ram_addr_t qemu_ram_addr_from_mapcache(void *ptr)
 {
-    MapCacheEntry *entry = NULL, *pentry = NULL;
+    MapCacheEntry *entry = NULL;
     MapCacheRev *reventry;
     target_phys_addr_t paddr_index;
     target_phys_addr_t size;
@@ -258,7 +256,6 @@ ram_addr_t qemu_ram_addr_from_mapcache(void *ptr)
 
     entry = &mapcache->entry[paddr_index % mapcache->nr_buckets];
     while (entry && (entry->paddr_index != paddr_index || entry->size != size)) {
-        pentry = entry;
         entry = entry->next;
     }
     if (!entry) {
-- 
1.7.6


             reply	other threads:[~2011-07-02 14:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-02 14:06 Raghavendra D Prabhu [this message]
2011-07-02 14:58 ` [Qemu-devel] [PATCH] Build fixes Stefan Hajnoczi
2011-07-04 22:02   ` Raghavendra D Prabhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110702140646.GA4425@Xye \
    --to=rprabhu@wnohang.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.