[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/20] qemu-nbd: Rename 'exp' variable clashing with
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PULL 12/20] qemu-nbd: Rename 'exp' variable clashing with math::exp() symbol |
Date: |
Mon, 14 Jan 2019 10:25:57 -0600 |
From: Philippe Mathieu-Daudé <address@hidden>
The use of a variable named 'exp' prevents includes to import <math.h>.
Rename it to avoid:
qemu-nbd.c:64:19: error: ‘exp’ redeclared as different kind of symbol
static NBDExport *exp;
^~~
In file included from /usr/include/features.h:428,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdint.h:26,
from /usr/lib/gcc/x86_64-redhat-linux/8/include/stdint.h:9,
from /source/qemu/include/qemu/osdep.h:80,
from /source/qemu/qemu-nbd.c:19:
/usr/include/bits/mathcalls.h:95:1: note: previous declaration of ‘exp’ was
here
__MATHCALL_VEC (exp,, (_Mdouble_ __x));
^~~~~~~~~~~~~~
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
---
qemu-nbd.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 2807e132396..6ca02b6d87b 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -61,7 +61,7 @@
#define MBR_SIZE 512
-static NBDExport *exp;
+static NBDExport *export;
static int verbose;
static char *srcpath;
static SocketAddress *saddr;
@@ -335,7 +335,7 @@ static int nbd_can_accept(void)
return state == RUNNING && nb_fds < shared;
}
-static void nbd_export_closed(NBDExport *exp)
+static void nbd_export_closed(NBDExport *export)
{
assert(state == TERMINATING);
state = TERMINATED;
@@ -1015,10 +1015,11 @@ int main(int argc, char **argv)
}
}
- exp = nbd_export_new(bs, dev_offset, fd_size, nbdflags, nbd_export_closed,
- writethrough, NULL, &error_fatal);
- nbd_export_set_name(exp, export_name);
- nbd_export_set_description(exp, export_description);
+ export = nbd_export_new(bs, dev_offset, fd_size, nbdflags,
+ nbd_export_closed, writethrough,
+ NULL, &error_fatal);
+ nbd_export_set_name(export, export_name);
+ nbd_export_set_description(export, export_description);
if (device) {
#if HAVE_NBD_DEVICE
@@ -1055,9 +1056,9 @@ int main(int argc, char **argv)
main_loop_wait(false);
if (state == TERMINATE) {
state = TERMINATING;
- nbd_export_close(exp);
- nbd_export_put(exp);
- exp = NULL;
+ nbd_export_close(export);
+ nbd_export_put(export);
+ export = NULL;
}
} while (state != TERMINATED);
--
2.20.1
- [Qemu-devel] [PULL 01/20] blockdev: abort transactions in reverse order, (continued)
- [Qemu-devel] [PULL 01/20] blockdev: abort transactions in reverse order, Eric Blake, 2019/01/14
- [Qemu-devel] [PULL 02/20] block/dirty-bitmap: remove assertion from restore, Eric Blake, 2019/01/14
- [Qemu-devel] [PULL 06/20] iotests: add filter_generated_node_ids, Eric Blake, 2019/01/14
- [Qemu-devel] [PULL 05/20] iotests.py: don't abort if IMGKEYSECRET is undefined, Eric Blake, 2019/01/14
- [Qemu-devel] [PULL 04/20] block: remove 'x' prefix from experimental bitmap APIs, Eric Blake, 2019/01/14
- [Qemu-devel] [PULL 03/20] blockdev: n-ary bitmap merge, Eric Blake, 2019/01/14
- [Qemu-devel] [PULL 10/20] iotests: implement pretty-print for log and qmp_log, Eric Blake, 2019/01/14
- [Qemu-devel] [PULL 09/20] iotests: change qmp_log filters to expect QMP objects only, Eric Blake, 2019/01/14
- [Qemu-devel] [PULL 08/20] iotests: remove default filters from qmp_log, Eric Blake, 2019/01/14
- [Qemu-devel] [PULL 07/20] iotests: add qmp recursive sorting function, Eric Blake, 2019/01/14
- [Qemu-devel] [PULL 12/20] qemu-nbd: Rename 'exp' variable clashing with math::exp() symbol,
Eric Blake <=
- [Qemu-devel] [PULL 11/20] iotests: add iotest 236 for testing bitmap merge, Eric Blake, 2019/01/14
- [Qemu-devel] [PULL 13/20] nbd: Add some error case testing to iotests 223, Eric Blake, 2019/01/14
- [Qemu-devel] [PULL 14/20] nbd: Forbid nbd-server-stop when server is not running, Eric Blake, 2019/01/14
- [Qemu-devel] [PULL 15/20] nbd: Only require disabled bitmap for read-only exports, Eric Blake, 2019/01/14
- [Qemu-devel] [PULL 16/20] nbd: Merge nbd_export_set_name into nbd_export_new, Eric Blake, 2019/01/14
- [Qemu-devel] [PULL 18/20] nbd: Remove x-nbd-server-add-bitmap, Eric Blake, 2019/01/14