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>
This commit is contained in:
parent
3e6bb543c2
commit
458d7a6939
11
nbd/client.c
11
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");
|
||||
|
Loading…
Reference in New Issue
Block a user