|
|
7711c0 |
From b7bec5a423cc8bb7792e231e3d81d015d9278d91 Mon Sep 17 00:00:00 2001
|
|
|
7711c0 |
From: John Snow <jsnow@redhat.com>
|
|
|
7711c0 |
Date: Wed, 27 Mar 2019 17:22:25 +0100
|
|
|
7711c0 |
Subject: [PATCH 086/163] qemu-nbd: Rename 'exp' variable clashing with
|
|
|
7711c0 |
math::exp() symbol
|
|
|
7711c0 |
MIME-Version: 1.0
|
|
|
7711c0 |
Content-Type: text/plain; charset=UTF-8
|
|
|
7711c0 |
Content-Transfer-Encoding: 8bit
|
|
|
7711c0 |
|
|
|
7711c0 |
RH-Author: John Snow <jsnow@redhat.com>
|
|
|
7711c0 |
Message-id: <20190327172308.31077-13-jsnow@redhat.com>
|
|
|
7711c0 |
Patchwork-id: 85184
|
|
|
7711c0 |
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 12/55] qemu-nbd: Rename 'exp' variable clashing with math::exp() symbol
|
|
|
7711c0 |
Bugzilla: 1691009
|
|
|
7711c0 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
7711c0 |
|
|
|
7711c0 |
From: Philippe Mathieu-Daudé <philmd@redhat.com>
|
|
|
7711c0 |
|
|
|
7711c0 |
The use of a variable named 'exp' prevents includes to import <math.h>.
|
|
|
7711c0 |
|
|
|
7711c0 |
Rename it to avoid:
|
|
|
7711c0 |
|
|
|
7711c0 |
qemu-nbd.c:64:19: error: ‘exp’ redeclared as different kind of symbol
|
|
|
7711c0 |
static NBDExport *exp;
|
|
|
7711c0 |
^~~
|
|
|
7711c0 |
In file included from /usr/include/features.h:428,
|
|
|
7711c0 |
from /usr/include/bits/libc-header-start.h:33,
|
|
|
7711c0 |
from /usr/include/stdint.h:26,
|
|
|
7711c0 |
from /usr/lib/gcc/x86_64-redhat-linux/8/include/stdint.h:9,
|
|
|
7711c0 |
from /source/qemu/include/qemu/osdep.h:80,
|
|
|
7711c0 |
from /source/qemu/qemu-nbd.c:19:
|
|
|
7711c0 |
/usr/include/bits/mathcalls.h:95:1: note: previous declaration of ‘exp’ was here
|
|
|
7711c0 |
__MATHCALL_VEC (exp,, (_Mdouble_ __x));
|
|
|
7711c0 |
^~~~~~~~~~~~~~
|
|
|
7711c0 |
|
|
|
7711c0 |
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
|
|
7711c0 |
Reviewed-by: Eric Blake <eblake@redhat.com>
|
|
|
7711c0 |
Message-Id: <20190111163519.11457-1-philmd@redhat.com>
|
|
|
7711c0 |
Signed-off-by: Eric Blake <eblake@redhat.com>
|
|
|
7711c0 |
(cherry picked from commit 9d97658020db922b68da05faadcdd61f49fbbdc7)
|
|
|
7711c0 |
Signed-off-by: John Snow <jsnow@redhat.com>
|
|
|
7711c0 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
7711c0 |
---
|
|
|
7711c0 |
qemu-nbd.c | 23 ++++++++++-------------
|
|
|
7711c0 |
1 file changed, 10 insertions(+), 13 deletions(-)
|
|
|
7711c0 |
|
|
|
7711c0 |
diff --git a/qemu-nbd.c b/qemu-nbd.c
|
|
|
7711c0 |
index 652199c..c37defb 100644
|
|
|
7711c0 |
--- a/qemu-nbd.c
|
|
|
7711c0 |
+++ b/qemu-nbd.c
|
|
|
7711c0 |
@@ -61,7 +61,7 @@
|
|
|
7711c0 |
|
|
|
7711c0 |
#define MBR_SIZE 512
|
|
|
7711c0 |
|
|
|
7711c0 |
-static NBDExport *exp;
|
|
|
7711c0 |
+static NBDExport *export;
|
|
|
7711c0 |
static int verbose;
|
|
|
7711c0 |
static char *srcpath;
|
|
|
7711c0 |
static SocketAddress *saddr;
|
|
|
7711c0 |
@@ -335,7 +335,7 @@ static int nbd_can_accept(void)
|
|
|
7711c0 |
return state == RUNNING && nb_fds < shared;
|
|
|
7711c0 |
}
|
|
|
7711c0 |
|
|
|
7711c0 |
-static void nbd_export_closed(NBDExport *exp)
|
|
|
7711c0 |
+static void nbd_export_closed(NBDExport *export)
|
|
|
7711c0 |
{
|
|
|
7711c0 |
assert(state == TERMINATING);
|
|
|
7711c0 |
state = TERMINATED;
|
|
|
7711c0 |
@@ -1017,14 +1017,11 @@ int main(int argc, char **argv)
|
|
|
7711c0 |
}
|
|
|
7711c0 |
}
|
|
|
7711c0 |
|
|
|
7711c0 |
- exp = nbd_export_new(bs, dev_offset, fd_size, nbdflags, nbd_export_closed,
|
|
|
7711c0 |
- writethrough, NULL, &local_err);
|
|
|
7711c0 |
- if (!exp) {
|
|
|
7711c0 |
- error_report_err(local_err);
|
|
|
7711c0 |
- exit(EXIT_FAILURE);
|
|
|
7711c0 |
- }
|
|
|
7711c0 |
- nbd_export_set_name(exp, export_name);
|
|
|
7711c0 |
- nbd_export_set_description(exp, export_description);
|
|
|
7711c0 |
+ export = nbd_export_new(bs, dev_offset, fd_size, nbdflags,
|
|
|
7711c0 |
+ nbd_export_closed, writethrough,
|
|
|
7711c0 |
+ NULL, &error_fatal);
|
|
|
7711c0 |
+ nbd_export_set_name(export, export_name);
|
|
|
7711c0 |
+ nbd_export_set_description(export, export_description);
|
|
|
7711c0 |
|
|
|
7711c0 |
if (device) {
|
|
|
7711c0 |
#if HAVE_NBD_DEVICE
|
|
|
7711c0 |
@@ -1061,9 +1058,9 @@ int main(int argc, char **argv)
|
|
|
7711c0 |
main_loop_wait(false);
|
|
|
7711c0 |
if (state == TERMINATE) {
|
|
|
7711c0 |
state = TERMINATING;
|
|
|
7711c0 |
- nbd_export_close(exp);
|
|
|
7711c0 |
- nbd_export_put(exp);
|
|
|
7711c0 |
- exp = NULL;
|
|
|
7711c0 |
+ nbd_export_close(export);
|
|
|
7711c0 |
+ nbd_export_put(export);
|
|
|
7711c0 |
+ export = NULL;
|
|
|
7711c0 |
}
|
|
|
7711c0 |
} while (state != TERMINATED);
|
|
|
7711c0 |
|
|
|
7711c0 |
--
|
|
|
7711c0 |
1.8.3.1
|
|
|
7711c0 |
|