History log of /qemu/nbd/ (Results 151 – 175 of 377)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
a7b78fc918-Feb-2019 Kevin Wolf <kwolf@redhat.com>

nbd: Move nbd_read_eof() to nbd/client.c

The only caller of nbd_read_eof() is nbd_receive_reply(), so it doesn't
have to live in the header file, but can move next to its caller.

Also add the missi

nbd: Move nbd_read_eof() to nbd/client.c

The only caller of nbd_read_eof() is nbd_receive_reply(), so it doesn't
have to live in the header file, but can move next to its caller.

Also add the missing coroutine_fn to the function and its caller.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>

show more ...


/qemu/.gitignore
/qemu/MAINTAINERS
/qemu/Makefile
/qemu/Makefile.objs
/qemu/Makefile.target
/qemu/accel/kvm/kvm-all.c
/qemu/accel/kvm/trace-events
/qemu/audio/wavcapture.c
/qemu/block.c
/qemu/block/block-backend.c
/qemu/block/commit.c
/qemu/block/crypto.c
/qemu/block/dirty-bitmap.c
/qemu/block/nbd-client.c
/qemu/block/nbd-client.h
/qemu/block/qapi.c
/qemu/block/qcow2-bitmap.c
/qemu/block/qcow2-snapshot.c
/qemu/block/qcow2.c
/qemu/block/qcow2.h
/qemu/block/snapshot.c
/qemu/block/vmdk.c
/qemu/blockdev.c
/qemu/chardev/char-fe.c
/qemu/chardev/char-mux.c
/qemu/chardev/char-pty.c
/qemu/chardev/char-serial.c
/qemu/chardev/char-socket.c
/qemu/chardev/char.c
/qemu/chardev/spice.c
/qemu/chardev/trace-events
/qemu/chardev/wctablet.c
/qemu/configure
/qemu/default-configs/arm-softmmu.mak
/qemu/docs/devel/qapi-code-gen.txt
/qemu/gdbstub.c
/qemu/hmp-commands.hx
/qemu/hmp.c
/qemu/hw/acpi/pcihp.c
/qemu/hw/acpi/piix4.c
/qemu/hw/arm/Makefile.objs
/qemu/hw/arm/armsse.c
/qemu/hw/arm/musca.c
/qemu/hw/arm/omap2.c
/qemu/hw/block/virtio-blk.c
/qemu/hw/bt/hci-csr.c
/qemu/hw/char/omap_uart.c
/qemu/hw/char/pl011.c
/qemu/hw/char/terminal3270.c
/qemu/hw/char/virtio-serial-bus.c
/qemu/hw/char/xen_console.c
/qemu/hw/core/bus.c
/qemu/hw/display/qxl.c
/qemu/hw/display/trace-events
/qemu/hw/display/virtio-gpu-3d.c
/qemu/hw/display/virtio-gpu.c
/qemu/hw/dma/i8257.c
/qemu/hw/hppa/dino.c
/qemu/hw/input/pckbd.c
/qemu/hw/input/trace-events
/qemu/hw/intc/armv7m_nvic.c
/qemu/hw/intc/spapr_xive.c
/qemu/hw/intc/xics.c
/qemu/hw/intc/xics_kvm.c
/qemu/hw/isa/isa-superio.c
/qemu/hw/mips/boston.c
/qemu/hw/mips/mips_fulong2e.c
/qemu/hw/mips/mips_int.c
/qemu/hw/mips/mips_malta.c
/qemu/hw/misc/macio/cuda.c
/qemu/hw/misc/mips_cpc.c
/qemu/hw/misc/mips_itu.c
/qemu/hw/misc/tz-ppc.c
/qemu/hw/pci-host/bonito.c
/qemu/hw/pci/pcie.c
/qemu/hw/pci/shpc.c
/qemu/hw/ppc/mac_newworld.c
/qemu/hw/ppc/prep.c
/qemu/hw/ppc/spapr.c
/qemu/hw/ppc/spapr_events.c
/qemu/hw/ppc/spapr_irq.c
/qemu/hw/ppc/spapr_pci.c
/qemu/hw/ppc/spapr_rtc.c
/qemu/hw/ppc/spapr_vio.c
/qemu/hw/riscv/sifive_e.c
/qemu/hw/riscv/sifive_u.c
/qemu/hw/riscv/spike.c
/qemu/hw/riscv/virt.c
/qemu/hw/s390x/Makefile.objs
/qemu/hw/s390x/css-bridge.c
/qemu/hw/s390x/s390-pci-bus.c
/qemu/hw/s390x/s390-skeys.c
/qemu/hw/s390x/s390-virtio-ccw.c
/qemu/hw/scsi/virtio-scsi.c
/qemu/hw/scsi/vmw_pvscsi.c
/qemu/hw/sparc64/sun4u.c
/qemu/hw/timer/mc146818rtc.c
/qemu/hw/timer/pl031.c
/qemu/hw/timer/trace-events
/qemu/hw/usb/core.c
/qemu/hw/usb/dev-serial.c
/qemu/hw/usb/dev-smartcard-reader.c
/qemu/hw/usb/hcd-ehci.c
/qemu/hw/usb/hcd-musb.c
/qemu/hw/usb/hcd-ohci.c
/qemu/hw/usb/hcd-uhci.c
/qemu/hw/usb/hcd-xhci.c
/qemu/hw/usb/redirect.c
/qemu/hw/vfio/common.c
/qemu/hw/vfio/trace-events
/qemu/include/block/block.h
/qemu/include/block/block_int.h
/qemu/include/block/nbd.h
/qemu/include/block/snapshot.h
/qemu/include/chardev/char-fe.h
/qemu/include/chardev/char-mux.h
/qemu/include/chardev/char.h
/qemu/include/chardev/spice.h
/qemu/include/exec/helper-head.h
/qemu/include/hw/arm/armsse.h
/qemu/include/hw/char/pl011.h
/qemu/include/hw/misc/tz-ppc.h
/qemu/include/hw/pci-host/spapr.h
/qemu/include/hw/ppc/spapr.h
/qemu/include/hw/ppc/spapr_irq.h
/qemu/include/hw/ppc/xics.h
/qemu/include/hw/ppc/xive.h
/qemu/include/hw/qdev-core.h
/qemu/include/hw/s390x/tod.h
/qemu/include/hw/timer/pl031.h
/qemu/include/hw/virtio/virtio-gpu.h
/qemu/include/io/channel.h
/qemu/include/io/task.h
/qemu/include/qapi/qmp/dispatch.h
/qemu/include/sysemu/arch_init.h
/qemu/include/sysemu/block-backend.h
/qemu/include/ui/spice-display.h
/qemu/io/channel.c
/qemu/io/task.c
/qemu/io/trace-events
/qemu/iothread.c
/qemu/linux-user/elfload.c
/qemu/linux-user/mips/cpu_loop.c
/qemu/linux-user/riscv/signal.c
/qemu/linux-user/s390x/target_cpu.h
/qemu/monitor.c
client.c
nbd-internal.h
/qemu/net/slirp.c
/qemu/pc-bios/hppa-firmware.img
/qemu/pc-bios/openbios-ppc
/qemu/pc-bios/openbios-sparc32
/qemu/pc-bios/openbios-sparc64
/qemu/qapi/Makefile.objs
/qemu/qapi/block-core.json
/qemu/qapi/misc.json
/qemu/qapi/qapi-schema.json
/qemu/qapi/qmp-registry.c
/qemu/qapi/target.json
/qemu/qapi/ui.json
/qemu/qemu-deprecated.texi
/qemu/qemu-img.c
/qemu/qemu-io-cmds.c
/qemu/qemu-options.hx
/qemu/qmp.c
/qemu/qtest.c
/qemu/roms/openbios
/qemu/scripts/qapi/commands.py
/qemu/scripts/qapi/common.py
/qemu/scripts/qapi/events.py
/qemu/scripts/qapi/types.py
/qemu/scripts/qapi/visit.py
/qemu/scripts/qemugdb/coroutine.py
/qemu/slirp/ip_icmp.c
/qemu/slirp/misc.c
/qemu/slirp/slirp.c
/qemu/slirp/socket.c
/qemu/slirp/tcp_subr.c
/qemu/slirp/udp.c
/qemu/slirp/util.c
/qemu/slirp/util.h
/qemu/stubs/Makefile.objs
/qemu/stubs/monitor.c
/qemu/target/arm/Makefile.objs
/qemu/target/arm/cpu.c
/qemu/target/arm/cpu.h
/qemu/target/arm/cpu64.c
/qemu/target/arm/helper-a64.c
/qemu/target/arm/helper.c
/qemu/target/arm/helper.h
/qemu/target/arm/kvm32.c
/qemu/target/arm/kvm64.c
/qemu/target/arm/machine.c
/qemu/target/arm/monitor.c
/qemu/target/arm/neon_helper.c
/qemu/target/arm/translate-a64.c
/qemu/target/arm/translate-sve.c
/qemu/target/arm/translate.c
/qemu/target/arm/translate.h
/qemu/target/arm/vec_helper.c
/qemu/target/arm/vfp_helper.c
/qemu/target/hppa/Makefile.objs
/qemu/target/hppa/insns.decode
/qemu/target/hppa/op_helper.c
/qemu/target/hppa/translate.c
/qemu/target/i386/cpu.c
/qemu/target/i386/sev_i386.h
/qemu/target/mips/cpu.h
/qemu/target/mips/helper.c
/qemu/target/mips/helper.h
/qemu/target/mips/machine.c
/qemu/target/mips/op_helper.c
/qemu/target/mips/translate.c
/qemu/target/ppc/arch_dump.c
/qemu/target/ppc/cpu-qom.h
/qemu/target/ppc/cpu.h
/qemu/target/ppc/excp_helper.c
/qemu/target/ppc/gdbstub.c
/qemu/target/ppc/helper.h
/qemu/target/ppc/int_helper.c
/qemu/target/ppc/machine.c
/qemu/target/ppc/mmu_helper.c
/qemu/target/ppc/translate.c
/qemu/target/ppc/translate/vmx-impl.inc.c
/qemu/target/ppc/translate/vsx-impl.inc.c
/qemu/target/ppc/translate_init.inc.c
/qemu/target/riscv/cpu.c
/qemu/target/riscv/cpu.h
/qemu/target/riscv/cpu_bits.h
/qemu/target/riscv/cpu_helper.c
/qemu/target/riscv/csr.c
/qemu/target/riscv/fpu_helper.c
/qemu/target/riscv/op_helper.c
/qemu/target/riscv/translate.c
/qemu/target/s390x/cpu.c
/qemu/target/s390x/cpu.h
/qemu/target/s390x/cpu_features.c
/qemu/target/s390x/cpu_models.c
/qemu/target/s390x/cpu_models.h
/qemu/target/s390x/gen-features.c
/qemu/target/s390x/helper.h
/qemu/target/s390x/insn-data.def
/qemu/target/s390x/kvm.c
/qemu/target/s390x/misc_helper.c
/qemu/target/s390x/s390-tod.h
/qemu/target/s390x/trace-events
/qemu/target/s390x/translate.c
/qemu/tests/ivshmem-test.c
/qemu/tests/libqtest.c
/qemu/tests/qapi-schema/comments.out
/qemu/tests/qapi-schema/doc-bad-section.out
/qemu/tests/qapi-schema/doc-good.out
/qemu/tests/qapi-schema/empty.out
/qemu/tests/qapi-schema/event-case.out
/qemu/tests/qapi-schema/ident-with-escape.out
/qemu/tests/qapi-schema/include-relpath.out
/qemu/tests/qapi-schema/include-repetition.out
/qemu/tests/qapi-schema/include-simple.out
/qemu/tests/qapi-schema/indented-expr.out
/qemu/tests/qapi-schema/qapi-schema-test.out
/qemu/tests/qemu-iotests/124
/qemu/tests/qemu-iotests/236.out
/qemu/tests/qemu-iotests/242
/qemu/tests/qemu-iotests/242.out
/qemu/tests/qemu-iotests/group
/qemu/tests/tcg/mips/include/test_inputs.h
/qemu/tests/tcg/mips/include/test_utils.h
/qemu/tests/tcg/mips/include/wrappers_msa.h
/qemu/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_b.c
/qemu/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_d.c
/qemu/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_h.c
/qemu/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_w.c
/qemu/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_b.c
/qemu/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_d.c
/qemu/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_h.c
/qemu/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_w.c
/qemu/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_b.c
/qemu/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_d.c
/qemu/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_h.c
/qemu/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_w.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_b.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_d.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_h.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_w.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_b.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_d.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_h.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_w.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_b.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_d.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_h.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_w.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_b.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_d.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_h.c
/qemu/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_w.c
/qemu/tests/tcg/mips/user/ase/msa/logic/test_msa_and_v.c
/qemu/tests/tcg/mips/user/ase/msa/logic/test_msa_nor_v.c
/qemu/tests/tcg/mips/user/ase/msa/logic/test_msa_or_v.c
/qemu/tests/tcg/mips/user/ase/msa/logic/test_msa_xor_v.c
/qemu/tests/test-char.c
/qemu/tests/test-filter-redirector.c
/qemu/tests/test-qmp-event.c
/qemu/tests/test-qobject-input-visitor.c
/qemu/tests/vhost-user-test.c
/qemu/ui/Makefile.objs
/qemu/ui/gtk.c
/qemu/ui/kbd-state.c
/qemu/ui/sdl2-input.c
/qemu/ui/spice-app.c
/qemu/ui/spice-core.c
/qemu/ui/spice-display.c
/qemu/ui/vnc.c
/qemu/vl.c
269ee27e07-Feb-2019 Eric Blake <eblake@redhat.com>

nbd/server: Kill pointless shadowed variable

lgtm.com pointed out that commit 678ba275 introduced a shadowed
declaration of local variable 'bs'; thankfully, the inner 'bs'
obtained by 'blk_bs(blk)'

nbd/server: Kill pointless shadowed variable

lgtm.com pointed out that commit 678ba275 introduced a shadowed
declaration of local variable 'bs'; thankfully, the inner 'bs'
obtained by 'blk_bs(blk)' matches the outer one given that we had
'blk_insert_bs(blk, bs, errp)' a few lines earlier, and there are
no later uses of 'bs' beyond the scope of the 'if (bitmap)' to
care if we change the value stored in 'bs' while traveling the
backing chain to find a bitmap. So simply get rid of the extra
declaration.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190207191357.6665-1-eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>

show more ...


/qemu/.cirrus.yml
/qemu/.gitignore
/qemu/.travis.yml
/qemu/MAINTAINERS
/qemu/Makefile
/qemu/Makefile.objs
/qemu/accel/tcg/cpu-exec.c
/qemu/accel/tcg/cputlb.c
/qemu/accel/tcg/softmmu_template.h
/qemu/block/nbd-client.c
/qemu/block/nbd-client.h
/qemu/block/nbd.c
/qemu/configure
/qemu/contrib/elf2dmp/kdbg.h
/qemu/contrib/elf2dmp/main.c
/qemu/contrib/elf2dmp/pdb.c
/qemu/contrib/elf2dmp/pdb.h
/qemu/contrib/elf2dmp/pe.h
/qemu/contrib/elf2dmp/qemu_elf.c
/qemu/contrib/elf2dmp/qemu_elf.h
/qemu/contrib/libvhost-user/libvhost-user.c
/qemu/contrib/vhost-user-blk/vhost-user-blk.c
/qemu/cpus.c
/qemu/crypto/aes.c
/qemu/crypto/desrfb.c
/qemu/default-configs/alpha-softmmu.mak
/qemu/default-configs/arm-softmmu.mak
/qemu/default-configs/cris-softmmu.mak
/qemu/default-configs/hppa-softmmu.mak
/qemu/default-configs/i386-softmmu.mak
/qemu/default-configs/m68k-softmmu.mak
/qemu/default-configs/microblaze-softmmu.mak
/qemu/default-configs/mips-softmmu-common.mak
/qemu/default-configs/mips64el-softmmu.mak
/qemu/default-configs/moxie-softmmu.mak
/qemu/default-configs/nios2-softmmu.mak
/qemu/default-configs/or1k-softmmu.mak
/qemu/default-configs/pci.mak
/qemu/default-configs/ppc-softmmu.mak
/qemu/default-configs/riscv32-softmmu.mak
/qemu/default-configs/riscv64-softmmu.mak
/qemu/default-configs/s390x-softmmu.mak
/qemu/default-configs/sh4-softmmu.mak
/qemu/default-configs/sh4eb-softmmu.mak
/qemu/default-configs/sparc-softmmu.mak
/qemu/default-configs/sparc64-softmmu.mak
/qemu/default-configs/tricore-softmmu.mak
/qemu/default-configs/xtensa-softmmu.mak
/qemu/default-configs/xtensaeb-softmmu.mak
/qemu/docs/devel/testing.rst
/qemu/docs/qdev-device-use.txt
/qemu/dump.c
/qemu/exec.c
/qemu/gdb-xml/i386-32bit.xml
/qemu/gdb-xml/i386-64bit.xml
/qemu/gdbstub.c
/qemu/hw/Makefile.objs
/qemu/hw/alpha/Makefile.objs
/qemu/hw/alpha/dp264.c
/qemu/hw/arm/Makefile.objs
/qemu/hw/arm/armv7m.c
/qemu/hw/arm/boot.c
/qemu/hw/block/vhost-user-blk.c
/qemu/hw/core/generic-loader.c
/qemu/hw/core/loader.c
/qemu/hw/cpu/cluster.c
/qemu/hw/cris/Makefile.objs
/qemu/hw/cris/boot.c
/qemu/hw/hppa/Makefile.objs
/qemu/hw/hppa/machine.c
/qemu/hw/i2c/Makefile.objs
/qemu/hw/i386/Makefile.objs
/qemu/hw/i386/acpi-build.c
/qemu/hw/i386/intel_iommu.c
/qemu/hw/i386/multiboot.c
/qemu/hw/i386/pc.c
/qemu/hw/i386/pc_piix.c
/qemu/hw/i386/pc_q35.c
/qemu/hw/ide/Makefile.objs
/qemu/hw/ide/core.c
/qemu/hw/ide/ioport.c
/qemu/hw/input/tsc210x.c
/qemu/hw/lm32/Makefile.objs
/qemu/hw/lm32/lm32_boards.c
/qemu/hw/lm32/milkymist.c
/qemu/hw/m68k/Makefile.objs
/qemu/hw/m68k/an5206.c
/qemu/hw/m68k/mcf5208.c
/qemu/hw/microblaze/Makefile.objs
/qemu/hw/microblaze/boot.c
/qemu/hw/mips/Makefile.objs
/qemu/hw/mips/mips_fulong2e.c
/qemu/hw/mips/mips_malta.c
/qemu/hw/mips/mips_mipssim.c
/qemu/hw/mips/mips_r4k.c
/qemu/hw/moxie/Makefile.objs
/qemu/hw/moxie/moxiesim.c
/qemu/hw/net/Makefile.objs
/qemu/hw/nios2/Makefile.objs
/qemu/hw/nios2/boot.c
/qemu/hw/nvram/fw_cfg.c
/qemu/hw/openrisc/Makefile.objs
/qemu/hw/openrisc/openrisc_sim.c
/qemu/hw/pci-host/Makefile.objs
/qemu/hw/pci-host/prep.c
/qemu/hw/pci/msi.c
/qemu/hw/ppc/Makefile.objs
/qemu/hw/ppc/e500.c
/qemu/hw/ppc/mac_newworld.c
/qemu/hw/ppc/mac_oldworld.c
/qemu/hw/ppc/ppc440_bamboo.c
/qemu/hw/ppc/sam460ex.c
/qemu/hw/ppc/spapr.c
/qemu/hw/ppc/virtex_ml507.c
/qemu/hw/riscv/Makefile.objs
/qemu/hw/riscv/sifive_e.c
/qemu/hw/riscv/sifive_u.c
/qemu/hw/riscv/spike.c
/qemu/hw/riscv/virt.c
/qemu/hw/s390x/Makefile.objs
/qemu/hw/s390x/ipl.c
/qemu/hw/s390x/s390-pci-bus.c
/qemu/hw/s390x/s390-pci-bus.h
/qemu/hw/scsi/scsi-disk.c
/qemu/hw/scsi/scsi-generic.c
/qemu/hw/scsi/trace-events
/qemu/hw/sh4/Makefile.objs
/qemu/hw/sh4/r2d.c
/qemu/hw/sparc/Makefile.objs
/qemu/hw/sparc/leon3.c
/qemu/hw/sparc/sun4m.c
/qemu/hw/sparc64/Makefile.objs
/qemu/hw/sparc64/sun4u.c
/qemu/hw/tricore/Makefile.objs
/qemu/hw/tricore/tricore_testboard.c
/qemu/hw/unicore32/puv3.c
/qemu/hw/vfio/Makefile.objs
/qemu/hw/virtio/Makefile.objs
/qemu/hw/virtio/virtio-pci.c
/qemu/hw/virtio/virtio.c
/qemu/hw/xtensa/Makefile.objs
/qemu/hw/xtensa/mx_pic.c
/qemu/hw/xtensa/pic_cpu.c
/qemu/hw/xtensa/sim.c
/qemu/hw/xtensa/xtfpga.c
/qemu/include/elf.h
/qemu/include/exec/cpu-all.h
/qemu/include/exec/cpu-common.h
/qemu/include/exec/exec-all.h
/qemu/include/exec/memattrs.h
/qemu/include/exec/memory.h
/qemu/include/exec/tb-lookup.h
/qemu/include/glib-compat.h
/qemu/include/hw/boards.h
/qemu/include/hw/elf_ops.h
/qemu/include/hw/i386/pc.h
/qemu/include/hw/loader.h
/qemu/include/hw/pci/msi.h
/qemu/include/hw/xen/start_info.h
/qemu/include/hw/xtensa/mx_pic.h
/qemu/include/net/net.h
/qemu/include/qemu-common.h
/qemu/include/qemu/atomic128.h
/qemu/include/qemu/main-loop.h
/qemu/include/qemu/queue.h
/qemu/include/standard-headers/asm-x86/bootparam.h
/qemu/include/standard-headers/drm/drm_fourcc.h
/qemu/include/standard-headers/linux/ethtool.h
/qemu/include/standard-headers/linux/input-event-codes.h
/qemu/include/standard-headers/linux/pci_regs.h
/qemu/include/standard-headers/linux/vhost_types.h
/qemu/include/standard-headers/linux/virtio_balloon.h
/qemu/include/standard-headers/linux/virtio_blk.h
/qemu/include/standard-headers/linux/virtio_config.h
/qemu/include/standard-headers/linux/virtio_gpu.h
/qemu/include/standard-headers/linux/virtio_ring.h
/qemu/include/sysemu/sysemu.h
/qemu/include/ui/egl-helpers.h
/qemu/include/ui/gtk.h
/qemu/include/ui/kbd-state.h
/qemu/include/ui/sdl2.h
/qemu/linux-headers/asm-arm/unistd-common.h
/qemu/linux-headers/asm-arm64/unistd.h
/qemu/linux-headers/asm-generic/unistd.h
/qemu/linux-headers/asm-mips/sgidefs.h
/qemu/linux-headers/asm-mips/unistd.h
/qemu/linux-headers/asm-mips/unistd_n32.h
/qemu/linux-headers/asm-mips/unistd_n64.h
/qemu/linux-headers/asm-mips/unistd_o32.h
/qemu/linux-headers/asm-powerpc/unistd.h
/qemu/linux-headers/asm-powerpc/unistd_32.h
/qemu/linux-headers/asm-powerpc/unistd_64.h
/qemu/linux-headers/linux/kvm.h
/qemu/linux-headers/linux/vfio.h
/qemu/linux-headers/linux/vhost.h
/qemu/linux-headers/linux/vhost_types.h
/qemu/linux-user/aarch64/target_syscall.h
/qemu/linux-user/fd-trans.c
/qemu/linux-user/syscall.c
/qemu/monitor.c
server.c
/qemu/net/net.c
/qemu/net/slirp.c
/qemu/pc-bios/optionrom/Makefile
/qemu/pc-bios/optionrom/linuxboot_dma.c
/qemu/pc-bios/optionrom/optrom.h
/qemu/pc-bios/optionrom/optrom_fw_cfg.h
/qemu/pc-bios/optionrom/pvh.S
/qemu/pc-bios/optionrom/pvh_main.c
/qemu/pc-bios/pvh.bin
/qemu/qemu-deprecated.texi
/qemu/qemu-options.hx
/qemu/scripts/archive-source.sh
/qemu/scripts/dump-guest-memory.py
/qemu/scripts/qemu.py
/qemu/scripts/tap-driver.pl
/qemu/scripts/tap-merge.pl
/qemu/scripts/update-linux-headers.sh
/qemu/slirp/Makefile.objs
/qemu/slirp/arp_table.c
/qemu/slirp/bootp.c
/qemu/slirp/cksum.c
/qemu/slirp/debug.h
/qemu/slirp/dhcpv6.c
/qemu/slirp/dnssearch.c
/qemu/slirp/if.c
/qemu/slirp/ip.h
/qemu/slirp/ip6.h
/qemu/slirp/ip6_icmp.c
/qemu/slirp/ip6_icmp.h
/qemu/slirp/ip6_input.c
/qemu/slirp/ip6_output.c
/qemu/slirp/ip_icmp.c
/qemu/slirp/ip_icmp.h
/qemu/slirp/ip_input.c
/qemu/slirp/ip_output.c
/qemu/slirp/libslirp.h
/qemu/slirp/main.h
/qemu/slirp/mbuf.c
/qemu/slirp/mbuf.h
/qemu/slirp/misc.c
/qemu/slirp/misc.h
/qemu/slirp/ncsi.c
/qemu/slirp/ndp_table.c
/qemu/slirp/qtailq.h
/qemu/slirp/sbuf.c
/qemu/slirp/sbuf.h
/qemu/slirp/slirp.c
/qemu/slirp/slirp.h
/qemu/slirp/socket.c
/qemu/slirp/socket.h
/qemu/slirp/state.c
/qemu/slirp/state.h
/qemu/slirp/tcp_input.c
/qemu/slirp/tcp_output.c
/qemu/slirp/tcp_subr.c
/qemu/slirp/tcp_timer.c
/qemu/slirp/tcp_var.h
/qemu/slirp/tftp.c
/qemu/slirp/udp.c
/qemu/slirp/udp.h
/qemu/slirp/udp6.c
/qemu/slirp/util.c
/qemu/slirp/util.h
/qemu/stubs/Makefile.objs
/qemu/target/arm/cpu.c
/qemu/target/arm/cpu.h
/qemu/target/arm/cpu64.c
/qemu/target/arm/helper.c
/qemu/target/arm/internals.h
/qemu/target/arm/translate-a64.c
/qemu/target/arm/translate.h
/qemu/target/hppa/gdbstub.c
/qemu/target/hppa/op_helper.c
/qemu/target/hppa/translate.c
/qemu/target/i386/cpu.c
/qemu/target/i386/cpu.h
/qemu/target/i386/gdbstub.c
/qemu/target/i386/hvf/hvf.c
/qemu/target/i386/hvf/x86_cpuid.c
/qemu/target/i386/hvf/x86_decode.c
/qemu/target/i386/kvm.c
/qemu/target/moxie/cpu.c
/qemu/target/moxie/cpu.h
/qemu/target/moxie/helper.c
/qemu/target/moxie/mmu.c
/qemu/target/moxie/translate.c
/qemu/target/s390x/cpu.h
/qemu/target/s390x/insn-data.def
/qemu/target/s390x/kvm.c
/qemu/target/s390x/translate.c
/qemu/target/xtensa/Makefile.objs
/qemu/target/xtensa/core-test_mmuhifi_c3.c
/qemu/target/xtensa/core-test_mmuhifi_c3/core-isa.h
/qemu/target/xtensa/core-test_mmuhifi_c3/gdb-config.inc.c
/qemu/target/xtensa/core-test_mmuhifi_c3/xtensa-modules.inc.c
/qemu/target/xtensa/cpu.h
/qemu/target/xtensa/exc_helper.c
/qemu/target/xtensa/helper.c
/qemu/target/xtensa/helper.h
/qemu/target/xtensa/op_helper.c
/qemu/target/xtensa/translate.c
/qemu/tcg/i386/tcg-target.inc.c
/qemu/tcg/tcg-op.h
/qemu/tcg/tcg.c
/qemu/tcg/tcg.h
/qemu/tests/Makefile.include
/qemu/tests/docker/Makefile.include
/qemu/tests/docker/docker.py
/qemu/tests/docker/dockerfiles/centos7.docker
/qemu/tests/docker/dockerfiles/debian-buster-arm64-cross.docker
/qemu/tests/docker/dockerfiles/debian10.docker
/qemu/tests/tcg/aarch64/Makefile.include
/qemu/tests/tcg/aarch64/Makefile.target
/qemu/tests/tcg/aarch64/pauth-1.c
/qemu/tests/vhost-user-test.c
/qemu/tests/vm/Makefile.include
/qemu/tests/vm/basevm.py
/qemu/tests/vm/centos
/qemu/tests/vm/freebsd
/qemu/tests/vm/netbsd
/qemu/tests/vm/openbsd
/qemu/tests/vm/ubuntu.i386
/qemu/ui/Makefile.objs
/qemu/ui/cocoa.m
/qemu/ui/curses.c
/qemu/ui/egl-headless.c
/qemu/ui/egl-helpers.c
/qemu/ui/gtk-egl.c
/qemu/ui/gtk.c
/qemu/ui/kbd-state.c
/qemu/ui/keymaps.c
/qemu/ui/keymaps.h
/qemu/ui/sdl2-input.c
/qemu/ui/sdl2.c
/qemu/ui/spice-display.c
/qemu/ui/vnc-enc-hextile-template.h
/qemu/ui/vnc-enc-zywrle.h
/qemu/ui/vnc.c
/qemu/ui/vnc.h
/qemu/util/main-loop.c
/qemu/util/osdep.c
/qemu/vl.c
e6798f0628-Jan-2019 Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

nbd: generalize usage of nbd_read

We generally do very similar things around nbd_read: error_prepend
specifying what we have tried to read, and be_to_cpu conversion of
integers.

So, it seems reason

nbd: generalize usage of nbd_read

We generally do very similar things around nbd_read: error_prepend
specifying what we have tried to read, and be_to_cpu conversion of
integers.

So, it seems reasonable to move common things to helper functions,
which:
1. simplify code a bit
2. generalize nbd_read error descriptions, all starting with
"Failed to read"
3. make it more difficult to forget to convert things from BE

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190128165830.165170-1-vsementsov@virtuozzo.com>
[eblake: rename macro to DEF_NBD_READ_N and formatting tweaks;
checkpatch has false positive complaint]
Signed-off-by: Eric Blake <eblake@redhat.com>

show more ...


/qemu/COPYING.LIB
/qemu/MAINTAINERS
/qemu/Makefile
/qemu/Makefile.target
/qemu/accel/tcg/atomic_template.h
/qemu/accel/tcg/cpu-exec-common.c
/qemu/accel/tcg/cpu-exec.c
/qemu/accel/tcg/cputlb.c
/qemu/accel/tcg/softmmu_template.h
/qemu/accel/tcg/tcg-runtime-gvec.c
/qemu/accel/tcg/tcg-runtime.h
/qemu/accel/tcg/translate-all.c
/qemu/accel/tcg/translate-all.h
/qemu/accel/tcg/user-exec.c
/qemu/audio/audio.c
/qemu/audio/audio_int.h
/qemu/audio/paaudio.c
/qemu/backends/hostmem-file.c
/qemu/backends/hostmem.c
/qemu/block.c
/qemu/block/blklogwrites.c
/qemu/block/block-backend.c
/qemu/block/curl.c
/qemu/block/file-posix.c
/qemu/block/io.c
/qemu/block/iscsi.c
/qemu/block/mirror.c
/qemu/block/nbd-client.c
/qemu/block/nvme.c
/qemu/block/qcow2-refcount.c
/qemu/block/qcow2.c
/qemu/block/qcow2.h
/qemu/block/qed.c
/qemu/block/sheepdog.c
/qemu/block/ssh.c
/qemu/block/throttle-groups.c
/qemu/block/trace-events
/qemu/block/vdi.c
/qemu/block/vmdk.c
/qemu/block/vpc.c
/qemu/blockdev.c
/qemu/configure
/qemu/contrib/gitdm/filetypes.txt
/qemu/contrib/rdmacm-mux/Makefile.objs
/qemu/contrib/rdmacm-mux/main.c
/qemu/crypto/afsplit.c
/qemu/default-configs/arm-softmmu.mak
/qemu/default-configs/lm32-softmmu.mak
/qemu/disas/nanomips.cpp
/qemu/docs/devel/qapi-code-gen.txt
/qemu/docs/devel/tracing.txt
/qemu/docs/multiseat.txt
/qemu/docs/pvrdma.txt
/qemu/docs/qemu-cpu-models.texi
/qemu/exec.c
/qemu/fpu/softfloat.c
/qemu/gdbstub.c
/qemu/hmp.c
/qemu/hw/acpi/cpu.c
/qemu/hw/acpi/vmgenid.c
/qemu/hw/arm/Makefile.objs
/qemu/hw/arm/armsse.c
/qemu/hw/arm/armv7m.c
/qemu/hw/arm/boot.c
/qemu/hw/arm/microbit.c
/qemu/hw/arm/mps2-tz.c
/qemu/hw/arm/nrf51_soc.c
/qemu/hw/arm/xlnx-zynqmp.c
/qemu/hw/audio/pcspk.c
/qemu/hw/block/dataplane/xen-block.c
/qemu/hw/block/nvme.c
/qemu/hw/block/trace-events
/qemu/hw/block/virtio-blk.c
/qemu/hw/block/xen-block.c
/qemu/hw/core/machine.c
/qemu/hw/cpu/cluster.c
/qemu/hw/display/Makefile.objs
/qemu/hw/display/milkymist-tmu2.c
/qemu/hw/display/qxl.c
/qemu/hw/display/trace-events
/qemu/hw/gpio/trace-events
/qemu/hw/i2c/Makefile.objs
/qemu/hw/i2c/microbit_i2c.c
/qemu/hw/i2c/smbus_eeprom.c
/qemu/hw/i386/acpi-build.c
/qemu/hw/i386/pc.c
/qemu/hw/ide/cmd646.c
/qemu/hw/ide/pci.c
/qemu/hw/ide/sii3112.c
/qemu/hw/ide/via.c
/qemu/hw/input/pckbd.c
/qemu/hw/intc/armv7m_nvic.c
/qemu/hw/intc/spapr_xive.c
/qemu/hw/intc/xics_kvm.c
/qemu/hw/intc/xics_spapr.c
/qemu/hw/intc/xive.c
/qemu/hw/lm32/milkymist-hw.h
/qemu/hw/lm32/milkymist.c
/qemu/hw/microblaze/petalogix_s3adsp1800_mmu.c
/qemu/hw/mips/mips_fulong2e.c
/qemu/hw/misc/Makefile.objs
/qemu/hw/misc/armsse-cpuid.c
/qemu/hw/misc/edu.c
/qemu/hw/misc/iotkit-secctl.c
/qemu/hw/misc/iotkit-sysinfo.c
/qemu/hw/misc/trace-events
/qemu/hw/nvram/Makefile.objs
/qemu/hw/nvram/nrf51_nvm.c
/qemu/hw/ppc/Makefile.objs
/qemu/hw/ppc/mac_newworld.c
/qemu/hw/ppc/mac_oldworld.c
/qemu/hw/ppc/pnv.c
/qemu/hw/ppc/pnv_core.c
/qemu/hw/ppc/ppc.c
/qemu/hw/ppc/ppc405_uc.c
/qemu/hw/ppc/ppc440_bamboo.c
/qemu/hw/ppc/ppc440_uc.c
/qemu/hw/ppc/ppc4xx_devs.c
/qemu/hw/ppc/ppc_booke.c
/qemu/hw/ppc/sam460ex.c
/qemu/hw/ppc/spapr.c
/qemu/hw/ppc/spapr_cpu_core.c
/qemu/hw/ppc/spapr_irq.c
/qemu/hw/ppc/spapr_pci.c
/qemu/hw/ppc/spapr_vio.c
/qemu/hw/rdma/rdma_backend.c
/qemu/hw/rdma/rdma_backend.h
/qemu/hw/rdma/rdma_backend_defs.h
/qemu/hw/rdma/rdma_rm.c
/qemu/hw/rdma/vmw/pvrdma_main.c
/qemu/hw/rdma/vmw/pvrdma_qp_ops.c
/qemu/hw/rdma/vmw/pvrdma_qp_ops.h
/qemu/hw/scsi/scsi-disk.c
/qemu/hw/scsi/virtio-scsi.c
/qemu/hw/sd/sd.c
/qemu/hw/ssi/aspeed_smc.c
/qemu/hw/usb/combined-packet.c
/qemu/hw/usb/dev-hid.c
/qemu/hw/usb/dev-mtp.c
/qemu/hw/usb/hcd-ehci-pci.c
/qemu/hw/usb/hcd-ehci-sysbus.c
/qemu/hw/usb/hcd-ehci.c
/qemu/hw/usb/hcd-ehci.h
/qemu/hw/usb/hcd-xhci.c
/qemu/hw/usb/hcd-xhci.h
/qemu/hw/vfio/pci.c
/qemu/hw/vfio/trace-events
/qemu/hw/xen/xen-bus.c
/qemu/include/block/block.h
/qemu/include/block/nbd.h
/qemu/include/block/throttle-groups.h
/qemu/include/crypto/afsplit.h
/qemu/include/exec/cpu-defs.h
/qemu/include/exec/cpu_ldst.h
/qemu/include/exec/exec-all.h
/qemu/include/exec/memory.h
/qemu/include/fpu/softfloat-macros.h
/qemu/include/hw/acpi/cpu.h
/qemu/include/hw/arm/armsse.h
/qemu/include/hw/arm/armv7m.h
/qemu/include/hw/arm/nrf51.h
/qemu/include/hw/arm/nrf51_soc.h
/qemu/include/hw/arm/pxa.h
/qemu/include/hw/char/serial.h
/qemu/include/hw/cpu/cluster.h
/qemu/include/hw/devices.h
/qemu/include/hw/display/milkymist_tmu2.h
/qemu/include/hw/i2c/microbit_i2c.h
/qemu/include/hw/i2c/smbus.h
/qemu/include/hw/i386/pc.h
/qemu/include/hw/ide.h
/qemu/include/hw/ide/ahci.h
/qemu/include/hw/ide/pci.h
/qemu/include/hw/input/ps2.h
/qemu/include/hw/misc/armsse-cpuid.h
/qemu/include/hw/misc/iotkit-secctl.h
/qemu/include/hw/misc/iotkit-sysinfo.h
/qemu/include/hw/nvram/nrf51_nvm.h
/qemu/include/hw/pci-host/gpex.h
/qemu/include/hw/pci-host/q35.h
/qemu/include/hw/pcmcia.h
/qemu/include/hw/ppc/pnv_core.h
/qemu/include/hw/ppc/ppc4xx.h
/qemu/include/hw/ppc/spapr.h
/qemu/include/hw/ppc/spapr_cpu_core.h
/qemu/include/hw/ppc/spapr_xive.h
/qemu/include/hw/ppc/xics.h
/qemu/include/hw/ppc/xics_spapr.h
/qemu/include/hw/ppc/xive.h
/qemu/include/hw/ssi/aspeed_smc.h
/qemu/include/hw/virtio/virtio-net.h
/qemu/include/migration/register.h
/qemu/include/qapi/qmp-event.h
/qemu/include/qemu/compiler.h
/qemu/include/qemu/mmap-alloc.h
/qemu/include/qemu/osdep.h
/qemu/include/qemu/range.h
/qemu/include/qemu/typedefs.h
/qemu/include/qemu/units.h
/qemu/include/qemu/uuid.h
/qemu/include/qom/cpu.h
/qemu/include/sysemu/block-backend.h
/qemu/include/sysemu/bt.h
/qemu/include/ui/console.h
/qemu/include/ui/egl-helpers.h
/qemu/include/ui/qemu-pixman.h
/qemu/include/ui/sdl2.h
/qemu/io/channel-socket.c
/qemu/linux-user/aarch64/cpu_loop.c
/qemu/linux-user/aarch64/target_syscall.h
/qemu/linux-user/elfload.c
/qemu/linux-user/m68k/target_cpu.h
/qemu/linux-user/m68k/target_structs.h
/qemu/linux-user/qemu.h
/qemu/migration/channel.c
/qemu/migration/migration.c
/qemu/migration/migration.h
/qemu/migration/postcopy-ram.c
/qemu/migration/ram.c
/qemu/migration/ram.h
/qemu/migration/rdma.c
/qemu/migration/savevm.c
/qemu/monitor.c
client.c
common.c
server.c
/qemu/numa.c
/qemu/pc-bios/README
/qemu/pc-bios/efi-e1000.rom
/qemu/pc-bios/efi-e1000e.rom
/qemu/pc-bios/efi-eepro100.rom
/qemu/pc-bios/efi-ne2k_pci.rom
/qemu/pc-bios/efi-pcnet.rom
/qemu/pc-bios/efi-rtl8139.rom
/qemu/pc-bios/efi-virtio.rom
/qemu/pc-bios/efi-vmxnet3.rom
/qemu/pc-bios/qemu_vga.ndrv
/qemu/pc-bios/slof.bin
/qemu/qapi/block-core.json
/qemu/qapi/migration.json
/qemu/qapi/misc.json
/qemu/qapi/qapi-schema.json
/qemu/qapi/qmp-event.c
/qemu/qapi/ui.json
/qemu/qemu-deprecated.texi
/qemu/qemu-doc.texi
/qemu/qemu-img.c
/qemu/qemu-io-cmds.c
/qemu/qemu-nbd.c
/qemu/qemu-nbd.texi
/qemu/qemu-seccomp.c
/qemu/qobject/json-parser.c
/qemu/qom/cpu.c
/qemu/roms/QemuMacDrivers
/qemu/roms/SLOF
/qemu/roms/ipxe
/qemu/scripts/archive-source.sh
/qemu/scripts/checkpatch.pl
/qemu/scripts/decodetree.py
/qemu/scripts/device-crash-test
/qemu/scripts/qapi/events.py
/qemu/scripts/qemu-trace-stap
/qemu/scripts/qemu-trace-stap.texi
/qemu/scripts/qtest.py
/qemu/scripts/render_block_graph.py
/qemu/scripts/tracetool/__init__.py
/qemu/scripts/tracetool/format/log_stap.py
/qemu/stubs/monitor.c
/qemu/target/arm/arm-powerctl.c
/qemu/target/arm/cpu.c
/qemu/target/arm/cpu.h
/qemu/target/arm/cpu64.c
/qemu/target/arm/helper.c
/qemu/target/arm/translate-a64.c
/qemu/target/i386/cpu.c
/qemu/target/i386/hvf/hvf.c
/qemu/target/m68k/cpu.h
/qemu/target/m68k/fpu_helper.c
/qemu/target/m68k/gdbstub.c
/qemu/target/m68k/helper.c
/qemu/target/m68k/op_helper.c
/qemu/target/m68k/translate.c
/qemu/target/microblaze/cpu.c
/qemu/target/microblaze/cpu.h
/qemu/target/microblaze/op_helper.c
/qemu/target/mips/cpu.h
/qemu/target/mips/translate.c
/qemu/target/mips/translate_init.inc.c
/qemu/target/openrisc/cpu.c
/qemu/target/openrisc/exception.h
/qemu/target/openrisc/gdbstub.c
/qemu/target/openrisc/helper.h
/qemu/target/openrisc/interrupt_helper.c
/qemu/target/openrisc/sys_helper.c
/qemu/target/openrisc/translate.c
/qemu/target/ppc/cpu.h
/qemu/target/ppc/int_helper.c
/qemu/target/ppc/internal.h
/qemu/target/ppc/kvm.c
/qemu/target/ppc/translate_init.inc.c
/qemu/target/s390x/cc_helper.c
/qemu/target/s390x/excp_helper.c
/qemu/target/s390x/fpu_helper.c
/qemu/target/s390x/gdbstub.c
/qemu/target/s390x/helper.c
/qemu/target/s390x/int_helper.c
/qemu/target/s390x/mem_helper.c
/qemu/target/s390x/misc_helper.c
/qemu/target/s390x/translate.c
/qemu/target/tricore/cpu-qom.h
/qemu/target/tricore/cpu.c
/qemu/target/tricore/cpu.h
/qemu/target/tricore/fpu_helper.c
/qemu/target/tricore/helper.c
/qemu/target/tricore/helper.h
/qemu/target/tricore/op_helper.c
/qemu/target/tricore/translate.c
/qemu/target/tricore/tricore-defs.h
/qemu/target/tricore/tricore-opcodes.h
/qemu/target/xtensa/Makefile.objs
/qemu/target/xtensa/cpu.h
/qemu/target/xtensa/dbg_helper.c
/qemu/target/xtensa/exc_helper.c
/qemu/target/xtensa/fpu_helper.c
/qemu/target/xtensa/helper.c
/qemu/target/xtensa/helper.h
/qemu/target/xtensa/mmu_helper.c
/qemu/target/xtensa/op_helper.c
/qemu/target/xtensa/overlay_tool.h
/qemu/target/xtensa/translate.c
/qemu/target/xtensa/win_helper.c
/qemu/tcg/README
/qemu/tcg/aarch64/tcg-target.h
/qemu/tcg/aarch64/tcg-target.inc.c
/qemu/tcg/arm/tcg-target.inc.c
/qemu/tcg/i386/tcg-target.h
/qemu/tcg/i386/tcg-target.inc.c
/qemu/tcg/mips/tcg-target.inc.c
/qemu/tcg/ppc/tcg-target.inc.c
/qemu/tcg/riscv/tcg-target.inc.c
/qemu/tcg/s390/tcg-target.inc.c
/qemu/tcg/sparc/tcg-target.inc.c
/qemu/tcg/tcg-gvec-desc.h
/qemu/tcg/tcg-op-gvec.c
/qemu/tcg/tcg-op-gvec.h
/qemu/tcg/tcg-op-vec.c
/qemu/tcg/tcg-op.h
/qemu/tcg/tcg-opc.h
/qemu/tcg/tcg.c
/qemu/tcg/tcg.h
/qemu/tests/Makefile.include
/qemu/tests/boot-order-test.c
/qemu/tests/check-qjson.c
/qemu/tests/docker/test-mingw
/qemu/tests/endianness-test.c
/qemu/tests/fp/Makefile
/qemu/tests/fp/berkeley-testfloat-3
/qemu/tests/fp/fp-bench.c
/qemu/tests/fp/fp-test.c
/qemu/tests/fp/platform.h
/qemu/tests/hexloader-test.c
/qemu/tests/libqtest.c
/qemu/tests/libqtest.h
/qemu/tests/microbit-test.c
/qemu/tests/pnv-xscom-test.c
/qemu/tests/qemu-iotests/141.out
/qemu/tests/qemu-iotests/147
/qemu/tests/qemu-iotests/223
/qemu/tests/qemu-iotests/223.out
/qemu/tests/qemu-iotests/229
/qemu/tests/qemu-iotests/229.out
/qemu/tests/qemu-iotests/233
/qemu/tests/qemu-iotests/233.out
/qemu/tests/qemu-iotests/234
/qemu/tests/qemu-iotests/234.out
/qemu/tests/qemu-iotests/236.out
/qemu/tests/qemu-iotests/237
/qemu/tests/qemu-iotests/237.out
/qemu/tests/qemu-iotests/238
/qemu/tests/qemu-iotests/238.out
/qemu/tests/qemu-iotests/239
/qemu/tests/qemu-iotests/239.out
/qemu/tests/qemu-iotests/240
/qemu/tests/qemu-iotests/240.out
/qemu/tests/qemu-iotests/check
/qemu/tests/qemu-iotests/common.filter
/qemu/tests/qemu-iotests/group
/qemu/tests/qemu-iotests/iotests.py
/qemu/tests/qemu-iotests/sample_images/simple-dmg.dmg.bz2
/qemu/tests/tcg/mips/user/ase/dsp/Makefile
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_absq_s_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_absq_s_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_addq_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_addq_s_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_addq_s_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_addsc.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_addu_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_addu_s_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_addwc.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_bitrev.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_bposge32.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_cmp_eq_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_cmp_le_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_cmp_lt_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_cmpgu_eq_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_cmpgu_le_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_cmpgu_lt_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_cmpu_eq_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_cmpu_le_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_cmpu_lt_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_dpaq_s_w_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_dpaq_sa_l_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_dpau_h_qbl.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_dpau_h_qbr.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_dpsq_s_w_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_dpsq_sa_l_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_dpsu_h_qbl.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_dpsu_h_qbr.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_extp.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_extpdp.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_extpdpv.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_extpv.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_extr_r_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_extr_rs_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_extr_s_h.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_extr_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_extrv_r_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_extrv_rs_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_extrv_s_h.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_extrv_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_insv.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_lbux.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_lhx.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_lwx.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_madd.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_maddu.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_main.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_maq_s_w_phl.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_maq_s_w_phr.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_maq_sa_w_phl.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_maq_sa_w_phr.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_mfhi.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_mflo.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_modsub.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_msub.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_msubu.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_mthi.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_mthlip.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_mtlo.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_muleq_s_w_phl.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_muleq_s_w_phr.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_muleu_s_ph_qbl.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_muleu_s_ph_qbr.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_mulq_rs_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_mult.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_multu.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_packrl_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_pick_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_pick_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_preceq_w_phl.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_preceq_w_phr.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_precequ_ph_qbl.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_precequ_ph_qbla.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_precequ_ph_qbr.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_precequ_ph_qbra.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_preceu_ph_qbl.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_preceu_ph_qbla.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_preceu_ph_qbr.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_preceu_ph_qbra.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_precrq_ph_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_precrq_qb_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_precrq_rs_ph_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_precrqu_s_qb_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_raddu_w_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_rddsp.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_repl_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_repl_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_replv_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_replv_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shilo.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shilov.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shll_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shll_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shll_s_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shll_s_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shllv_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shllv_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shllv_s_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shllv_s_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shra_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shra_r_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shra_r_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shrav_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shrav_r_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shrav_r_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shrl_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_shrlv_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_subq_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_subq_s_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_subq_s_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_subu_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_subu_s_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r1_wrdsp.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_absq_s_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_addqh_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_addqh_r_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_addqh_r_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_addqh_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_addu_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_addu_s_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_adduh_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_adduh_r_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_append.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_balign.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_cmpgdu_eq_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_cmpgdu_le_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_cmpgdu_lt_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_dpa_w_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_dpaqx_s_w_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_dpaqx_sa_w_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_dpax_w_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_dps_w_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_dpsqx_s_w_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_dpsqx_sa_w_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_dpsx_w_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_mul_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_mul_s_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_mulq_rs_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_mulq_s_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_mulq_s_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_mulsa_w_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_mulsaq_s_w_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_precr_qb_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_precr_sra_ph_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_precr_sra_r_ph_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_prepend.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_shra_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_shra_r_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_shrav_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_shrav_r_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_shrl_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_shrlv_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_subqh_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_subqh_r_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_subqh_r_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_subqh_w.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_subu_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_subu_s_ph.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_subuh_qb.c
/qemu/tests/tcg/mips/user/ase/dsp/test_dsp_r2_subuh_r_qb.c
/qemu/tests/tcg/mips/user/isa/r5900/Makefile
/qemu/tests/tcg/mips/user/isa/r5900/test_r5900_div1.c
/qemu/tests/tcg/mips/user/isa/r5900/test_r5900_divu1.c
/qemu/tests/tcg/mips/user/isa/r5900/test_r5900_madd.c
/qemu/tests/tcg/mips/user/isa/r5900/test_r5900_maddu.c
/qemu/tests/tcg/mips/user/isa/r5900/test_r5900_mflohi1.c
/qemu/tests/tcg/mips/user/isa/r5900/test_r5900_mtlohi1.c
/qemu/tests/tcg/mips/user/isa/r5900/test_r5900_mult.c
/qemu/tests/tcg/mips/user/isa/r5900/test_r5900_multu.c
/qemu/tests/test-block-iothread.c
/qemu/tests/test-filter-mirror.c
/qemu/tests/test-io-channel-socket.c
/qemu/tests/test-qmp-event.c
/qemu/tests/test-vmstate.c
/qemu/tests/vmgenid-test.c
/qemu/trace-events
/qemu/ui/Makefile.objs
/qemu/ui/egl-helpers.c
/qemu/ui/gtk-egl.c
/qemu/ui/gtk.c
/qemu/ui/icons/Makefile
/qemu/ui/icons/qemu.svg
/qemu/ui/icons/qemu_128x128.png
/qemu/ui/icons/qemu_16x16.png
/qemu/ui/icons/qemu_24x24.png
/qemu/ui/icons/qemu_256x256.png
/qemu/ui/icons/qemu_32x32.bmp
/qemu/ui/icons/qemu_32x32.png
/qemu/ui/icons/qemu_48x48.png
/qemu/ui/icons/qemu_512x512.png
/qemu/ui/icons/qemu_64x64.png
/qemu/ui/input-linux.c
/qemu/ui/qemu.desktop
/qemu/ui/sdl2.c
/qemu/ui/vnc.c
/qemu/util/main-loop.c
/qemu/util/mmap-alloc.c
/qemu/util/oslib-posix.c
/qemu/util/qemu-coroutine-sleep.c
/qemu/util/range.c
/qemu/util/uuid.c
/qemu/vl.c
7c6f5ddc17-Jan-2019 Eric Blake <eblake@redhat.com>

nbd/client: Work around 3.0 bug for listing meta contexts

Commit 3d068aff forgot to advertise available qemu: contexts
when the client requests a list with 0 queries. Furthermore,
3.0 shipped with a

nbd/client: Work around 3.0 bug for listing meta contexts

Commit 3d068aff forgot to advertise available qemu: contexts
when the client requests a list with 0 queries. Furthermore,
3.0 shipped with a qemu-img hack of x-dirty-bitmap (commit
216ee365) that _silently_ acts as though the entire image is
clean if a requested bitmap is not present. Both bugs have
been recently fixed, so that a modern qemu server gives full
context output right away, and the client refuses a
connection if a requested x-dirty-bitmap was not found.

Still, it is likely that there will be users that have to
work with a mix of old and new qemu versions, depending on
which features get backported where, at which point being
able to rely on 'qemu-img --list' output to know for sure
whether a given NBD export has the desired dirty bitmap is
much nicer than blindly connecting and risking that the
entire image may appear clean. We can make our --list code
smart enough to work around buggy servers by tracking
whether we've seen any qemu: replies in the original 0-query
list; if not, repeat with a single query on "qemu:" (which
may still have no replies, but then we know for sure we
didn't trip up on the server bug).

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20190117193658.16413-21-eblake@redhat.com>

show more ...

0b576b6b17-Jan-2019 Eric Blake <eblake@redhat.com>

nbd/client: Add meta contexts to nbd_receive_export_list()

We want to be able to detect whether a given qemu NBD server is
exposing the right export(s) and dirty bitmaps, at least for
regression tes

nbd/client: Add meta contexts to nbd_receive_export_list()

We want to be able to detect whether a given qemu NBD server is
exposing the right export(s) and dirty bitmaps, at least for
regression testing. We could use 'nbd-client -l' from the upstream
NBD project to list exports, but it's annoying to rely on
out-of-tree binaries; furthermore, nbd-client doesn't necessarily
know about all of the qemu NBD extensions. Thus, we plan on adding
a new mode to qemu-nbd that merely sniffs all possible information
from the server during handshake phase, then disconnects and dumps
the information.

This patch continues the work of the previous patch, by adding the
ability to track the list of available meta contexts into
NBDExportInfo. It benefits from the recent refactoring patches
with a new nbd_list_meta_contexts() that reuses much of the same
framework as setting a meta context.

Note: a malicious server could exhaust memory of a client by feeding
an unending loop of contexts; perhaps we could place a limit on how
many we are willing to receive. But this is no different from our
earlier analysis on a server sending an unending list of exports,
and the death of a client due to memory exhaustion when the client
was going to exit soon anyways is not really a denial of service
attack.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20190117193658.16413-19-eblake@redhat.com>

show more ...

d21a2d3417-Jan-2019 Eric Blake <eblake@redhat.com>

nbd/client: Add nbd_receive_export_list()

We want to be able to detect whether a given qemu NBD server is
exposing the right export(s) and dirty bitmaps, at least for
regression testing. We could u

nbd/client: Add nbd_receive_export_list()

We want to be able to detect whether a given qemu NBD server is
exposing the right export(s) and dirty bitmaps, at least for
regression testing. We could use 'nbd-client -l' from the upstream
NBD project to list exports, but it's annoying to rely on
out-of-tree binaries; furthermore, nbd-client doesn't necessarily
know about all of the qemu NBD extensions. Thus, we plan on adding
a new mode to qemu-nbd that merely sniffs all possible information
from the server during handshake phase, then disconnects and dumps
the information.

This patch adds the low-level client code for grabbing the list
of exports. It benefits from the recent refactoring patches, in
order to share as much code as possible when it comes to doing
validation of server replies. The resulting information is stored
in an array of NBDExportInfo which has been expanded to any
description string, along with a convenience function for freeing
the list.

Note: a malicious server could exhaust memory of a client by feeding
an unending loop of exports; perhaps we should place a limit on how
many we are willing to receive. But note that a server could
reasonably be serving an export for every file in a large directory,
where an arbitrary limit in the client means we can't list anything
from such a server; the same happens if we just run until the client
fails to malloc() and thus dies by an abort(), where the limit is
no longer arbitrary but determined by available memory. Since the
client is already planning on being short-lived, it's hard to call
this a denial of service attack that would starve off other uses,
so it does not appear to be a security issue.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Message-Id: <20190117193658.16413-18-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

show more ...

138796d017-Jan-2019 Eric Blake <eblake@redhat.com>

nbd/client: Refactor nbd_opt_go() to support NBD_OPT_INFO

Rename the function to nbd_opt_info_or_go() with an added parameter
and slight changes to comments and trace messages, in order to
reuse the

nbd/client: Refactor nbd_opt_go() to support NBD_OPT_INFO

Rename the function to nbd_opt_info_or_go() with an added parameter
and slight changes to comments and trace messages, in order to
reuse the function for NBD_OPT_INFO.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190117193658.16413-17-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

show more ...

b3c9d33b17-Jan-2019 Eric Blake <eblake@redhat.com>

nbd/client: Pull out oldstyle size determination

Another refactoring creating nbd_negotiate_finish_oldstyle()
for further reuse during 'qemu-nbd --list'.

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

nbd/client: Pull out oldstyle size determination

Another refactoring creating nbd_negotiate_finish_oldstyle()
for further reuse during 'qemu-nbd --list'.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Message-Id: <20190117193658.16413-16-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

show more ...

10b8998817-Jan-2019 Eric Blake <eblake@redhat.com>

nbd/client: Split handshake into two functions

An upcoming patch will add the ability for qemu-nbd to list
the services provided by an NBD server. Share the common
code of the TLS handshake by spli

nbd/client: Split handshake into two functions

An upcoming patch will add the ability for qemu-nbd to list
the services provided by an NBD server. Share the common
code of the TLS handshake by splitting the initial exchange
into a separate function, leaving only the export handling
in the original function. Functionally, there should be no
change in behavior in this patch, although some of the code
motion may be difficult to follow due to indentation changes
(view with 'git diff -w' for a smaller changeset).

I considered an enum for the return code coordinating state
between the two functions, but in the end just settled with
ample comments.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20190117193658.16413-15-eblake@redhat.com>

show more ...

2b8d095417-Jan-2019 Eric Blake <eblake@redhat.com>

nbd/client: Refactor return of nbd_receive_negotiate()

The function could only ever return 0 or -EINVAL; make this
clearer by dropping a useless 'fail:' label.

Signed-off-by: Eric Blake <eblake@red

nbd/client: Refactor return of nbd_receive_negotiate()

The function could only ever return 0 or -EINVAL; make this
clearer by dropping a useless 'fail:' label.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20190117193658.16413-14-eblake@redhat.com>

show more ...

0182c1ae17-Jan-2019 Eric Blake <eblake@redhat.com>

nbd/client: Split out nbd_receive_one_meta_context()

Extract portions of nbd_negotiate_simple_meta_context() to
a new function nbd_receive_one_meta_context() that copies the
pattern of nbd_receive_l

nbd/client: Split out nbd_receive_one_meta_context()

Extract portions of nbd_negotiate_simple_meta_context() to
a new function nbd_receive_one_meta_context() that copies the
pattern of nbd_receive_list() for performing the argument
validation of one reply. The error message when the server
replies with more than one context changes slightly, but
that shouldn't happen in the common case.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20190117193658.16413-13-eblake@redhat.com>

show more ...

757b3ab917-Jan-2019 Eric Blake <eblake@redhat.com>

nbd/client: Split out nbd_send_meta_query()

Refactor nbd_negotiate_simple_meta_context() to pull out the
code that can be reused to send a LIST request for 0 or 1 query.
No semantic change. The old

nbd/client: Split out nbd_send_meta_query()

Refactor nbd_negotiate_simple_meta_context() to pull out the
code that can be reused to send a LIST request for 0 or 1 query.
No semantic change. The old comment about 'sizeof(uint32_t)'
being equivalent to '/* number of queries */' is no longer
needed, now that we are computing 'sizeof(queries)' instead.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Message-Id: <20190117193658.16413-12-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

show more ...

2df94eb517-Jan-2019 Eric Blake <eblake@redhat.com>

nbd/client: Change signature of nbd_negotiate_simple_meta_context()

Pass 'info' instead of three separate parameters related to info,
when requesting the server to set the meta context. Update the

nbd/client: Change signature of nbd_negotiate_simple_meta_context()

Pass 'info' instead of three separate parameters related to info,
when requesting the server to set the meta context. Update the
NBDExportInfo struct to rename the received id field to match the
fact that we are currently overloading the field to match whatever
context the user supplied through the x-dirty-bitmap hack, as well
as adding a TODO comment to remind future patches about a desire
to request two contexts at once.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20190117193658.16413-11-eblake@redhat.com>

show more ...

6dc1667d17-Jan-2019 Eric Blake <eblake@redhat.com>

nbd/client: Move export name into NBDExportInfo

Refactor the 'name' parameter of nbd_receive_negotiate() from
being a separate parameter into being part of the in-out 'info'.
This also spills over t

nbd/client: Move export name into NBDExportInfo

Refactor the 'name' parameter of nbd_receive_negotiate() from
being a separate parameter into being part of the in-out 'info'.
This also spills over to a simplification of nbd_opt_go().

The main driver for this refactoring is that an upcoming patch
would like to add support to qemu-nbd to list information about
all exports available on a server, where the name(s) will be
provided by the server instead of the client. But another benefit
is that we can now allow the client to explicitly specify the
empty export name "" even when connecting to an oldstyle server
(even if qemu is no longer such a server after commit 7f7dfe2a).

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20190117193658.16413-10-eblake@redhat.com>

show more ...

091d0bf317-Jan-2019 Eric Blake <eblake@redhat.com>

nbd/client: Refactor nbd_receive_list()

Right now, nbd_receive_list() is only called by
nbd_receive_query_exports(), which in turn is only called if the
server lacks NBD_OPT_GO but has working optio

nbd/client: Refactor nbd_receive_list()

Right now, nbd_receive_list() is only called by
nbd_receive_query_exports(), which in turn is only called if the
server lacks NBD_OPT_GO but has working option negotiation, and is
merely used as a quality-of-implementation trick since servers
can't give decent errors for NBD_OPT_EXPORT_NAME. However, servers
that lack NBD_OPT_GO are becoming increasingly rare (nbdkit was a
latecomer, in Aug 2018, but qemu has been such a server since commit
f37708f6 in July 2017 and released in 2.10), so it no longer makes
sense to micro-optimize that function for performance.

Furthermore, when debugging a server's implementation, tracing the
full reply (both names and descriptions) is useful, not to mention
that upcoming patches adding 'qemu-nbd --list' will want to collect
that data. And when you consider that a server can send an export
name up to the NBD protocol length limit of 4k; but our current
NBD_MAX_NAME_SIZE is only 256, we can't trace all valid server
names without more storage, but 4k is large enough that the heap
is better than the stack for long names.

Thus, I'm changing the division of labor, with nbd_receive_list()
now always malloc'ing a result on success (the malloc is bounded
by the fact that we reject servers with a reply length larger
than 32M), and moving the comparison to 'wantname' to the caller.

There is a minor change in behavior where a server with 0 exports
(an immediate NBD_REP_ACK reply) is now no longer distinguished
from a server without LIST support (NBD_REP_ERR_UNSUP); this
information could be preserved with a complication to the calling
contract to provide a bit more information, but I didn't see the
point. After all, the worst that can happen if our guess at a
match is wrong is that the caller will get a cryptic disconnect
when NBD_OPT_EXPORT_NAME fails (which is no different from what
would happen if we had not tried LIST), while treating an empty
list as immediate failure would prevent connecting to really old
servers that really did lack LIST. Besides, NBD servers with 0
exports are rare (qemu can do it when using QMP nbd-server-start
without nbd-server-add - but qemu understands NBD_OPT_GO and
thus won't tickle this change in behavior).

Fix the spelling of foundExport to match coding standards while
in the area.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20190117193658.16413-9-eblake@redhat.com>

show more ...

9d26dfcb17-Jan-2019 Eric Blake <eblake@redhat.com>

nbd/server: Favor [u]int64_t over off_t

Although our compile-time environment is set up so that we always
support long files with 64-bit off_t, we have no guarantee whether
off_t is the same type as

nbd/server: Favor [u]int64_t over off_t

Although our compile-time environment is set up so that we always
support long files with 64-bit off_t, we have no guarantee whether
off_t is the same type as int64_t. This requires casts when
printing values, and prevents us from directly using qemu_strtoi64()
(which will be done in the next patch). Let's just flip to uint64_t
where possible, and stick to int64_t for detecting failure of
blk_getlength(); we also keep the assertions added in the previous
patch that the resulting values fit in 63 bits. The overflow check
in nbd_co_receive_request() was already sane (request->from is
validated to fit in 63 bits, and request->len is 32 bits, so the
addition can't overflow 64 bits), but rewrite it in a form easier
to recognize as a typical overflow check.

Rename the variable 'description' to keep line lengths reasonable.

Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190117193658.16413-7-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

show more ...

7596bbb317-Jan-2019 Eric Blake <eblake@redhat.com>

nbd/server: Hoist length check to qmp_nbd_server_add

We only had two callers to nbd_export_new; qemu-nbd.c always
passed a valid offset/length pair (because it already checked
the file length, to en

nbd/server: Hoist length check to qmp_nbd_server_add

We only had two callers to nbd_export_new; qemu-nbd.c always
passed a valid offset/length pair (because it already checked
the file length, to ensure that offset was in bounds), while
blockdev-nbd.c always passed 0/-1. Then nbd_export_new reduces
the size to a multiple of BDRV_SECTOR_SIZE (can only happen
when offset is not sector-aligned, since bdrv_getlength()
currently rounds up) (someday, it would be nice to have
byte-accurate lengths - but not today).

However, I'm finding it easier to work with the code if we are
consistent on having both callers pass in a valid length, and
just assert that things are sane in nbd_export_new, meaning
that no negative values were passed, and that offset+size does
not exceed 63 bits (as that really is a fundamental limit to
later operations, whether we use off_t or uint64_t).

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190117193658.16413-6-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

show more ...


/qemu/.travis.yml
/qemu/Makefile
/qemu/Makefile.objs
/qemu/Makefile.target
/qemu/block/backup.c
/qemu/block/dirty-bitmap.c
/qemu/block/mirror.c
/qemu/block/sheepdog.c
/qemu/blockdev-nbd.c
/qemu/configure
/qemu/default-configs/virtio.mak
/qemu/docs/devel/migration.rst
/qemu/docs/specs/ivshmem-spec.txt
/qemu/docs/specs/tpm.txt
/qemu/hw/acpi/Makefile.objs
/qemu/hw/acpi/core.c
/qemu/hw/acpi/memory_hotplug.c
/qemu/hw/acpi/tpm.c
/qemu/hw/arm/virt-acpi-build.c
/qemu/hw/block/vhost-user-blk.c
/qemu/hw/block/xen-block.c
/qemu/hw/char/stm32f2xx_usart.c
/qemu/hw/core/machine.c
/qemu/hw/display/virtio-gpu-pci.c
/qemu/hw/display/virtio-vga.c
/qemu/hw/i386/acpi-build.c
/qemu/hw/i386/pc_piix.c
/qemu/hw/mips/cps.c
/qemu/hw/misc/edu.c
/qemu/hw/misc/ivshmem.c
/qemu/hw/misc/mips_itu.c
/qemu/hw/net/ftgmac100.c
/qemu/hw/net/virtio-net.c
/qemu/hw/pci/msix.c
/qemu/hw/pci/pcie.c
/qemu/hw/pci/pcie_port.c
/qemu/hw/s390x/s390-pci-bus.c
/qemu/hw/s390x/s390-pci-bus.h
/qemu/hw/s390x/s390-pci-inst.c
/qemu/hw/s390x/s390-pci-inst.h
/qemu/hw/scsi/vhost-scsi.c
/qemu/hw/scsi/vhost-user-scsi.c
/qemu/hw/tpm/Makefile.objs
/qemu/hw/tpm/tpm_crb.c
/qemu/hw/tpm/tpm_ppi.c
/qemu/hw/tpm/tpm_ppi.h
/qemu/hw/tpm/tpm_tis.c
/qemu/hw/tpm/trace-events
/qemu/hw/virtio/Makefile.objs
/qemu/hw/virtio/vhost-scsi-pci.c
/qemu/hw/virtio/vhost-user-blk-pci.c
/qemu/hw/virtio/vhost-user-scsi-pci.c
/qemu/hw/virtio/vhost-user.c
/qemu/hw/virtio/vhost-vsock-pci.c
/qemu/hw/virtio/virtio-9p-pci.c
/qemu/hw/virtio/virtio-balloon-pci.c
/qemu/hw/virtio/virtio-balloon.c
/qemu/hw/virtio/virtio-blk-pci.c
/qemu/hw/virtio/virtio-crypto-pci.c
/qemu/hw/virtio/virtio-input-host-pci.c
/qemu/hw/virtio/virtio-input-pci.c
/qemu/hw/virtio/virtio-net-pci.c
/qemu/hw/virtio/virtio-pci.c
/qemu/hw/virtio/virtio-pci.h
/qemu/hw/virtio/virtio-rng-pci.c
/qemu/hw/virtio/virtio-scsi-pci.c
/qemu/hw/virtio/virtio-serial-pci.c
/qemu/include/block/dirty-bitmap.h
/qemu/include/glib-compat.h
/qemu/include/hw/acpi/acpi-defs.h
/qemu/include/hw/acpi/tpm.h
/qemu/include/hw/misc/mips_itu.h
/qemu/include/hw/pci/pcie.h
/qemu/include/hw/qdev-core.h
/qemu/include/hw/virtio/virtio-net.h
/qemu/include/migration/vmstate.h
/qemu/include/net/eth.h
/qemu/include/qemu/compiler.h
/qemu/include/qemu/hbitmap.h
/qemu/migration/global_state.c
/qemu/migration/vmstate.c
server.c
/qemu/net/colo-compare.c
/qemu/net/colo.c
/qemu/net/colo.h
/qemu/net/filter-rewriter.c
/qemu/net/slirp.c
/qemu/net/util.h
/qemu/pc-bios/s390-ccw/start.S
/qemu/qemu-deprecated.texi
/qemu/qemu-nbd.c
/qemu/qemu-nbd.texi
/qemu/qom/object.c
/qemu/scripts/analyse-locks-simpletrace.py
/qemu/scripts/analyze-migration.py
/qemu/scripts/device-crash-test
/qemu/scripts/qemu.py
/qemu/scripts/replay-dump.py
/qemu/scripts/simpletrace.py
/qemu/scripts/texi2pod.pl
/qemu/scripts/tracetool.py
/qemu/scripts/tracetool/format/simpletrace_stap.py
/qemu/slirp/Makefile.objs
/qemu/slirp/arp_table.c
/qemu/slirp/bootp.c
/qemu/slirp/cksum.c
/qemu/slirp/debug.h
/qemu/slirp/dhcpv6.c
/qemu/slirp/if.c
/qemu/slirp/ip.h
/qemu/slirp/ip6.h
/qemu/slirp/ip6_icmp.c
/qemu/slirp/ip6_icmp.h
/qemu/slirp/ip6_input.c
/qemu/slirp/ip6_output.c
/qemu/slirp/ip_icmp.c
/qemu/slirp/ip_input.c
/qemu/slirp/libslirp.h
/qemu/slirp/main.h
/qemu/slirp/mbuf.c
/qemu/slirp/mbuf.h
/qemu/slirp/misc.c
/qemu/slirp/misc.h
/qemu/slirp/ncsi.c
/qemu/slirp/ndp_table.c
/qemu/slirp/sbuf.h
/qemu/slirp/slirp.c
/qemu/slirp/slirp.h
/qemu/slirp/socket.c
/qemu/slirp/socket.h
/qemu/slirp/tcp.h
/qemu/slirp/tcp_input.c
/qemu/slirp/tcp_output.c
/qemu/slirp/tcp_subr.c
/qemu/slirp/tcp_timer.c
/qemu/slirp/tftp.c
/qemu/slirp/trace-events
/qemu/slirp/udp.c
/qemu/slirp/udp6.c
/qemu/stubs/slirp.c
/qemu/stubs/tpm.c
/qemu/target/arm/Makefile.objs
/qemu/target/arm/cpu.c
/qemu/target/arm/cpu.h
/qemu/target/arm/cpu64.c
/qemu/target/arm/helper-a64.c
/qemu/target/arm/helper-a64.h
/qemu/target/arm/helper.c
/qemu/target/arm/helper.h
/qemu/target/arm/internals.h
/qemu/target/arm/machine.c
/qemu/target/arm/op_helper.c
/qemu/target/arm/pauth_helper.c
/qemu/target/arm/translate-a64.c
/qemu/target/arm/translate.h
/qemu/target/mips/cpu.h
/qemu/target/mips/helper.h
/qemu/target/mips/internal.h
/qemu/target/mips/machine.c
/qemu/target/mips/op_helper.c
/qemu/target/mips/translate.c
/qemu/target/s390x/diag.c
/qemu/tests/Makefile.include
/qemu/tests/acceptance/linux_initrd.py
/qemu/tests/acpi-utils.c
/qemu/tests/acpi-utils.h
/qemu/tests/bios-tables-test.c
/qemu/tests/data/acpi/pc/DSDT.dimmpxm
/qemu/tests/data/acpi/pc/DSDT.memhp
/qemu/tests/data/acpi/q35/DSDT.dimmpxm
/qemu/tests/data/acpi/q35/DSDT.memhp
/qemu/tests/data/acpi/q35/DSDT.mmio64
/qemu/tests/ivshmem-test.c
/qemu/tests/qemu-iotests/233
/qemu/tests/qemu-iotests/233.out
/qemu/tests/test-hbitmap.c
/qemu/tests/vhost-user-test.c
/qemu/tests/vmgenid-test.c
/qemu/util/hbitmap.c
/qemu/util/oslib-posix.c
76d570dc15-Jan-2019 Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

dirty-bitmap: improve bdrv_dirty_bitmap_next_zero

Add bytes parameter to the function, to limit searched range.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>


/qemu/.travis.yml
/qemu/MAINTAINERS
/qemu/block/backup.c
/qemu/block/dirty-bitmap.c
/qemu/configure
/qemu/contrib/gitdm/domain-map
/qemu/contrib/gitdm/group-map-ibm
/qemu/contrib/gitdm/group-map-wavecomp
/qemu/hw/9pfs/xen-9p-backend.c
/qemu/hw/block/Makefile.objs
/qemu/hw/block/dataplane/Makefile.objs
/qemu/hw/block/dataplane/xen-block.c
/qemu/hw/block/dataplane/xen-block.h
/qemu/hw/block/trace-events
/qemu/hw/block/xen-block.c
/qemu/hw/char/xen_console.c
/qemu/hw/display/xenfb.c
/qemu/hw/i386/pc.c
/qemu/hw/i386/xen/xen-hvm.c
/qemu/hw/i386/xen/xen-mapcache.c
/qemu/hw/i386/xen/xen_platform.c
/qemu/hw/net/xen_nic.c
/qemu/hw/usb/xen-usb.c
/qemu/hw/xen/Makefile.objs
/qemu/hw/xen/trace-events
/qemu/hw/xen/xen-backend.c
/qemu/hw/xen/xen-bus-helper.c
/qemu/hw/xen/xen-bus.c
/qemu/hw/xen/xen-common.c
/qemu/hw/xen/xen-legacy-backend.c
/qemu/hw/xen/xen_devconfig.c
/qemu/hw/xen/xen_pt.c
/qemu/hw/xen/xen_pt_config_init.c
/qemu/hw/xen/xen_pt_graphics.c
/qemu/hw/xen/xen_pt_msi.c
/qemu/hw/xen/xen_pvdev.c
/qemu/hw/xenpv/Makefile.objs
/qemu/hw/xenpv/xen_machine_pv.c
/qemu/include/block/dirty-bitmap.h
/qemu/include/hw/xen/xen-backend.h
/qemu/include/hw/xen/xen-block.h
/qemu/include/hw/xen/xen-bus-helper.h
/qemu/include/hw/xen/xen-bus.h
/qemu/include/hw/xen/xen-legacy-backend.h
/qemu/include/hw/xen/xen.h
/qemu/include/hw/xen/xen_common.h
/qemu/include/hw/xen/xen_pvdev.h
/qemu/include/qemu/hbitmap.h
/qemu/include/qemu/module.h
server.c
/qemu/qemu-doc.texi
/qemu/qemu-nbd.c
/qemu/qemu-nbd.texi
/qemu/qemu-options.hx
/qemu/target/i386/cpu.c
/qemu/target/i386/cpu.h
/qemu/target/i386/kvm.c
/qemu/tests/Makefile.include
/qemu/tests/atomic64-bench.c
/qemu/tests/atomic_add-bench.c
/qemu/tests/docker/Makefile.include
/qemu/tests/docker/dockerfiles/debian-amd64.docker
/qemu/tests/docker/dockerfiles/debian-sid.docker
/qemu/tests/docker/dockerfiles/fedora-i386-cross.docker
/qemu/tests/docker/dockerfiles/fedora.docker
/qemu/tests/docker/dockerfiles/travis.docker
/qemu/tests/qemu-iotests/223
/qemu/tests/qemu-iotests/223.out
/qemu/tests/qht-bench.c
/qemu/tests/test-hbitmap.c
/qemu/util/aio-posix.c
/qemu/util/aio-win32.c
/qemu/util/hbitmap.c
/qemu/vl.c
678ba27511-Jan-2019 Eric Blake <eblake@redhat.com>

nbd: Merge nbd_export_bitmap into nbd_export_new

We only have one caller that wants to export a bitmap name,
which it does right after creation of the export. But there is
still a brief window of ti

nbd: Merge nbd_export_bitmap into nbd_export_new

We only have one caller that wants to export a bitmap name,
which it does right after creation of the export. But there is
still a brief window of time where an NBD client could see the
export but not the dirty bitmap, which a robust client would
have to interpret as meaning the entire image should be treated
as dirty. Better is to eliminate the window entirely, by
inlining nbd_export_bitmap() into nbd_export_new(), and refusing
to create the bitmap in the first place if the requested bitmap
can't be located.

We also no longer need logic for setting a different bitmap
name compared to the bitmap being exported.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20190111194720.15671-8-eblake@redhat.com>

show more ...

3fa4c76511-Jan-2019 Eric Blake <eblake@redhat.com>

nbd: Merge nbd_export_set_name into nbd_export_new

The existing NBD code had a weird split where nbd_export_new()
created an export but did not add it to the list of exported
names until a later nbd

nbd: Merge nbd_export_set_name into nbd_export_new

The existing NBD code had a weird split where nbd_export_new()
created an export but did not add it to the list of exported
names until a later nbd_export_set_name() came along and grabbed
a second reference on the object; later, the first call to
nbd_export_close() drops the second reference while removing
the export from the list. This is in part because the QAPI
NbdServerRemoveNode enum documents the possibility of adding a
mode where we could do a soft disconnect: preventing new clients,
but waiting for existing clients to gracefully quit, based on
the mode used when calling nbd_export_close().

But in spite of all that, note that we never change the name of
an NBD export while it is exposed, which means it is easier to
just inline the process of setting the name as part of creating
the export.

Inline the contents of nbd_export_set_name() and
nbd_export_set_description() into the two points in an export
lifecycle where they matter, then adjust both callers to pass
the name up front. Note that for creation, all callers pass a
non-NULL name, (passing NULL at creation was for old style
servers, but we removed support for that in commit 7f7dfe2a),
so we can add an assert and do things unconditionally; but for
cleanup, because of the dual nature of nbd_export_close(), we
still have to be careful to avoid use-after-free. Along the
way, add a comment reminding ourselves of the potential of
adding a middle mode disconnect.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20190111194720.15671-5-eblake@redhat.com>

show more ...

702aa50d11-Jan-2019 Eric Blake <eblake@redhat.com>

nbd: Only require disabled bitmap for read-only exports

Our initial implementation of x-nbd-server-add-bitmap put
in a restriction because of incremental backups: in that
usage, we are exporting one

nbd: Only require disabled bitmap for read-only exports

Our initial implementation of x-nbd-server-add-bitmap put
in a restriction because of incremental backups: in that
usage, we are exporting one qcow2 file (the temporary overlay
target of a blockdev-backup sync:none job) and a dirty bitmap
owned by a second qcow2 file (the source of the
blockdev-backup, which is the backing file of the temporary).
While both qcow2 files are still writable (the target in
order to capture copy-on-write of old contents, and the
source in order to track live guest writes in the meantime),
the NBD client expects to see constant data, including the
dirty bitmap. An enabled bitmap in the source would be
modified by guest writes, which is at odds with the NBD
export being a read-only constant view, hence the initial
code choice of enforcing a disabled bitmap (the intent is
that the exposed bitmap was disabled in the same transaction
that started the blockdev-backup job, although we don't want
to track enough state to actually enforce that).

However, consider the case of a bitmap contained in a read-only
node (including when the bitmap is found in a backing layer of
the active image). Because the node can't be modified, the
bitmap won't change due to writes, regardless of whether it is
still enabled. Forbidding the export unless the bitmap is
disabled is awkward, paritcularly since we can't change the
bitmap to be disabled (because the node is read-only).

Alternatively, consider the case of live storage migration,
where management directs the destination to create a writable
NBD server, then performs a drive-mirror from the source to
the target, prior to doing the rest of the live migration.
Since storage migration can be time-consuming, it may be wise
to let the destination include a dirty bitmap to track which
portions it has already received, where even if the migration
is interrupted and restarted, the source can query the
destination block status in order to potentially minimize
re-sending data that has not changed in the meantime on a
second attempt. Such code has not been written, and might not
be trivial (after all, a cluster being marked dirty in the
bitmap does not necessarily guarantee it has the desired
contents), but it makes sense that letting an active dirty
bitmap be exposed and changing alongside writes may prove
useful in the future.

Solve both issues by gating the restriction against a
disabled bitmap to only happen when the caller has requested
a read-only export, and where the BDS that owns the bitmap
(whether or not it is the BDS handed to nbd_export_new() or
from its backing chain) is still writable. We could drop
the check altogether (if management apps are prepared to
deal with a changing bitmap even on a read-only image), but
for now keeping a check for the read-only case still stands
a chance of preventing management errors.

Update iotest 223 to show the looser behavior by leaving
a bitmap enabled the whole run; note that we have to tear
down and re-export a node when handling an error.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190111194720.15671-4-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

show more ...


/qemu/MAINTAINERS
/qemu/Makefile
/qemu/Makefile.objs
/qemu/accel/accel.c
/qemu/accel/kvm/kvm-all.c
/qemu/accel/tcg/translate-all.c
/qemu/accel/tcg/user-exec.c
/qemu/backends/hostmem-file.c
/qemu/backends/hostmem-memfd.c
/qemu/backends/hostmem-ram.c
/qemu/backends/hostmem.c
/qemu/block/bochs.c
/qemu/block/dirty-bitmap.c
/qemu/block/dmg.c
/qemu/block/file-posix.c
/qemu/block/file-win32.c
/qemu/block/gluster.c
/qemu/block/iscsi.c
/qemu/block/linux-aio.c
/qemu/block/mirror.c
/qemu/block/nvme.c
/qemu/block/qcow2-bitmap.c
/qemu/block/qcow2-cluster.c
/qemu/block/qcow2.h
/qemu/block/sheepdog.c
/qemu/block/vhdx.h
/qemu/block/vpc.c
/qemu/blockdev-nbd.c
/qemu/blockdev.c
/qemu/bsd-user/elfload.c
/qemu/bsd-user/x86_64/target_syscall.h
/qemu/chardev/spice.c
/qemu/configure
/qemu/contrib/elf2dmp/main.c
/qemu/contrib/ivshmem-client/ivshmem-client.h
/qemu/contrib/ivshmem-server/ivshmem-server.h
/qemu/cpus-common.c
/qemu/cpus.c
/qemu/crypto/aes.c
/qemu/default-configs/riscv32-softmmu.mak
/qemu/default-configs/riscv64-softmmu.mak
/qemu/disas.c
/qemu/disas/alpha.c
/qemu/disas/arm.c
/qemu/disas/i386.c
/qemu/disas/m68k.c
/qemu/disas/microblaze.c
/qemu/disas/nanomips.cpp
/qemu/disas/nanomips.h
/qemu/dump.c
/qemu/exec.c
/qemu/fsdev/qemu-fsdev.c
/qemu/gdbstub.c
/qemu/hw/alpha/typhoon.c
/qemu/hw/arm/allwinner-a10.c
/qemu/hw/arm/armv7m.c
/qemu/hw/arm/boot.c
/qemu/hw/arm/nrf51_soc.c
/qemu/hw/arm/stellaris.c
/qemu/hw/arm/virt.c
/qemu/hw/arm/xlnx-versal-virt.c
/qemu/hw/arm/xlnx-zynqmp.c
/qemu/hw/audio/marvell_88w8618.c
/qemu/hw/block/nvme.h
/qemu/hw/block/xen_disk.c
/qemu/hw/char/sh_serial.c
/qemu/hw/char/virtio-serial-bus.c
/qemu/hw/char/xen_console.c
/qemu/hw/core/loader.c
/qemu/hw/core/machine.c
/qemu/hw/core/qdev-properties.c
/qemu/hw/core/qdev.c
/qemu/hw/core/reset.c
/qemu/hw/core/uboot_image.h
/qemu/hw/cpu/Makefile.objs
/qemu/hw/cpu/cluster.c
/qemu/hw/display/qxl.c
/qemu/hw/display/ramfb-standalone.c
/qemu/hw/display/tc6393xb.c
/qemu/hw/display/vga.c
/qemu/hw/display/virtio-gpu-3d.c
/qemu/hw/dma/pxa2xx_dma.c
/qemu/hw/dma/soc_dma.c
/qemu/hw/gpio/Makefile.objs
/qemu/hw/gpio/max7310.c
/qemu/hw/gpio/nrf51_gpio.c
/qemu/hw/gpio/trace-events
/qemu/hw/i2c/i2c-ddc.c
/qemu/hw/i386/kvm/ioapic.c
/qemu/hw/i386/pc.c
/qemu/hw/i386/pc_piix.c
/qemu/hw/i386/pc_q35.c
/qemu/hw/i386/xen/xen-hvm.c
/qemu/hw/i386/xen/xen-mapcache.c
/qemu/hw/ide/core.c
/qemu/hw/ide/pci.c
/qemu/hw/ide/piix.c
/qemu/hw/ide/via.c
/qemu/hw/input/lm832x.c
/qemu/hw/input/pckbd.c
/qemu/hw/input/tsc210x.c
/qemu/hw/intc/apic.c
/qemu/hw/intc/ioapic.c
/qemu/hw/intc/spapr_xive.c
/qemu/hw/intc/xics.c
/qemu/hw/intc/xics_kvm.c
/qemu/hw/intc/xics_spapr.c
/qemu/hw/intc/xive.c
/qemu/hw/mem/memory-device.c
/qemu/hw/microblaze/boot.c
/qemu/hw/mips/gt64xxx_pci.c
/qemu/hw/mips/mips_r4k.c
/qemu/hw/misc/Makefile.objs
/qemu/hw/misc/macio/mac_dbdma.c
/qemu/hw/misc/max111x.c
/qemu/hw/misc/nrf51_rng.c
/qemu/hw/misc/omap_l4.c
/qemu/hw/misc/tz-mpc.c
/qemu/hw/moxie/moxiesim.c
/qemu/hw/net/mipsnet.c
/qemu/hw/net/ne2000.c
/qemu/hw/net/rocker/rocker.c
/qemu/hw/net/virtio-net.c
/qemu/hw/net/vmxnet3.c
/qemu/hw/nios2/boot.c
/qemu/hw/nvram/fw_cfg.c
/qemu/hw/pci-host/pam.c
/qemu/hw/pci/msix.c
/qemu/hw/pci/pci.c
/qemu/hw/pci/pci_bridge.c
/qemu/hw/ppc/e500.c
/qemu/hw/ppc/pnv.c
/qemu/hw/ppc/pnv_core.c
/qemu/hw/ppc/pnv_psi.c
/qemu/hw/ppc/ppc405_uc.c
/qemu/hw/ppc/ppc440_bamboo.c
/qemu/hw/ppc/ppc4xx_devs.c
/qemu/hw/ppc/prep.c
/qemu/hw/ppc/sam460ex.c
/qemu/hw/ppc/spapr.c
/qemu/hw/ppc/spapr_cpu_core.c
/qemu/hw/ppc/spapr_hcall.c
/qemu/hw/ppc/spapr_iommu.c
/qemu/hw/ppc/spapr_irq.c
/qemu/hw/ppc/spapr_pci.c
/qemu/hw/ppc/trace-events
/qemu/hw/riscv/sifive_clint.c
/qemu/hw/riscv/sifive_e.c
/qemu/hw/riscv/sifive_plic.c
/qemu/hw/riscv/sifive_u.c
/qemu/hw/riscv/sifive_uart.c
/qemu/hw/riscv/virt.c
/qemu/hw/s390x/s390-virtio-ccw.c
/qemu/hw/scsi/esp-pci.c
/qemu/hw/scsi/esp.c
/qemu/hw/scsi/lsi53c895a.c
/qemu/hw/scsi/scsi-bus.c
/qemu/hw/scsi/trace-events
/qemu/hw/sh4/r2d.c
/qemu/hw/sparc/sun4m.c
/qemu/hw/timer/Makefile.objs
/qemu/hw/timer/i8254.c
/qemu/hw/timer/nrf51_timer.c
/qemu/hw/timer/trace-events
/qemu/hw/usb/bus.c
/qemu/hw/usb/ccid-card-emulated.c
/qemu/hw/usb/combined-packet.c
/qemu/hw/usb/dev-audio.c
/qemu/hw/usb/dev-bluetooth.c
/qemu/hw/usb/dev-hid.c
/qemu/hw/usb/dev-hub.c
/qemu/hw/usb/dev-mtp.c
/qemu/hw/usb/dev-network.c
/qemu/hw/usb/hcd-ehci-pci.c
/qemu/hw/usb/hcd-ehci-sysbus.c
/qemu/hw/usb/hcd-ehci.c
/qemu/hw/usb/hcd-ehci.h
/qemu/hw/usb/hcd-uhci.c
/qemu/hw/usb/xen-usb.c
/qemu/hw/vfio/common.c
/qemu/hw/watchdog/watchdog.c
/qemu/hw/watchdog/wdt_i6300esb.c
/qemu/hw/xen/xen-common.c
/qemu/hw/xen/xen_devconfig.c
/qemu/hw/xen/xen_pvdev.c
/qemu/hw/xenpv/xen_domainbuild.c
/qemu/include/elf.h
/qemu/include/exec/helper-head.h
/qemu/include/exec/helper-tcg.h
/qemu/include/exec/memory.h
/qemu/include/exec/poison.h
/qemu/include/hw/acpi/acpi.h
/qemu/include/hw/arm/allwinner-a10.h
/qemu/include/hw/arm/nrf51.h
/qemu/include/hw/arm/nrf51_soc.h
/qemu/include/hw/arm/xlnx-zynqmp.h
/qemu/include/hw/boards.h
/qemu/include/hw/char/nrf51_uart.h
/qemu/include/hw/cpu/cluster.h
/qemu/include/hw/elf_ops.h
/qemu/include/hw/gpio/nrf51_gpio.h
/qemu/include/hw/i386/ioapic.h
/qemu/include/hw/i386/pc.h
/qemu/include/hw/ide/internal.h
/qemu/include/hw/loader.h
/qemu/include/hw/misc/nrf51_rng.h
/qemu/include/hw/pci-host/spapr.h
/qemu/include/hw/pci/pci.h
/qemu/include/hw/ppc/pnv.h
/qemu/include/hw/ppc/pnv_psi.h
/qemu/include/hw/ppc/spapr.h
/qemu/include/hw/ppc/spapr_irq.h
/qemu/include/hw/ppc/spapr_xive.h
/qemu/include/hw/ppc/xics.h
/qemu/include/hw/ppc/xive.h
/qemu/include/hw/qdev-core.h
/qemu/include/hw/riscv/sifive_u.h
/qemu/include/hw/riscv/sifive_uart.h
/qemu/include/hw/riscv/virt.h
/qemu/include/hw/scsi/esp.h
/qemu/include/hw/sh4/sh_intc.h
/qemu/include/hw/timer/nrf51_timer.h
/qemu/include/hw/usb.h
/qemu/include/hw/vfio/vfio-common.h
/qemu/include/hw/vfio/vfio-platform.h
/qemu/include/hw/xen/io/ring.h
/qemu/include/net/net.h
/qemu/include/qemu/acl.h
/qemu/include/qemu/atomic.h
/qemu/include/qemu/iov.h
/qemu/include/qemu/option_int.h
/qemu/include/qemu/osdep.h
/qemu/include/qemu/queue.h
/qemu/include/qemu/range.h
/qemu/include/qemu/rcu_queue.h
/qemu/include/qemu/typedefs.h
/qemu/include/qom/cpu.h
/qemu/include/qom/object.h
/qemu/include/scsi/constants.h
/qemu/include/sysemu/accel.h
/qemu/include/sysemu/balloon.h
/qemu/include/sysemu/hostmem.h
/qemu/include/sysemu/kvm.h
/qemu/include/sysemu/memory_mapping.h
/qemu/include/sysemu/rng.h
/qemu/include/sysemu/sysemu.h
/qemu/include/ui/console.h
/qemu/include/ui/input.h
/qemu/include/ui/qemu-spice.h
/qemu/linux-user/elfload.c
/qemu/linux-user/host/riscv32/hostdep.h
/qemu/linux-user/host/riscv64/hostdep.h
/qemu/linux-user/host/riscv64/safe-syscall.inc.S
/qemu/linux-user/linuxload.c
/qemu/linux-user/main.c
/qemu/linux-user/mmap.c
/qemu/linux-user/ppc/signal.c
/qemu/linux-user/qemu.h
/qemu/linux-user/signal.c
/qemu/linux-user/strace.c
/qemu/linux-user/syscall.c
/qemu/linux-user/syscall_defs.h
/qemu/linux-user/uaccess.c
/qemu/linux-user/vm86.c
/qemu/linux-user/x86_64/target_syscall.h
/qemu/memory.c
/qemu/memory_mapping.c
/qemu/migration/block-dirty-bitmap.c
/qemu/migration/block.c
/qemu/migration/ram.c
/qemu/monitor.c
server.c
/qemu/net/checksum.c
/qemu/net/filter.c
/qemu/net/net.c
/qemu/net/queue.c
/qemu/net/slirp.c
/qemu/pc-bios/keymaps/sl
/qemu/pc-bios/keymaps/sv
/qemu/pc-bios/palcode-clipper
/qemu/qapi/block-core.json
/qemu/qapi/transaction.json
/qemu/qemu-deprecated.texi
/qemu/qemu-nbd.c
/qemu/qemu-options.hx
/qemu/qga/commands-posix.c
/qemu/qga/commands-win32.c
/qemu/qom/cpu.c
/qemu/qom/object.c
/qemu/qtest.c
/qemu/roms/Makefile
/qemu/roms/qemu-palcode
/qemu/rules.mak
/qemu/scripts/checkpatch.pl
/qemu/scripts/cocci-macro-file.h
/qemu/scripts/fix-multiline-comments.sh
/qemu/scripts/tap-driver.pl
/qemu/scripts/tap-merge.pl
/qemu/slirp/ip_input.c
/qemu/slirp/slirp.c
/qemu/slirp/tcp_input.c
/qemu/slirp/tcp_output.c
/qemu/slirp/tcp_timer.c
/qemu/slirp/udp.c
/qemu/target/alpha/cpu.c
/qemu/target/alpha/translate.c
/qemu/target/arm/cpu-qom.h
/qemu/target/arm/cpu.c
/qemu/target/arm/cpu.h
/qemu/target/arm/cpu64.c
/qemu/target/arm/helper.c
/qemu/target/arm/kvm.c
/qemu/target/arm/sve.decode
/qemu/target/arm/translate-a64.c
/qemu/target/arm/translate.c
/qemu/target/cris/helper.c
/qemu/target/cris/mmu.h
/qemu/target/cris/translate_v10.inc.c
/qemu/target/i386/Makefile.objs
/qemu/target/i386/cpu.c
/qemu/target/i386/hax-i386.h
/qemu/target/i386/hax-mem.c
/qemu/target/i386/hax-posix.c
/qemu/target/i386/hax-posix.h
/qemu/target/i386/translate.c
/qemu/target/mips/translate.c
/qemu/target/ppc/arch_dump.c
/qemu/target/ppc/cpu.h
/qemu/target/ppc/gdbstub.c
/qemu/target/ppc/int_helper.c
/qemu/target/ppc/internal.h
/qemu/target/ppc/kvm.c
/qemu/target/ppc/machine.c
/qemu/target/ppc/monitor.c
/qemu/target/ppc/translate.c
/qemu/target/ppc/translate/dfp-impl.inc.c
/qemu/target/ppc/translate/fp-impl.inc.c
/qemu/target/ppc/translate/vmx-impl.inc.c
/qemu/target/ppc/translate/vsx-impl.inc.c
/qemu/target/ppc/translate_init.inc.c
/qemu/target/riscv/Makefile.objs
/qemu/target/riscv/cpu.c
/qemu/target/riscv/cpu.h
/qemu/target/riscv/cpu_helper.c
/qemu/target/riscv/csr.c
/qemu/target/riscv/gdbstub.c
/qemu/target/riscv/op_helper.c
/qemu/target/riscv/pmp.c
/qemu/target/sparc/cpu.c
/qemu/target/tilegx/translate.c
/qemu/tcg/i386/tcg-target.inc.c
/qemu/tcg/riscv/tcg-target.h
/qemu/tcg/riscv/tcg-target.inc.c
/qemu/tcg/tcg-op.c
/qemu/tcg/tcg-op.h
/qemu/tcg/tcg-opc.h
/qemu/tcg/tcg.c
/qemu/tcg/tcg.h
/qemu/tests/Makefile.include
/qemu/tests/cdrom-test.c
/qemu/tests/display-vga-test.c
/qemu/tests/docker/dockerfiles/centos7.docker
/qemu/tests/docker/dockerfiles/debian-sid.docker
/qemu/tests/docker/dockerfiles/fedora.docker
/qemu/tests/ivshmem-test.c
/qemu/tests/libqos/malloc.c
/qemu/tests/libqtest.c
/qemu/tests/libqtest.h
/qemu/tests/microbit-test.c
/qemu/tests/migration-test.c
/qemu/tests/qemu-iotests/206
/qemu/tests/qemu-iotests/223
/qemu/tests/qemu-iotests/223.out
/qemu/tests/qemu-iotests/236
/qemu/tests/qemu-iotests/236.out
/qemu/tests/qemu-iotests/group
/qemu/tests/qemu-iotests/iotests.py
/qemu/tests/tcg/alpha/test-cond.c
/qemu/tests/tcg/arm/hello-arm.c
/qemu/tests/tcg/cris/check_glibc_kernelversion.c
/qemu/tests/tcg/cris/check_mmap3.c
/qemu/tests/tcg/cris/check_openpf1.c
/qemu/tests/tcg/cris/check_settls1.c
/qemu/tests/tcg/i386/hello-i386.c
/qemu/tests/tcg/mips/hello-mips.c
/qemu/tests/tcg/mips/mipsr5900/Makefile
/qemu/tests/tcg/mips/mipsr5900/madd.c
/qemu/tests/tcg/mips/mipsr5900/maddu.c
/qemu/tests/tcg/multiarch/sha1.c
/qemu/tests/test-crypto-pbkdf.c
/qemu/tests/test-qdev-global-props.c
/qemu/tests/test-rcu-list.c
/qemu/tests/test-vmstate.c
/qemu/tests/vhost-user-test.c
/qemu/ui/cocoa.m
/qemu/ui/console.c
/qemu/ui/egl-headless.c
/qemu/ui/input.c
/qemu/ui/keymaps.c
/qemu/ui/keymaps.h
/qemu/ui/qemu-pixman.c
/qemu/ui/spice-core.c
/qemu/ui/vnc-enc-zywrle-template.c
/qemu/ui/vnc.c
/qemu/util/bitops.c
/qemu/util/osdep.c
/qemu/util/qemu-option.c
/qemu/util/qemu-sockets.c
/qemu/util/qemu-thread-posix.c
/qemu/util/qemu-thread-win32.c
/qemu/vl.c
ef2e35fc15-Dec-2018 Eric Blake <eblake@redhat.com>

nbd/client: Drop pointless buf variable

There's no need to read into a temporary buffer (oversized
since commit 7d3123e1) followed by a byteswap into a uint64_t
to check for a magic number via memcm

nbd/client: Drop pointless buf variable

There's no need to read into a temporary buffer (oversized
since commit 7d3123e1) followed by a byteswap into a uint64_t
to check for a magic number via memcmp(), when the code
immediately below demonstrates reading into the uint64_t then
byteswapping in place and checking for a magic number via
integer math. What's more, having a different error message
when the server's first reply byte is 0 is unusual - it's no
different from any other wrong magic number, and we already
detected short reads. That whole strlen() issue has been
present and useless since commit 1d45f8b5 in 2010; perhaps it
was leftover debugging (since the correct magic number happens
to be ASCII)? Make the error messages more consistent and
detailed while touching things.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20181215135324.152629-9-eblake@redhat.com>

show more ...

3c1fa35d15-Dec-2018 Eric Blake <eblake@redhat.com>

qemu-nbd: Fail earlier for -c/-d on non-linux

Connecting to a /dev/nbdN device is a Linux-specific action.
We were already masking -c and -d from 'qemu-nbd --help' on
non-linux. However, while -d f

qemu-nbd: Fail earlier for -c/-d on non-linux

Connecting to a /dev/nbdN device is a Linux-specific action.
We were already masking -c and -d from 'qemu-nbd --help' on
non-linux. However, while -d fails with a sensible error
message, it took hunting through a couple of files to prove
that. What's more, the code for -c doesn't fail until after
it has created a pthread and tried to open a device - possibly
even printing an error message with %m on a non-Linux platform
in spite of the comment that %m is glibc-specific. Make the
failure happen sooner, then get rid of stubs that are no
longer needed because of the early exits.

While at it: tweak the blank newlines in --help output to be
consistent, whether or not built on Linux.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20181215135324.152629-7-eblake@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

show more ...

6c5c035115-Dec-2018 Eric Blake <eblake@redhat.com>

nbd/client: More consistent error messages

Consolidate on using decimal (not hex), on outputting the
option reply name (not just value), and a consistent comma between
clauses, when the client repor

nbd/client: More consistent error messages

Consolidate on using decimal (not hex), on outputting the
option reply name (not just value), and a consistent comma between
clauses, when the client reports protocol discrepancies from the
server. While it won't affect normal operation, it makes
debugging additions easier.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20181215135324.152629-6-eblake@redhat.com>

show more ...

bee21ef018-Dec-2018 Eric Blake <eblake@redhat.com>

nbd/client: Trace all server option error messages

Not all servers send free-form text alongside option error replies, but
for servers that do (such as qemu), we pass the server's message as a
hint

nbd/client: Trace all server option error messages

Not all servers send free-form text alongside option error replies, but
for servers that do (such as qemu), we pass the server's message as a
hint alongside our own error reporting. However, it would also be
useful to trace such server messages, since we can't guarantee how the
hint may be consumed.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20181218225714.284495-3-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

show more ...

12345678910>>...16