aboutsummaryrefslogtreecommitdiff
path: root/nbd
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2017-07-07 18:29:14 +0300
committerEric Blake <eblake@redhat.com>2017-07-10 09:57:24 -0500
commit458d7a693948130bc823d2f90fce659353a04eb6 (patch)
tree636f195134fdbb95b3f62da8bfc7face39a7eb56 /nbd
parent3e6bb543c208cb1f184c0f3d52e5f4e77e1e8957 (diff)
downloadqemu-458d7a693948130bc823d2f90fce659353a04eb6.zip
qemu-458d7a693948130bc823d2f90fce659353a04eb6.tar.gz
qemu-458d7a693948130bc823d2f90fce659353a04eb6.tar.bz2
nbd/client: refactor TRACE of NBD_MAGIC
We are going to switch from TRACE macro to trace points, this TRACE complicates things, this patch simplifies it. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20170707152918.23086-7-vsementsov@virtuozzo.com> Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'nbd')
-rw-r--r--nbd/client.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/nbd/client.c b/nbd/client.c
index b97143f..2125321 100644
--- a/nbd/client.c
+++ b/nbd/client.c
@@ -461,15 +461,8 @@ int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint16_t *flags,
goto fail;
}
- TRACE("Magic is %c%c%c%c%c%c%c%c",
- qemu_isprint(buf[0]) ? buf[0] : '.',
- qemu_isprint(buf[1]) ? buf[1] : '.',
- qemu_isprint(buf[2]) ? buf[2] : '.',
- qemu_isprint(buf[3]) ? buf[3] : '.',
- qemu_isprint(buf[4]) ? buf[4] : '.',
- qemu_isprint(buf[5]) ? buf[5] : '.',
- qemu_isprint(buf[6]) ? buf[6] : '.',
- qemu_isprint(buf[7]) ? buf[7] : '.');
+ magic = ldq_be_p(buf);
+ TRACE("Magic is 0x%" PRIx64, magic);
if (memcmp(buf, "NBDMAGIC", 8) != 0) {
error_setg(errp, "Invalid magic received");