[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/30] nbd: simplify the nbd_request and nbd_reply st
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 11/30] nbd: simplify the nbd_request and nbd_reply structs |
Date: |
Thu, 16 Jun 2016 16:16:06 +0200 |
These structs are never used to represent the bytes that go over the
network. The big-endian network data is built into a uint8_t array
in nbd_{receive,send}_{request,reply}. Remove the unused magic field,
reorder the struct to avoid holes, and remove the packed attribute.
Signed-off-by: Paolo Bonzini <address@hidden>
---
include/block/nbd.h | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/include/block/nbd.h b/include/block/nbd.h
index b86a976..747bb0a 100644
--- a/include/block/nbd.h
+++ b/include/block/nbd.h
@@ -25,19 +25,20 @@
#include "io/channel-socket.h"
#include "crypto/tlscreds.h"
+/* Note: these are _NOT_ the same as the network representation of an NBD
+ * request and reply!
+ */
struct nbd_request {
- uint32_t magic;
- uint32_t type;
uint64_t handle;
uint64_t from;
uint32_t len;
-} QEMU_PACKED;
+ uint32_t type;
+};
struct nbd_reply {
- uint32_t magic;
- uint32_t error;
uint64_t handle;
-} QEMU_PACKED;
+ uint32_t error;
+};
#define NBD_FLAG_HAS_FLAGS (1 << 0) /* Flags are there */
#define NBD_FLAG_READ_ONLY (1 << 1) /* Device is read-only */
--
2.5.5
- [Qemu-devel] [PULL 02/30] os-posix: include sys/mman.h, (continued)
- [Qemu-devel] [PULL 02/30] os-posix: include sys/mman.h, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 05/30] Makefile: Fix tag file generation targets, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 08/30] configure: Remove unused CONFIG_SIGEV_THREAD_ID switch, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 09/30] nbd: Don't use *_to_cpup() functions, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 03/30] clean-includes: run it once more, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 10/30] nbd: Don't use cpu_to_*w() functions, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 06/30] Make avx2 configure test work with -O2, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 12/30] target-i386: kvm: cache KVM_GET_SUPPORTED_CPUID data, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 14/30] linux-headers: update to Linux 4.6, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 13/30] scsi-disk: Use (unsigned long) typecasts when using "%lu" format string, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 11/30] nbd: simplify the nbd_request and nbd_reply structs,
Paolo Bonzini <=
- [Qemu-devel] [PULL 16/30] vl.c: Add '-L help' which lists data dirs., Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 15/30] KVM: use KVM_CAP_MAX_VCPU_ID, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 17/30] nbd: Use BDRV_REQ_FUA for better FUA where supported, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 21/30] nbd: Reject unknown request flags, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 20/30] nbd: Improve server handling of bogus commands, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 18/30] nbd: More debug typo fixes, use correct formats, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 19/30] nbd: Quit server after any write error, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 23/30] nbd: Clean up ioctl handling of qemu-nbd -c, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 22/30] nbd: Group all Linux-specific ioctl code in one place, Paolo Bonzini, 2016/06/16
- [Qemu-devel] [PULL 26/30] scsi: esp: check buffer length before reading scsi command, Paolo Bonzini, 2016/06/16