qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL v2 00/29] KVM, build, NBD, SCSI patches for 2016-06-16
@ 2016-06-16 16:55 Paolo Bonzini
  2016-06-16 16:55 ` [Qemu-devel] [PULL 02/29] os-posix: include sys/mman.h Paolo Bonzini
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Paolo Bonzini @ 2016-06-16 16:55 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit dc278c58fa02e5fb796dbacf02c8dde32f697015:

  Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2016-06-16 15:22:56 +0100)

are available in the git repository at:

  git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 573c0caee76fc14f4557d2146f0c9ae67be658c4:

  vl: smp_parse: cleanups (2016-06-16 18:33:04 +0200)

v1->v2: rebase, rerun clean-includes, drop Greg's patch, fix PRIx16

----------------------------------------------------------------
* KVM startup speedup (Chao Peng)
* configure fixes and cleanups (David, Thomas)
* ctags fix (Sergey)
* NBD cleanups (Peter, Eric)
* "-L help" command line option (Richard)
* More esp.c bugfixes (me, Prasad)
* KVM_CAP_MAX_VCPU_ID support (Greg)

----------------------------------------------------------------
Andrew Jones (1):
      vl: smp_parse: cleanups

Chao Peng (1):
      target-i386: kvm: cache KVM_GET_SUPPORTED_CPUID data

Dr. David Alan Gilbert (2):
      Make avx2 configure test work with -O2
      avx2 configure: Use primitives in test

Eric Blake (9):
      nbd: Use BDRV_REQ_FUA for better FUA where supported
      nbd: More debug typo fixes, use correct formats
      nbd: Quit server after any write error
      nbd: Improve server handling of bogus commands
      nbd: Reject unknown request flags
      nbd: Group all Linux-specific ioctl code in one place
      nbd: Clean up ioctl handling of qemu-nbd -c
      nbd: Detect servers that send unexpected error values
      nbd: Avoid magic number for NBD max name size

Greg Kurz (1):
      KVM: use KVM_CAP_MAX_VCPU_ID

Paolo Bonzini (5):
      os-posix: include sys/mman.h
      clean-includes: run it once more
      nbd: simplify the nbd_request and nbd_reply structs
      scsi: esp: respect FIFO invariant after message phase
      scsi: esp: clean up handle_ti/esp_do_dma if s->do_cmd

Peter Maydell (2):
      nbd: Don't use *_to_cpup() functions
      nbd: Don't use cpu_to_*w() functions

Prasad J Pandit (2):
      scsi: esp: check buffer length before reading scsi command
      scsi: esp: make cmdbuf big enough for maximum CDB size

Richard W.M. Jones (1):
      vl.c: Add '-L help' which lists data dirs.

Sergey Fedorov (1):
      Makefile: Fix tag file generation targets

Thomas Huth (4):
      configure: Remove unused CONFIG_ZERO_MALLOC setting
      configure: Enable -Werror for MinGW builds, too
      configure: Remove unused CONFIG_SIGEV_THREAD_ID switch
      scsi-disk: Use (unsigned long) typecasts when using "%lu" format string

 Makefile                                |   4 +-
 audio/ossaudio.c                        |   1 -
 block/qcow2-cache.c                     |   5 -
 bsd-user/elfload.c                      |   1 -
 bsd-user/main.c                         |   1 -
 bsd-user/mmap.c                         |   1 -
 bsd-user/syscall.c                      |   1 -
 configure                               |  57 +++-------
 contrib/ivshmem-server/ivshmem-server.c |   1 -
 exec.c                                  |   1 -
 hw/block/xen_disk.c                     |   1 -
 hw/char/xen_console.c                   |   1 -
 hw/display/xenfb.c                      |   1 -
 hw/i386/kvm/pci-assign.c                |   1 -
 hw/misc/ivshmem.c                       |   2 -
 hw/misc/pc-testdev.c                    |   3 -
 hw/net/net_tx_pkt.c                     |   1 +
 hw/net/net_tx_pkt.h                     |   1 -
 hw/net/xen_nic.c                        |   1 -
 hw/scsi/esp.c                           |  22 ++--
 hw/scsi/scsi-disk.c                     |   8 +-
 hw/usb/xen-usb.c                        |   1 -
 hw/vfio/common.c                        |   1 -
 hw/vfio/pci.c                           |   1 -
 hw/virtio/virtio-balloon.c              |   4 -
 hw/xen/xen_backend.c                    |   1 -
 hw/xen/xen_pt_msi.c                     |   1 -
 include/block/nbd.h                     |  19 +++-
 include/hw/scsi/esp.h                   |   3 +-
 include/qemu/osdep.h                    |   2 -
 include/qemu/qdist.h                    |   1 -
 include/qemu/qht.h                      |   1 -
 include/sysemu/os-posix.h               |   1 +
 kvm-all.c                               |   9 +-
 linux-user/elfload.c                    |   1 -
 linux-user/flatload.c                   |   1 -
 linux-user/main.c                       |   1 -
 linux-user/mmap.c                       |   1 -
 linux-user/strace.c                     |   1 -
 linux-user/syscall.c                    |   1 -
 migration/postcopy-ram.c                |   1 -
 nbd/client.c                            |  98 ++++++++++------
 nbd/server.c                            | 191 +++++++++++++++++++-------------
 net/netmap.c                            |   1 -
 os-posix.c                              |   1 -
 qemu-char.c                             |   1 -
 qemu-nbd.c                              |   4 +-
 qemu-options.hx                         |   2 +
 scripts/clean-includes                  |   3 +
 target-arm/kvm.c                        |   1 -
 target-arm/kvm32.c                      |   1 -
 target-arm/kvm64.c                      |   1 -
 target-i386/kvm.c                       |  10 +-
 target-mips/kvm.c                       |   1 -
 target-ppc/kvm.c                        |   1 -
 target-s390x/kvm.c                      |   1 -
 tests/e1000e-test.c                     |   1 -
 tests/i440fx-test.c                     |   1 -
 tests/ivshmem-test.c                    |   1 -
 tests/postcopy-test.c                   |   2 -
 tests/qht-bench.c                       |   1 -
 tests/test-qdist.c                      |   1 -
 tests/test-qht-par.c                    |   1 -
 tests/test-qht.c                        |   1 -
 tests/vhost-user-bridge.c               |   1 -
 tests/vhost-user-test.c                 |   1 -
 translate-all.c                         |   2 -
 util/cutils.c                           |   8 +-
 util/memfd.c                            |   2 -
 util/mmap-alloc.c                       |   1 -
 util/osdep.c                            |   4 -
 util/oslib-posix.c                      |   1 -
 util/qdist.c                            |   1 +
 util/qht.c                              |   1 +
 vl.c                                    |  47 ++++----
 xen-hvm.c                               |   1 -
 xen-mapcache.c                          |   1 -
 77 files changed, 273 insertions(+), 291 deletions(-)
-- 
2.5.5

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PULL 02/29] os-posix: include sys/mman.h
  2016-06-16 16:55 [Qemu-devel] [PULL v2 00/29] KVM, build, NBD, SCSI patches for 2016-06-16 Paolo Bonzini
@ 2016-06-16 16:55 ` Paolo Bonzini
  2016-06-16 16:55 ` [Qemu-devel] [PULL 03/29] clean-includes: run it once more Paolo Bonzini
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2016-06-16 16:55 UTC (permalink / raw)
  To: qemu-devel

qemu/osdep.h checks whether MAP_ANONYMOUS is defined, but this check
is bogus without a previous inclusion of sys/mman.h.  Include it in
sysemu/os-posix.h and remove it from everywhere else.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 audio/ossaudio.c                        | 1 -
 block/qcow2-cache.c                     | 5 -----
 bsd-user/elfload.c                      | 1 -
 bsd-user/main.c                         | 1 -
 bsd-user/mmap.c                         | 1 -
 bsd-user/syscall.c                      | 1 -
 contrib/ivshmem-server/ivshmem-server.c | 1 -
 exec.c                                  | 1 -
 hw/block/xen_disk.c                     | 1 -
 hw/char/xen_console.c                   | 1 -
 hw/display/xenfb.c                      | 1 -
 hw/i386/kvm/pci-assign.c                | 1 -
 hw/misc/ivshmem.c                       | 2 --
 hw/misc/pc-testdev.c                    | 3 ---
 hw/net/xen_nic.c                        | 1 -
 hw/usb/xen-usb.c                        | 1 -
 hw/vfio/common.c                        | 1 -
 hw/vfio/pci.c                           | 1 -
 hw/virtio/virtio-balloon.c              | 4 ----
 hw/xen/xen_backend.c                    | 1 -
 hw/xen/xen_pt_msi.c                     | 1 -
 include/qemu/osdep.h                    | 2 --
 include/sysemu/os-posix.h               | 1 +
 kvm-all.c                               | 1 -
 linux-user/elfload.c                    | 1 -
 linux-user/flatload.c                   | 1 -
 linux-user/main.c                       | 1 -
 linux-user/mmap.c                       | 1 -
 linux-user/strace.c                     | 1 -
 linux-user/syscall.c                    | 1 -
 migration/postcopy-ram.c                | 1 -
 net/netmap.c                            | 1 -
 os-posix.c                              | 1 -
 qemu-char.c                             | 1 -
 scripts/clean-includes                  | 3 +++
 target-arm/kvm.c                        | 1 -
 target-arm/kvm32.c                      | 1 -
 target-arm/kvm64.c                      | 1 -
 target-i386/kvm.c                       | 1 -
 target-mips/kvm.c                       | 1 -
 target-ppc/kvm.c                        | 1 -
 target-s390x/kvm.c                      | 1 -
 tests/i440fx-test.c                     | 1 -
 tests/ivshmem-test.c                    | 1 -
 tests/postcopy-test.c                   | 1 -
 tests/vhost-user-bridge.c               | 1 -
 tests/vhost-user-test.c                 | 1 -
 translate-all.c                         | 2 --
 util/memfd.c                            | 2 --
 util/mmap-alloc.c                       | 1 -
 util/osdep.c                            | 4 ----
 util/oslib-posix.c                      | 1 -
 xen-hvm.c                               | 1 -
 xen-mapcache.c                          | 1 -
 54 files changed, 4 insertions(+), 68 deletions(-)

diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index a0d9cda..0edd7ea 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -22,7 +22,6 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include <sys/mman.h>
 #include <sys/ioctl.h>
 #include <sys/soundcard.h>
 #include "qemu-common.h"
diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c
index 208a060..580631c 100644
--- a/block/qcow2-cache.c
+++ b/block/qcow2-cache.c
@@ -24,11 +24,6 @@
 
 /* Needed for CONFIG_MADVISE */
 #include "qemu/osdep.h"
-
-#if defined(CONFIG_MADVISE) || defined(CONFIG_POSIX_MADVISE)
-#include <sys/mman.h>
-#endif
-
 #include "block/block_int.h"
 #include "qemu-common.h"
 #include "qcow2.h"
diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
index 898ee05..41a1309 100644
--- a/bsd-user/elfload.c
+++ b/bsd-user/elfload.c
@@ -1,7 +1,6 @@
 /* This is the Linux kernel elf-loading code, ported into user space */
 
 #include "qemu/osdep.h"
-#include <sys/mman.h>
 
 #include "qemu.h"
 #include "disas/disas.h"
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 9f592be..abe9a26 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -18,7 +18,6 @@
  */
 #include "qemu/osdep.h"
 #include <machine/trap.h>
-#include <sys/mman.h>
 
 #include "qemu.h"
 #include "qemu/path.h"
diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c
index 6ab5334..610f91b 100644
--- a/bsd-user/mmap.c
+++ b/bsd-user/mmap.c
@@ -17,7 +17,6 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
-#include <sys/mman.h>
 
 #include "qemu.h"
 #include "qemu-common.h"
diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c
index 47cf865..a9fe869 100644
--- a/bsd-user/syscall.c
+++ b/bsd-user/syscall.c
@@ -19,7 +19,6 @@
 #include "qemu/osdep.h"
 #include "qemu/cutils.h"
 #include "qemu/path.h"
-#include <sys/mman.h>
 #include <sys/syscall.h>
 #include <sys/param.h>
 #include <sys/sysctl.h>
diff --git a/contrib/ivshmem-server/ivshmem-server.c b/contrib/ivshmem-server/ivshmem-server.c
index bf4ee0b..e2f295b 100644
--- a/contrib/ivshmem-server/ivshmem-server.c
+++ b/contrib/ivshmem-server/ivshmem-server.c
@@ -10,7 +10,6 @@
 #include "qemu/host-utils.h"
 #include "qemu/sockets.h"
 
-#include <sys/mman.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 
diff --git a/exec.c b/exec.c
index 4f3818c..0122ef7 100644
--- a/exec.c
+++ b/exec.c
@@ -19,7 +19,6 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #ifndef _WIN32
-#include <sys/mman.h>
 #endif
 
 #include "qemu/cutils.h"
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index cf57814..90aca73 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -21,7 +21,6 @@
 
 #include "qemu/osdep.h"
 #include <sys/ioctl.h>
-#include <sys/mman.h>
 #include <sys/uio.h>
 
 #include "hw/hw.h"
diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
index cbf1dcc..83108b0 100644
--- a/hw/char/xen_console.c
+++ b/hw/char/xen_console.c
@@ -22,7 +22,6 @@
 #include "qemu/osdep.h"
 #include <sys/select.h>
 #include <termios.h>
-#include <sys/mman.h>
 
 #include "hw/hw.h"
 #include "sysemu/char.h"
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 570b097..46b7d5e 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -25,7 +25,6 @@
  */
 
 #include "qemu/osdep.h"
-#include <sys/mman.h>
 
 #include "hw/hw.h"
 #include "ui/console.h"
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index db2cbd2..dd9e73b 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -22,7 +22,6 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include <sys/mman.h>
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
 #include "qemu/error-report.h"
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 90be9f7..c4dde3a 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -36,8 +36,6 @@
 
 #include "hw/misc/ivshmem.h"
 
-#include <sys/mman.h>
-
 #define PCI_VENDOR_ID_IVSHMEM   PCI_VENDOR_ID_REDHAT_QUMRANET
 #define PCI_DEVICE_ID_IVSHMEM   0x1110
 
diff --git a/hw/misc/pc-testdev.c b/hw/misc/pc-testdev.c
index 086893d..b81d820 100644
--- a/hw/misc/pc-testdev.c
+++ b/hw/misc/pc-testdev.c
@@ -36,9 +36,6 @@
 */
 
 #include "qemu/osdep.h"
-#if defined(CONFIG_POSIX)
-#include <sys/mman.h>
-#endif
 #include "hw/hw.h"
 #include "hw/qdev.h"
 #include "hw/isa/isa.h"
diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c
index 7281730..0b4ddae 100644
--- a/hw/net/xen_nic.c
+++ b/hw/net/xen_nic.c
@@ -22,7 +22,6 @@
 #include "qemu/osdep.h"
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/mman.h>
 #include <sys/wait.h>
 
 #include "hw/hw.h"
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index 8fa47ed..0fd34c6 100644
--- a/hw/usb/xen-usb.c
+++ b/hw/usb/xen-usb.c
@@ -21,7 +21,6 @@
 
 #include "qemu/osdep.h"
 #include <libusb.h>
-#include <sys/mman.h>
 
 #include "qemu-common.h"
 #include "qemu/config-file.h"
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index e51ed3a..5ff5e92 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -20,7 +20,6 @@
 
 #include "qemu/osdep.h"
 #include <sys/ioctl.h>
-#include <sys/mman.h>
 #include <linux/vfio.h>
 
 #include "hw/vfio/vfio-common.h"
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index deab0c6..53b87b7 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -21,7 +21,6 @@
 #include "qemu/osdep.h"
 #include <linux/vfio.h>
 #include <sys/ioctl.h>
-#include <sys/mman.h>
 
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 8c15e09..557d3f9 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -27,10 +27,6 @@
 #include "qapi-event.h"
 #include "trace.h"
 
-#if defined(__linux__)
-#include <sys/mman.h>
-#endif
-
 #include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-access.h"
 
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index c63f9df..e7ce724 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -23,7 +23,6 @@
  */
 
 #include "qemu/osdep.h"
-#include <sys/mman.h>
 #include <sys/signal.h>
 
 #include "hw/hw.h"
diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/xen_pt_msi.c
index 9a16f2b..62add06 100644
--- a/hw/xen/xen_pt_msi.c
+++ b/hw/xen/xen_pt_msi.c
@@ -10,7 +10,6 @@
  */
 
 #include "qemu/osdep.h"
-#include <sys/mman.h>
 
 #include "hw/xen/xen_backend.h"
 #include "xen_pt.h"
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 6937694..e63da28 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -197,8 +197,6 @@ void qemu_anon_ram_free(void *ptr, size_t size);
 
 #if defined(CONFIG_MADVISE)
 
-#include <sys/mman.h>
-
 #define QEMU_MADV_WILLNEED  MADV_WILLNEED
 #define QEMU_MADV_DONTNEED  MADV_DONTNEED
 #ifdef MADV_DONTFORK
diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h
index 07e3e5a..9c7dfdf 100644
--- a/include/sysemu/os-posix.h
+++ b/include/sysemu/os-posix.h
@@ -26,6 +26,7 @@
 #ifndef QEMU_OS_POSIX_H
 #define QEMU_OS_POSIX_H
 
+#include <sys/mman.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
diff --git a/kvm-all.c b/kvm-all.c
index fbd2d93..71af270 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -15,7 +15,6 @@
 
 #include "qemu/osdep.h"
 #include <sys/ioctl.h>
-#include <sys/mman.h>
 
 #include <linux/kvm.h>
 
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index bb2558f..f807baf 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -2,7 +2,6 @@
 #include "qemu/osdep.h"
 #include <sys/param.h>
 
-#include <sys/mman.h>
 #include <sys/resource.h>
 
 #include "qemu.h"
diff --git a/linux-user/flatload.c b/linux-user/flatload.c
index f9139c3..48ad1c5 100644
--- a/linux-user/flatload.c
+++ b/linux-user/flatload.c
@@ -34,7 +34,6 @@
 /****************************************************************************/
 
 #include "qemu/osdep.h"
-#include <sys/mman.h>
 
 #include "qemu.h"
 #include "flat.h"
diff --git a/linux-user/main.c b/linux-user/main.c
index f8a8764..b9a4e0e 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -18,7 +18,6 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-version.h"
-#include <sys/mman.h>
 #include <sys/syscall.h>
 #include <sys/resource.h>
 
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 3519147..c4371d9 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -17,7 +17,6 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
-#include <sys/mman.h>
 #include <linux/mman.h>
 #include <linux/unistd.h>
 
diff --git a/linux-user/strace.c b/linux-user/strace.c
index c5980a1..4046b81 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -5,7 +5,6 @@
 #include <sys/shm.h>
 #include <sys/select.h>
 #include <sys/mount.h>
-#include <sys/mman.h>
 #include <sched.h>
 #include "qemu.h"
 
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 71ccbd9..1c17b74 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -32,7 +32,6 @@
 #include <sys/personality.h>
 #include <sys/prctl.h>
 #include <sys/resource.h>
-#include <sys/mman.h>
 #include <sys/swap.h>
 #include <linux/capability.h>
 #include <sched.h>
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index 47250b6..abe8c60 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -51,7 +51,6 @@ struct PostcopyDiscardState {
 #if defined(__linux__)
 
 #include <poll.h>
-#include <sys/mman.h>
 #include <sys/ioctl.h>
 #include <sys/syscall.h>
 #include <asm/types.h> /* for __u64 */
diff --git a/net/netmap.c b/net/netmap.c
index 6cc0db5..64967b9 100644
--- a/net/netmap.c
+++ b/net/netmap.c
@@ -26,7 +26,6 @@
 #include "qemu/osdep.h"
 #include <sys/ioctl.h>
 #include <net/if.h>
-#include <sys/mman.h>
 #define NETMAP_WITH_LIBS
 #include <net/netmap.h>
 #include <net/netmap_user.h>
diff --git a/os-posix.c b/os-posix.c
index 107fde3..3755265 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -26,7 +26,6 @@
 #include "qemu/osdep.h"
 #include <sys/wait.h>
 /*needed for MAP_POPULATE before including qemu-options.h */
-#include <sys/mman.h>
 #include <pwd.h>
 #include <grp.h>
 #include <libgen.h>
diff --git a/qemu-char.c b/qemu-char.c
index b13ecbb..c926e9a 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -47,7 +47,6 @@
 #include <sys/times.h>
 #include <sys/wait.h>
 #include <termios.h>
-#include <sys/mman.h>
 #include <sys/ioctl.h>
 #include <sys/resource.h>
 #include <sys/socket.h>
diff --git a/scripts/clean-includes b/scripts/clean-includes
index 37b73b5..4412a55 100755
--- a/scripts/clean-includes
+++ b/scripts/clean-includes
@@ -105,6 +105,8 @@ for f in "$@"; do
     *include/qemu/osdep.h | \
     *include/qemu/compiler.h | \
     *include/glib-compat.h | \
+    *include/sysemu/os-posix.h | \
+    *include/sysemu/os-win32.h | \
     *include/standard-headers/ )
       # Removing include lines from osdep.h itself would be counterproductive.
       echo "SKIPPING $f (special case header)"
@@ -145,6 +147,7 @@ for f in "$@"; do
            <stdlib.h> <stdio.h> <string.h> <strings.h> <inttypes.h>
            <limits.h> <unistd.h> <time.h> <ctype.h> <errno.h> <fcntl.h>
            <sys/stat.h> <sys/time.h> <assert.h> <signal.h> <glib.h>
+           <sys/stat.h> <sys/time.h> <assert.h> <signal.h> <glib.h> <sys/mman.h>
            "sysemu/os-posix.h, sysemu/os-win32.h "glib-compat.h"
            "qemu/typedefs.h"
             ))' "$f"
diff --git a/target-arm/kvm.c b/target-arm/kvm.c
index 83da447..5c2bd7a 100644
--- a/target-arm/kvm.c
+++ b/target-arm/kvm.c
@@ -10,7 +10,6 @@
 
 #include "qemu/osdep.h"
 #include <sys/ioctl.h>
-#include <sys/mman.h>
 
 #include <linux/kvm.h>
 
diff --git a/target-arm/kvm32.c b/target-arm/kvm32.c
index c35c676..069da0c 100644
--- a/target-arm/kvm32.c
+++ b/target-arm/kvm32.c
@@ -10,7 +10,6 @@
 
 #include "qemu/osdep.h"
 #include <sys/ioctl.h>
-#include <sys/mman.h>
 
 #include <linux/kvm.h>
 
diff --git a/target-arm/kvm64.c b/target-arm/kvm64.c
index 2d6a310..5faa76c 100644
--- a/target-arm/kvm64.c
+++ b/target-arm/kvm64.c
@@ -11,7 +11,6 @@
 
 #include "qemu/osdep.h"
 #include <sys/ioctl.h>
-#include <sys/mman.h>
 #include <sys/ptrace.h>
 
 #include <linux/elf.h>
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index abf50e6..7b092ee 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -15,7 +15,6 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include <sys/ioctl.h>
-#include <sys/mman.h>
 #include <sys/utsname.h>
 
 #include <linux/kvm.h>
diff --git a/target-mips/kvm.c b/target-mips/kvm.c
index a854e4d..f3f832d 100644
--- a/target-mips/kvm.c
+++ b/target-mips/kvm.c
@@ -11,7 +11,6 @@
 
 #include "qemu/osdep.h"
 #include <sys/ioctl.h>
-#include <sys/mman.h>
 
 #include <linux/kvm.h>
 
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index 6c15361..1620864 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -17,7 +17,6 @@
 #include "qemu/osdep.h"
 #include <dirent.h>
 #include <sys/ioctl.h>
-#include <sys/mman.h>
 #include <sys/vfs.h>
 
 #include <linux/kvm.h>
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index f108cd3..45e94ca 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -23,7 +23,6 @@
 
 #include "qemu/osdep.h"
 #include <sys/ioctl.h>
-#include <sys/mman.h>
 
 #include <linux/kvm.h>
 #include <asm/ptrace.h>
diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c
index bff999c..c1d9b3e 100644
--- a/tests/i440fx-test.c
+++ b/tests/i440fx-test.c
@@ -13,7 +13,6 @@
  */
 
 #include "qemu/osdep.h"
-#include <sys/mman.h>
 
 #include "libqtest.h"
 #include "libqos/pci.h"
diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c
index 010860a..0957ee7 100644
--- a/tests/ivshmem-test.c
+++ b/tests/ivshmem-test.c
@@ -10,7 +10,6 @@
 
 #include "qemu/osdep.h"
 #include <glib/gstdio.h>
-#include <sys/mman.h>
 #include "contrib/ivshmem-server/ivshmem-server.h"
 #include "libqos/pci-pc.h"
 #include "libqtest.h"
diff --git a/tests/postcopy-test.c b/tests/postcopy-test.c
index 9ff88ee..a35efb3 100644
--- a/tests/postcopy-test.c
+++ b/tests/postcopy-test.c
@@ -26,7 +26,6 @@ const unsigned end_address = 100 * 1024 * 1024;
 bool got_stop;
 
 #if defined(__linux__)
-#include <sys/mman.h>
 #include <sys/syscall.h>
 #include <sys/vfs.h>
 #endif
diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c
index 0779ba2..57c8f91 100644
--- a/tests/vhost-user-bridge.c
+++ b/tests/vhost-user-bridge.c
@@ -33,7 +33,6 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/unistd.h>
-#include <sys/mman.h>
 #include <sys/eventfd.h>
 #include <arpa/inet.h>
 #include <netdb.h>
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 2724fe9..b2b1665 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -17,7 +17,6 @@
 #include "sysemu/sysemu.h"
 
 #include <linux/vhost.h>
-#include <sys/mman.h>
 #include <sys/vfs.h>
 #include <qemu/sockets.h>
 
diff --git a/translate-all.c b/translate-all.c
index e8b88b4..3f402df 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -18,8 +18,6 @@
  */
 #ifdef _WIN32
 #include <windows.h>
-#else
-#include <sys/mman.h>
 #endif
 #include "qemu/osdep.h"
 
diff --git a/util/memfd.c b/util/memfd.c
index b374238..4571d1a 100644
--- a/util/memfd.c
+++ b/util/memfd.c
@@ -29,8 +29,6 @@
 
 #include <glib/gprintf.h>
 
-#include <sys/mman.h>
-
 #include "qemu/memfd.h"
 
 #ifdef CONFIG_MEMFD
diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
index 0b4cc7f..629d97a 100644
--- a/util/mmap-alloc.c
+++ b/util/mmap-alloc.c
@@ -11,7 +11,6 @@
  */
 #include "qemu/osdep.h"
 #include <qemu/mmap-alloc.h>
-#include <sys/mman.h>
 
 #define HUGETLBFS_MAGIC       0x958458f6
 
diff --git a/util/osdep.c b/util/osdep.c
index 9a7a439..ff004e8 100644
--- a/util/osdep.c
+++ b/util/osdep.c
@@ -25,10 +25,6 @@
 
 /* Needed early for CONFIG_BSD etc. */
 
-#if defined(CONFIG_MADVISE) || defined(CONFIG_POSIX_MADVISE)
-#include <sys/mman.h>
-#endif
-
 #ifdef CONFIG_SOLARIS
 #include <sys/statvfs.h>
 /* See MySQL bug #7156 (http://bugs.mysql.com/bug.php?id=7156) for
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 4adde93..e2e1d4d 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -36,7 +36,6 @@
 #include "trace.h"
 #include "qapi/error.h"
 #include "qemu/sockets.h"
-#include <sys/mman.h>
 #include <libgen.h>
 #include <sys/signal.h>
 #include "qemu/cutils.h"
diff --git a/xen-hvm.c b/xen-hvm.c
index a0da8d7..98ea44f 100644
--- a/xen-hvm.c
+++ b/xen-hvm.c
@@ -9,7 +9,6 @@
  */
 
 #include "qemu/osdep.h"
-#include <sys/mman.h>
 
 #include "cpu.h"
 #include "hw/pci/pci.h"
diff --git a/xen-mapcache.c b/xen-mapcache.c
index 49f394a..8f3a592 100644
--- a/xen-mapcache.c
+++ b/xen-mapcache.c
@@ -17,7 +17,6 @@
 #include "qemu/bitmap.h"
 
 #include <xen/hvm/params.h>
-#include <sys/mman.h>
 
 #include "sysemu/xen-mapcache.h"
 #include "trace.h"
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PULL 03/29] clean-includes: run it once more
  2016-06-16 16:55 [Qemu-devel] [PULL v2 00/29] KVM, build, NBD, SCSI patches for 2016-06-16 Paolo Bonzini
  2016-06-16 16:55 ` [Qemu-devel] [PULL 02/29] os-posix: include sys/mman.h Paolo Bonzini
@ 2016-06-16 16:55 ` Paolo Bonzini
  2016-06-16 16:55 ` [Qemu-devel] [PULL 17/29] nbd: More debug typo fixes, use correct formats Paolo Bonzini
  2016-06-16 17:46 ` [Qemu-devel] [PULL v2 00/29] KVM, build, NBD, SCSI patches for 2016-06-16 Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2016-06-16 16:55 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/net/net_tx_pkt.c   | 1 +
 hw/net/net_tx_pkt.h   | 1 -
 include/qemu/qdist.h  | 1 -
 include/qemu/qht.h    | 1 -
 tests/e1000e-test.c   | 1 -
 tests/postcopy-test.c | 1 -
 tests/qht-bench.c     | 1 -
 tests/test-qdist.c    | 1 -
 tests/test-qht-par.c  | 1 -
 tests/test-qht.c      | 1 -
 util/qdist.c          | 1 +
 util/qht.c            | 1 +
 12 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c
index e4478be..efd43b4 100644
--- a/hw/net/net_tx_pkt.c
+++ b/hw/net/net_tx_pkt.c
@@ -15,6 +15,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "net_tx_pkt.h"
 #include "net/eth.h"
 #include "net/checksum.h"
diff --git a/hw/net/net_tx_pkt.h b/hw/net/net_tx_pkt.h
index 07b9a20..212ecc6 100644
--- a/hw/net/net_tx_pkt.h
+++ b/hw/net/net_tx_pkt.h
@@ -18,7 +18,6 @@
 #ifndef NET_TX_PKT_H
 #define NET_TX_PKT_H
 
-#include "qemu/osdep.h"
 #include "net/eth.h"
 #include "exec/hwaddr.h"
 
diff --git a/include/qemu/qdist.h b/include/qemu/qdist.h
index f30050c..54ece76 100644
--- a/include/qemu/qdist.h
+++ b/include/qemu/qdist.h
@@ -7,7 +7,6 @@
 #ifndef QEMU_QDIST_H
 #define QEMU_QDIST_H
 
-#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/bitops.h"
 
diff --git a/include/qemu/qht.h b/include/qemu/qht.h
index aec60aa..70bfc68 100644
--- a/include/qemu/qht.h
+++ b/include/qemu/qht.h
@@ -7,7 +7,6 @@
 #ifndef QEMU_QHT_H
 #define QEMU_QHT_H
 
-#include "qemu/osdep.h"
 #include "qemu/seqlock.h"
 #include "qemu/thread.h"
 #include "qemu/qdist.h"
diff --git a/tests/e1000e-test.c b/tests/e1000e-test.c
index dbf4859..d497b08 100644
--- a/tests/e1000e-test.c
+++ b/tests/e1000e-test.c
@@ -25,7 +25,6 @@
 
 
 #include "qemu/osdep.h"
-#include <glib.h>
 #include "libqtest.h"
 #include "qemu-common.h"
 #include "libqos/pci-pc.h"
diff --git a/tests/postcopy-test.c b/tests/postcopy-test.c
index a35efb3..35d5180 100644
--- a/tests/postcopy-test.c
+++ b/tests/postcopy-test.c
@@ -11,7 +11,6 @@
  */
 
 #include "qemu/osdep.h"
-#include <glib.h>
 
 #include "libqtest.h"
 #include "qemu/option.h"
diff --git a/tests/qht-bench.c b/tests/qht-bench.c
index ad8efbc..76360a0 100644
--- a/tests/qht-bench.c
+++ b/tests/qht-bench.c
@@ -5,7 +5,6 @@
  *   See the COPYING file in the top-level directory.
  */
 #include "qemu/osdep.h"
-#include <glib.h>
 #include "qemu/processor.h"
 #include "qemu/atomic.h"
 #include "qemu/qht.h"
diff --git a/tests/test-qdist.c b/tests/test-qdist.c
index a67f260..0298986 100644
--- a/tests/test-qdist.c
+++ b/tests/test-qdist.c
@@ -5,7 +5,6 @@
  *   See the COPYING file in the top-level directory.
  */
 #include "qemu/osdep.h"
-#include <glib.h>
 #include "qemu/qdist.h"
 
 #include <math.h>
diff --git a/tests/test-qht-par.c b/tests/test-qht-par.c
index f09e004..d8a83ca 100644
--- a/tests/test-qht-par.c
+++ b/tests/test-qht-par.c
@@ -5,7 +5,6 @@
  *   See the COPYING file in the top-level directory.
  */
 #include "qemu/osdep.h"
-#include <glib.h>
 
 #define TEST_QHT_STRING "tests/qht-bench 1>/dev/null 2>&1 -R -S0.1 -D10000 -N1 "
 
diff --git a/tests/test-qht.c b/tests/test-qht.c
index c8eb930..f1d6283 100644
--- a/tests/test-qht.c
+++ b/tests/test-qht.c
@@ -5,7 +5,6 @@
  *   See the COPYING file in the top-level directory.
  */
 #include "qemu/osdep.h"
-#include <glib.h>
 #include "qemu/qht.h"
 
 #define N 5000
diff --git a/util/qdist.c b/util/qdist.c
index 4ea2e34..56f5738 100644
--- a/util/qdist.c
+++ b/util/qdist.c
@@ -6,6 +6,7 @@
  * License: GNU GPL, version 2 or later.
  *   See the COPYING file in the top-level directory.
  */
+#include "qemu/osdep.h"
 #include "qemu/qdist.h"
 
 #include <math.h>
diff --git a/util/qht.c b/util/qht.c
index 6f74909..40d6e21 100644
--- a/util/qht.c
+++ b/util/qht.c
@@ -65,6 +65,7 @@
  *   + Corbet, "Relativistic hash tables, part 1: Algorithms", @ lwn.net, 2014.
  *     https://lwn.net/Articles/612021/
  */
+#include "qemu/osdep.h"
 #include "qemu/qht.h"
 #include "qemu/atomic.h"
 #include "qemu/rcu.h"
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PULL 17/29] nbd: More debug typo fixes, use correct formats
  2016-06-16 16:55 [Qemu-devel] [PULL v2 00/29] KVM, build, NBD, SCSI patches for 2016-06-16 Paolo Bonzini
  2016-06-16 16:55 ` [Qemu-devel] [PULL 02/29] os-posix: include sys/mman.h Paolo Bonzini
  2016-06-16 16:55 ` [Qemu-devel] [PULL 03/29] clean-includes: run it once more Paolo Bonzini
@ 2016-06-16 16:55 ` Paolo Bonzini
  2016-06-16 17:46 ` [Qemu-devel] [PULL v2 00/29] KVM, build, NBD, SCSI patches for 2016-06-16 Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2016-06-16 16:55 UTC (permalink / raw)
  To: qemu-devel

From: Eric Blake <eblake@redhat.com>

Clean up some debug message oddities missed earlier; this includes
some typos, and recognizing that %d is not necessarily compatible
with uint32_t. Also add a couple messages that I found useful
while debugging things.

Signed-off-by: Eric Blake <eblake@redhat.com>

Message-Id: <1463006384-7734-3-git-send-email-eblake@redhat.com>
[Do not use PRIx16, clang complains. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 nbd/client.c | 41 ++++++++++++++++++++++-------------------
 nbd/server.c | 48 +++++++++++++++++++++++++++---------------------
 2 files changed, 49 insertions(+), 40 deletions(-)

diff --git a/nbd/client.c b/nbd/client.c
index 6d9c74d..c08aa85 100644
--- a/nbd/client.c
+++ b/nbd/client.c
@@ -109,25 +109,27 @@ static int nbd_handle_reply_err(QIOChannel *ioc, uint32_t opt, uint32_t type,
 
     switch (type) {
     case NBD_REP_ERR_UNSUP:
-        TRACE("server doesn't understand request %d, attempting fallback",
-              opt);
+        TRACE("server doesn't understand request %" PRIx32
+              ", attempting fallback", opt);
         result = 0;
         goto cleanup;
 
     case NBD_REP_ERR_POLICY:
-        error_setg(errp, "Denied by server for option %x", opt);
+        error_setg(errp, "Denied by server for option %" PRIx32, opt);
         break;
 
     case NBD_REP_ERR_INVALID:
-        error_setg(errp, "Invalid data length for option %x", opt);
+        error_setg(errp, "Invalid data length for option %" PRIx32, opt);
         break;
 
     case NBD_REP_ERR_TLS_REQD:
-        error_setg(errp, "TLS negotiation required before option %x", opt);
+        error_setg(errp, "TLS negotiation required before option %" PRIx32,
+                   opt);
         break;
 
     default:
-        error_setg(errp, "Unknown error code when asking for option %x", opt);
+        error_setg(errp, "Unknown error code when asking for option %" PRIx32,
+                   opt);
         break;
     }
 
@@ -165,7 +167,7 @@ static int nbd_receive_list(QIOChannel *ioc, char **name, Error **errp)
     }
     opt = be32_to_cpu(opt);
     if (opt != NBD_OPT_LIST) {
-        error_setg(errp, "Unexpected option type %x expected %x",
+        error_setg(errp, "Unexpected option type %" PRIx32 " expected %x",
                    opt, NBD_OPT_LIST);
         return -1;
     }
@@ -207,7 +209,7 @@ static int nbd_receive_list(QIOChannel *ioc, char **name, Error **errp)
             return -1;
         }
         if (namelen > 255) {
-            error_setg(errp, "export name length too long %d", namelen);
+            error_setg(errp, "export name length too long %" PRIu32, namelen);
             return -1;
         }
 
@@ -234,7 +236,7 @@ static int nbd_receive_list(QIOChannel *ioc, char **name, Error **errp)
             g_free(buf);
         }
     } else {
-        error_setg(errp, "Unexpected reply type %x expected %x",
+        error_setg(errp, "Unexpected reply type %" PRIx32 " expected %x",
                    type, NBD_REP_SERVER);
         return -1;
     }
@@ -349,7 +351,7 @@ static QIOChannel *nbd_receive_starttls(QIOChannel *ioc,
     }
     opt = be32_to_cpu(opt);
     if (opt != NBD_OPT_STARTTLS) {
-        error_setg(errp, "Unexpected option type %x expected %x",
+        error_setg(errp, "Unexpected option type %" PRIx32 " expected %x",
                    opt, NBD_OPT_STARTTLS);
         return NULL;
     }
@@ -361,7 +363,7 @@ static QIOChannel *nbd_receive_starttls(QIOChannel *ioc,
     }
     type = be32_to_cpu(type);
     if (type != NBD_REP_ACK) {
-        error_setg(errp, "Server rejected request to start TLS %x",
+        error_setg(errp, "Server rejected request to start TLS %" PRIx32,
                    type);
         return NULL;
     }
@@ -373,7 +375,7 @@ static QIOChannel *nbd_receive_starttls(QIOChannel *ioc,
     }
     length = be32_to_cpu(length);
     if (length != 0) {
-        error_setg(errp, "Start TLS response was not zero %x",
+        error_setg(errp, "Start TLS response was not zero %" PRIu32,
                    length);
         return NULL;
     }
@@ -384,7 +386,7 @@ static QIOChannel *nbd_receive_starttls(QIOChannel *ioc,
         return NULL;
     }
     data.loop = g_main_loop_new(g_main_context_default(), FALSE);
-    TRACE("Starting TLS hanshake");
+    TRACE("Starting TLS handshake");
     qio_channel_tls_handshake(tioc,
                               nbd_tls_handshake,
                               &data,
@@ -474,7 +476,7 @@ int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint32_t *flags,
         }
         globalflags = be16_to_cpu(globalflags);
         *flags = globalflags << 16;
-        TRACE("Global flags are %x", globalflags);
+        TRACE("Global flags are %" PRIx32, globalflags);
         if (globalflags & NBD_FLAG_FIXED_NEWSTYLE) {
             fixedNewStyle = true;
             TRACE("Server supports fixed new style");
@@ -550,7 +552,7 @@ int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint32_t *flags,
         }
         exportflags = be16_to_cpu(exportflags);
         *flags |= exportflags;
-        TRACE("Export flags are %x", exportflags);
+        TRACE("Export flags are %" PRIx16, exportflags);
     } else if (magic == NBD_CLIENT_MAGIC) {
         if (name) {
             error_setg(errp, "Server does not support export names");
@@ -683,7 +685,8 @@ ssize_t nbd_send_request(QIOChannel *ioc, struct nbd_request *request)
     ssize_t ret;
 
     TRACE("Sending request to server: "
-          "{ .from = %" PRIu64", .len = %u, .handle = %" PRIu64", .type=%i}",
+          "{ .from = %" PRIu64", .len = %" PRIu32 ", .handle = %" PRIu64
+          ", .type=%" PRIu16 " }",
           request->from, request->len, request->handle, request->type);
 
     stl_be_p(buf, NBD_REQUEST_MAGIC);
@@ -732,12 +735,12 @@ ssize_t nbd_receive_reply(QIOChannel *ioc, struct nbd_reply *reply)
 
     reply->error = nbd_errno_to_system_errno(reply->error);
 
-    TRACE("Got reply: "
-          "{ magic = 0x%x, .error = %d, handle = %" PRIu64" }",
+    TRACE("Got reply: { magic = 0x%" PRIx32 ", .error = % " PRId32
+          ", handle = %" PRIu64" }",
           magic, reply->error, reply->handle);
 
     if (magic != NBD_REPLY_MAGIC) {
-        LOG("invalid magic (got 0x%x)", magic);
+        LOG("invalid magic (got 0x%" PRIx32 ")", magic);
         return -EINVAL;
     }
     return 0;
diff --git a/nbd/server.c b/nbd/server.c
index 7063edb..d95266d 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -196,7 +196,7 @@ static int nbd_negotiate_send_rep(QIOChannel *ioc, uint32_t type, uint32_t opt)
     uint64_t magic;
     uint32_t len;
 
-    TRACE("Reply opt=%x type=%x", type, opt);
+    TRACE("Reply opt=%" PRIx32 " type=%" PRIx32, type, opt);
 
     magic = cpu_to_be64(NBD_REP_MAGIC);
     if (nbd_negotiate_write(ioc, &magic, sizeof(magic)) != sizeof(magic)) {
@@ -226,7 +226,7 @@ static int nbd_negotiate_send_rep_list(QIOChannel *ioc, NBDExport *exp)
     uint64_t magic, name_len;
     uint32_t opt, type, len;
 
-    TRACE("Advertizing export name '%s'", exp->name ? exp->name : "");
+    TRACE("Advertising export name '%s'", exp->name ? exp->name : "");
     name_len = strlen(exp->name);
     magic = cpu_to_be64(NBD_REP_MAGIC);
     if (nbd_negotiate_write(ioc, &magic, sizeof(magic)) != sizeof(magic)) {
@@ -392,12 +392,12 @@ static int nbd_negotiate_options(NBDClient *client)
     TRACE("Checking client flags");
     be32_to_cpus(&flags);
     if (flags & NBD_FLAG_C_FIXED_NEWSTYLE) {
-        TRACE("Support supports fixed newstyle handshake");
+        TRACE("Client supports fixed newstyle handshake");
         fixedNewstyle = true;
         flags &= ~NBD_FLAG_C_FIXED_NEWSTYLE;
     }
     if (flags != 0) {
-        TRACE("Unknown client flags 0x%x received", flags);
+        TRACE("Unknown client flags 0x%" PRIx32 " received", flags);
         return -EIO;
     }
 
@@ -431,12 +431,12 @@ static int nbd_negotiate_options(NBDClient *client)
         }
         length = be32_to_cpu(length);
 
-        TRACE("Checking option 0x%x", clientflags);
+        TRACE("Checking option 0x%" PRIx32, clientflags);
         if (client->tlscreds &&
             client->ioc == (QIOChannel *)client->sioc) {
             QIOChannel *tioc;
             if (!fixedNewstyle) {
-                TRACE("Unsupported option 0x%x", clientflags);
+                TRACE("Unsupported option 0x%" PRIx32, clientflags);
                 return -EINVAL;
             }
             switch (clientflags) {
@@ -455,7 +455,8 @@ static int nbd_negotiate_options(NBDClient *client)
                 return -EINVAL;
 
             default:
-                TRACE("Option 0x%x not permitted before TLS", clientflags);
+                TRACE("Option 0x%" PRIx32 " not permitted before TLS",
+                      clientflags);
                 if (nbd_negotiate_drop_sync(client->ioc, length) != length) {
                     return -EIO;
                 }
@@ -493,7 +494,7 @@ static int nbd_negotiate_options(NBDClient *client)
                 }
                 break;
             default:
-                TRACE("Unsupported option 0x%x", clientflags);
+                TRACE("Unsupported option 0x%" PRIx32, clientflags);
                 if (nbd_negotiate_drop_sync(client->ioc, length) != length) {
                     return -EIO;
                 }
@@ -511,7 +512,7 @@ static int nbd_negotiate_options(NBDClient *client)
                 return nbd_negotiate_handle_export_name(client, length);
 
             default:
-                TRACE("Unsupported option 0x%x", clientflags);
+                TRACE("Unsupported option 0x%" PRIx32, clientflags);
                 return -EINVAL;
             }
         }
@@ -560,6 +561,8 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data)
     oldStyle = client->exp != NULL && !client->tlscreds;
     if (oldStyle) {
         assert ((client->exp->nbdflags & ~65535) == 0);
+        TRACE("advertising size %" PRIu64 " and flags %x",
+              client->exp->size, client->exp->nbdflags | myflags);
         stq_be_p(buf + 8, NBD_CLIENT_MAGIC);
         stq_be_p(buf + 16, client->exp->size);
         stw_be_p(buf + 26, client->exp->nbdflags | myflags);
@@ -589,6 +592,8 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data)
         }
 
         assert ((client->exp->nbdflags & ~65535) == 0);
+        TRACE("advertising size %" PRIu64 " and flags %x",
+              client->exp->size, client->exp->nbdflags | myflags);
         stq_be_p(buf + 18, client->exp->size);
         stw_be_p(buf + 26, client->exp->nbdflags | myflags);
         if (nbd_negotiate_write(client->ioc, buf + 18, sizeof(buf) - 18) !=
@@ -652,12 +657,12 @@ static ssize_t nbd_receive_request(QIOChannel *ioc, struct nbd_request *request)
     request->from   = ldq_be_p(buf + 16);
     request->len    = ldl_be_p(buf + 24);
 
-    TRACE("Got request: "
-          "{ magic = 0x%x, .type = %d, from = %" PRIu64" , len = %u }",
+    TRACE("Got request: { magic = 0x%" PRIx32 ", .type = %" PRIx32
+          ", from = %" PRIu64 " , len = %" PRIu32 " }",
           magic, request->type, request->from, request->len);
 
     if (magic != NBD_REQUEST_MAGIC) {
-        LOG("invalid magic (got 0x%x)", magic);
+        LOG("invalid magic (got 0x%" PRIx32 ")", magic);
         return -EINVAL;
     }
     return 0;
@@ -670,7 +675,8 @@ static ssize_t nbd_send_reply(QIOChannel *ioc, struct nbd_reply *reply)
 
     reply->error = system_errno_to_nbd_errno(reply->error);
 
-    TRACE("Sending response to client: { .error = %d, handle = %" PRIu64 " }",
+    TRACE("Sending response to client: { .error = %" PRId32
+          ", handle = %" PRIu64 " }",
           reply->error, reply->handle);
 
     /* Reply
@@ -999,7 +1005,7 @@ static ssize_t nbd_co_receive_request(NBDRequest *req, struct nbd_request *reque
     command = request->type & NBD_CMD_MASK_COMMAND;
     if (command == NBD_CMD_READ || command == NBD_CMD_WRITE) {
         if (request->len > NBD_MAX_BUFFER_SIZE) {
-            LOG("len (%u) is larger than max len (%u)",
+            LOG("len (%" PRIu32" ) is larger than max len (%u)",
                 request->len, NBD_MAX_BUFFER_SIZE);
             rc = -EINVAL;
             goto out;
@@ -1012,7 +1018,7 @@ static ssize_t nbd_co_receive_request(NBDRequest *req, struct nbd_request *reque
         }
     }
     if (command == NBD_CMD_WRITE) {
-        TRACE("Reading %u byte(s)", request->len);
+        TRACE("Reading %" PRIu32 " byte(s)", request->len);
 
         if (read_sync(client->ioc, req->data, request->len) != request->len) {
             LOG("reading from socket failed");
@@ -1063,10 +1069,10 @@ static void nbd_trip(void *opaque)
     }
     command = request.type & NBD_CMD_MASK_COMMAND;
     if (command != NBD_CMD_DISC && (request.from + request.len) > exp->size) {
-            LOG("From: %" PRIu64 ", Len: %u, Size: %" PRIu64
-            ", Offset: %" PRIu64 "\n",
-                    request.from, request.len,
-                    (uint64_t)exp->size, (uint64_t)exp->dev_offset);
+            LOG("From: %" PRIu64 ", Len: %" PRIu32", Size: %" PRIu64
+                ", Offset: %" PRIu64 "\n",
+                request.from, request.len,
+                (uint64_t)exp->size, (uint64_t)exp->dev_offset);
         LOG("requested operation past EOF--bad client?");
         goto invalid_request;
     }
@@ -1100,7 +1106,7 @@ static void nbd_trip(void *opaque)
             goto error_reply;
         }
 
-        TRACE("Read %u byte(s)", request.len);
+        TRACE("Read %" PRIu32" byte(s)", request.len);
         if (nbd_co_send_reply(req, &reply, request.len) < 0)
             goto out;
         break;
@@ -1169,7 +1175,7 @@ static void nbd_trip(void *opaque)
         }
         break;
     default:
-        LOG("invalid request type (%u) received", request.type);
+        LOG("invalid request type (%" PRIu32 ") received", request.type);
     invalid_request:
         reply.error = EINVAL;
     error_reply:
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PULL v2 00/29] KVM, build, NBD, SCSI patches for 2016-06-16
  2016-06-16 16:55 [Qemu-devel] [PULL v2 00/29] KVM, build, NBD, SCSI patches for 2016-06-16 Paolo Bonzini
                   ` (2 preceding siblings ...)
  2016-06-16 16:55 ` [Qemu-devel] [PULL 17/29] nbd: More debug typo fixes, use correct formats Paolo Bonzini
@ 2016-06-16 17:46 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2016-06-16 17:46 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On 16 June 2016 at 17:55, Paolo Bonzini <pbonzini@redhat.com> wrote:
> The following changes since commit dc278c58fa02e5fb796dbacf02c8dde32f697015:
>
>   Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2016-06-16 15:22:56 +0100)
>
> are available in the git repository at:
>
>   git://github.com/bonzini/qemu.git tags/for-upstream
>
> for you to fetch changes up to 573c0caee76fc14f4557d2146f0c9ae67be658c4:
>
>   vl: smp_parse: cleanups (2016-06-16 18:33:04 +0200)
>
> v1->v2: rebase, rerun clean-includes, drop Greg's patch, fix PRIx16

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-16 17:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-16 16:55 [Qemu-devel] [PULL v2 00/29] KVM, build, NBD, SCSI patches for 2016-06-16 Paolo Bonzini
2016-06-16 16:55 ` [Qemu-devel] [PULL 02/29] os-posix: include sys/mman.h Paolo Bonzini
2016-06-16 16:55 ` [Qemu-devel] [PULL 03/29] clean-includes: run it once more Paolo Bonzini
2016-06-16 16:55 ` [Qemu-devel] [PULL 17/29] nbd: More debug typo fixes, use correct formats Paolo Bonzini
2016-06-16 17:46 ` [Qemu-devel] [PULL v2 00/29] KVM, build, NBD, SCSI patches for 2016-06-16 Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).