util: move declarations out of qemu-common.h
Subsystems (4)
PATCH 1/1 util: move declarations out of qemu-common.h
From: Veronia <[email protected]>
Move declarations out of qemu-common.h for functions declared in utils/ files: e.g. include/qemu/path.h for utils/path.c. Move inline functions out of qemu-common.h and into new files (e.g. include/qemu/bcd.h)
--- arch_init.c | 1 + audio/audio.c | 2 + block.c | 3 +- block/archipelago.c | 2 +- block/blkdebug.c | 2 +- block/blkverify.c | 1 + block/block-backend.c | 1 + block/curl.c | 1 + block/nbd.c | 2 +- block/qapi.c | 1 + block/qcow2-snapshot.c | 2 +- block/qcow2.c | 2 +- block/qed.h | 1 + block/raw-posix.c | 2 +- block/raw-win32.c | 2 +- block/rbd.c | 3 +- block/sheepdog.c | 2 +- block/vdi.c | 2 +- block/vmdk.c | 2 +- block/vvfat.c | 3 +- blockdev.c | 2 + bsd-user/elfload.c | 1 + bsd-user/main.c | 3 +- contrib/ivshmem-server/main.c | 2 +- disas/i386.c | 2 + dump.c | 3 +- exec.c | 2 +- gdbstub.c | 3 +- hmp.c | 1 + hw/9pfs/9p-proxy.c | 1 + hw/9pfs/9p-synth.c | 1 + hw/alpha/dp264.c | 1 + hw/arm/nseries.c | 2 +- hw/arm/omap1.c | 2 + hw/arm/pxa2xx.c | 1 + hw/arm/strongarm.c | 1 + hw/block/nvme.h | 1 + hw/bt/hci.c | 1 + hw/core/loader.c | 1 + hw/core/machine.c | 1 + hw/core/qdev-properties.c | 1 + hw/core/qdev.c | 1 + hw/cris/boot.c | 1 + hw/dma/pl330.c | 1 + hw/ide/core.c | 1 + hw/lm32/lm32_hwsetup.h | 1 + hw/lm32/milkymist.c | 1 + hw/microblaze/boot.c | 1 + hw/mips/mips_jazz.c | 1 + hw/misc/ivshmem.c | 1 + hw/misc/macio/cuda.c | 1 + hw/net/fsl_etsec/etsec.c | 1 + hw/net/fsl_etsec/rings.c | 1 + hw/nvram/fw_cfg.c | 1 + hw/nvram/mac_nvram.c | 1 + hw/pci/pci.c | 1 + hw/ppc/mac_newworld.c | 1 + hw/ppc/mac_oldworld.c | 1 + hw/ppc/prep.c | 1 + hw/ppc/spapr.c | 2 +- hw/ppc/spapr_drc.c | 1 + hw/ppc/spapr_events.c | 3 +- hw/ppc/spapr_rtas.c | 1 + hw/ppc/spapr_rtc.c | 1 + hw/scsi/scsi-bus.c | 1 + hw/scsi/scsi-disk.c | 2 +- hw/scsi/vhost-scsi.c | 1 + hw/sparc/sun4m.c | 1 + hw/sparc64/sun4u.c | 1 + hw/timer/ds1338.c | 1 + hw/timer/exynos4210_rtc.c | 1 + hw/timer/m48t59.c | 1 + hw/timer/mc146818rtc.c | 2 + hw/timer/pl031.c | 1 + hw/timer/twl92230.c | 1 + hw/usb/bus.c | 1 + hw/usb/dev-network.c | 1 + hw/usb/dev-serial.c | 1 + hw/usb/dev-storage.c | 1 + hw/usb/redirect.c | 1 + hw/watchdog/watchdog.c | 2 +- hw/xen/xen-host-pci-device.c | 1 + include/qemu-common.h | 265 ----------------------------------------- include/qemu/bcd.h | 10 ++ include/qemu/cutils.h | 167 ++++++++++++++++++++++++++ include/qemu/help_option.h | 17 +++ include/qemu/id.h | 8 ++ include/qemu/path.h | 47 ++++++++ include/qemu/unicode.h | 5 + io/channel-socket.c | 1 + io/channel-util.c | 2 +- linux-user/elfload.c | 1 + linux-user/main.c | 4 +- linux-user/syscall.c | 2 + linux-user/uaccess.c | 1 + main-loop.c | 2 +- migration/migration.c | 2 +- migration/qemu-file-unix.c | 2 +- migration/savevm.c | 3 +- monitor.c | 2 + net/net.c | 3 +- net/netmap.c | 1 + net/slirp.c | 1 + net/socket.c | 2 +- net/tap-bsd.c | 2 +- net/tap-linux.c | 2 +- net/tap-solaris.c | 1 + net/tap.c | 1 + os-posix.c | 1 + qapi/opts-visitor.c | 2 +- qdev-monitor.c | 1 + qemu-char.c | 3 +- qemu-img.c | 2 +- qemu-io-cmds.c | 1 + qemu-nbd.c | 3 +- qga/commands-posix.c | 2 + qga/commands.c | 1 + qga/main.c | 1 + qmp.c | 2 +- qobject/json-parser.c | 2 +- qobject/qdict.c | 1 + qobject/qjson.c | 1 + qom/object.c | 2 +- slirp/ip_icmp.c | 1 + slirp/misc.c | 1 + slirp/slirp.c | 1 + slirp/socket.c | 2 +- slirp/tcp_subr.c | 1 + slirp/tftp.c | 1 + target-arm/arm-semi.c | 1 + target-i386/cpu.c | 1 + target-ppc/kvm.c | 1 + target-ppc/translate_init.c | 1 + target-s390x/cpu.c | 1 + tcg/tcg.c | 2 +- tests/bios-tables-test.c | 2 +- tests/ivshmem-test.c | 1 + tests/qom-test.c | 1 + tests/tcg/linux-test.c | 1 + tests/test-cutils.c | 3 +- tests/test-rfifolock.c | 1 + trace/control.c | 1 + ui/gtk.c | 1 + ui/keymaps.c | 1 + ui/sdl.c | 1 + ui/vnc.c | 1 + util/cutils.c | 3 +- util/event_notifier-posix.c | 3 +- util/hexdump.c | 2 +- util/id.c | 3 +- util/iov.c | 1 + util/osdep.c | 3 +- util/oslib-posix.c | 2 + util/oslib-win32.c | 1 + util/path.c | 3 +- util/qemu-openpty.c | 1 + util/qemu-option.c | 3 + util/qemu-sockets.c | 2 + util/readline.c | 3 +- util/unicode.c | 2 +- vl.c | 3 +- 161 files changed, 439 insertions(+), 320 deletions(-) create mode 100644 include/qemu/bcd.h create mode 100644 include/qemu/cutils.h create mode 100644 include/qemu/help_option.h create mode 100644 include/qemu/id.h create mode 100644 include/qemu/path.h create mode 100644 include/qemu/unicode.h
arch_init.c +1 -0
@@ -31,6 +31,7 @@#include "qemu/error-report.h" #include "qmp-commands.h" #include "hw/acpi/acpi.h" +#include "qemu/help_option.h" #ifdef TARGET_SPARC int graphic_width =1024 ;
audio/audio.c +2 -0
@@ -27,6 +27,8 @@#include "monitor/monitor.h" #include "qemu/timer.h" #include "sysemu/sysemu.h" +#include "qemu/cutils.h" +#include "qemu/path.h" #define AUDIO_CAP "audio"#include "audio_int.h"
block.c +2 -1
@@ -22,7 +22,6 @@* THE SOFTWARE. */ #include "qemu/osdep.h" -#include "qemu-common.h" #include "trace.h" #include "block/block_int.h" #include "block/blockjob.h"
@@ -40,6 +39,8 @@#include "qemu/timer.h" #include "qapi-event.h" #include "block/throttle-groups.h" +#include "qemu/cutils.h" +#include "qemu/id.h" #ifdef CONFIG_BSD #include <sys/ioctl.h>
block/archipelago.c +1 -1
@@ -51,7 +51,7 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #include "block/block_int.h" #include "qemu/error-report.h" #include "qemu/thread.h"
block/blkdebug.c +1 -1
@@ -23,7 +23,7 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #include "qemu/config-file.h" #include "block/block_int.h" #include "qemu/module.h"
block/blkverify.c +1 -0
@@ -12,6 +12,7 @@#include "block/block_int.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qstring.h" +#include "qemu/cutils.h" typedef struct { BdrvChild *test_file;
block/block-backend.c +1 -0
@@ -18,6 +18,7 @@#include "sysemu/blockdev.h" #include "sysemu/sysemu.h" #include "qapi-event.h" +#include "qemu/id.h" /* Number of coroutines to reserve per attached device model */ #define COROUTINE_POOL_RESERVATION 64
block/curl.c +1 -0
@@ -29,6 +29,7 @@#include "qapi/qmp/qstring.h" #include "crypto/secret.h" #include <curl/curl.h> +#include "qemu/cutils.h" // #define DEBUG_CURL // #define DEBUG_VERBOSE
block/nbd.c +1 -1
@@ -35,7 +35,7 @@#include "qapi/qmp/qjson.h" #include "qapi/qmp/qint.h" #include "qapi/qmp/qstring.h" - +#include "qemu/cutils.h" #define EN_OPTSTR ":exportname="
block/qapi.c +1 -0
@@ -32,6 +32,7 @@#include "qapi/qmp-output-visitor.h" #include "qapi/qmp/types.h" #include "sysemu/block-backend.h" +#include "qemu/cutils.h" BlockDeviceInfo *bdrv_block_device_info (BlockDriverState *bs,Error **errp) {
block/qcow2-snapshot.c +1 -1
@@ -23,10 +23,10 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" #include "block/block_int.h" #include "block/qcow2.h" #include "qemu/error-report.h" +#include "qemu/cutils.h" void qcow2_free_snapshots (BlockDriverState *bs) {
block/qcow2.c +1 -1
@@ -22,7 +22,6 @@* THE SOFTWARE. */ #include "qemu/osdep.h" -#include "qemu-common.h" #include "block/block_int.h" #include "qemu/module.h" #include <zlib.h>
@@ -35,6 +34,7 @@#include "qapi-event.h" #include "trace.h" #include "qemu/option_int.h" +#include "qemu/cutils.h" /* Differences with QCOW:
block/qed.h +1 -0
@@ -16,6 +16,7 @@#define BLOCK_QED_H #include "block/block_int.h" +#include "qemu/cutils.h" /* The layout of a QED file is as follows: *
block/raw-posix.c +1 -1
@@ -22,7 +22,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #include "qemu/error-report.h" #include "qemu/timer.h" #include "qemu/log.h"
block/raw-win32.c +1 -1
@@ -22,7 +22,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #include "qemu/timer.h" #include "block/block_int.h" #include "qemu/module.h"
block/rbd.c +2 -1
@@ -13,10 +13,11 @@#include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #include "qemu/error-report.h" #include "block/block_int.h" #include "crypto/secret.h" +#include "qemu/cutils.h" #include <rbd/librbd.h>
block/sheepdog.c +1 -1
@@ -13,12 +13,12 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qemu/uri.h" #include "qemu/error-report.h" #include "qemu/sockets.h" #include "block/block_int.h" #include "qemu/bitops.h" +#include "qemu/cutils.h" #define SD_PROTO_VER 0x01
block/vdi.c +1 -1
@@ -50,11 +50,11 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" #include "block/block_int.h" #include "qemu/module.h" #include "migration/migration.h" #include "qemu/coroutine.h" +#include "qemu/cutils.h" #if defined(CONFIG_UUID )#include <uuid/uuid.h>
block/vmdk.c +1 -1
@@ -24,12 +24,12 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" #include "block/block_int.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "qemu/module.h" #include "migration/migration.h" +#include "qemu/cutils.h" #include <zlib.h> #include <glib.h>
block/vvfat.c +2 -1
@@ -24,13 +24,14 @@*/ #include "qemu/osdep.h" #include <dirent.h> -#include "qemu-common.h" #include "block/block_int.h" #include "qemu/module.h" #include "migration/migration.h" #include "qapi/qmp/qint.h" #include "qapi/qmp/qbool.h" #include "qapi/qmp/qstring.h" +#include "qemu/cutils.h" +#include "qemu/path.h" #ifndef S_IWGRP #define S_IWGRP 0
blockdev.c +2 -0
@@ -50,6 +50,8 @@#include "qmp-commands.h" #include "trace.h" #include "sysemu/arch_init.h" +#include "qemu/cutils.h" +#include "qemu/help_option.h" static QTAILQ_HEAD(, BlockDriverState) monitor_bdrv_states =QTAILQ_HEAD_INITIALIZER (monitor_bdrv_states);
bsd-user/elfload.c +1 -0
@@ -5,6 +5,7 @@#include "qemu.h" #include "disas/disas.h" +#include "qemu/path.h" #ifdef _ARCH_PPC64#undef ARCH_DLINFO
bsd-user/main.c +2 -1
@@ -21,7 +21,8 @@#include <sys/mman.h> #include "qemu.h" -#include "qemu-common.h" +#include "qemu/path.h" +#include "qemu/help_option.h" /* For tb_lock */ #include "cpu.h" #include "tcg.h"
contrib/ivshmem-server/main.c +1 -1
@@ -7,7 +7,7 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #include "ivshmem-server.h"
disas/i386.c +2 -0
@@ -33,6 +33,8 @@#include "qemu/osdep.h" #include "disas/bfd.h" +#include "qemu/cutils.h" +/* include/opcode/i386.h r1.78 */ /* opcode/i386.h -- Intel 80386 opcode macros
dump.c +2 -1
@@ -12,7 +12,8 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" +#include "qemu/path.h" #include "elf.h" #include "cpu.h" #include "exec/cpu-all.h"
exec.c +1 -1
@@ -21,7 +21,7 @@#include <sys/mman.h> #endif -#include "qemu-common.h" +#include "qemu/cutils.h" #include "cpu.h" #include "tcg.h" #include "hw/hw.h"
gdbstub.c +2 -1
@@ -17,7 +17,8 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" +#include "qemu/path.h" #ifdef CONFIG_USER_ONLY #include "qemu.h"
hmp.c +1 -0
@@ -34,6 +34,7 @@#include "ui/console.h" #include "block/qapi.h" #include "qemu-io.h" +#include "qemu/cutils.h" #ifdef CONFIG_SPICE #include <spice/enums.h>
hw/9pfs/9p-proxy.c +1 -0
@@ -16,6 +16,7 @@#include "qemu/error-report.h" #include "fsdev/qemu-fsdev.h" #include "9p-proxy.h" +#include "qemu/path.h" typedef struct V9fsProxy { int sockfd;
hw/9pfs/9p-synth.c +1 -0
@@ -20,6 +20,7 @@#include "9p-synth.h" #include "qemu/rcu.h" #include "qemu/rcu_queue.h" +#include "qemu/cutils.h" /* Root node for synth file system */ static V9fsSynthNode v9fs_synth_root = {
hw/alpha/dp264.c +1 -0
@@ -18,6 +18,7 @@#include "hw/ide.h" #include "hw/timer/i8254.h" #include "hw/char/serial.h" +#include "qemu/cutils.h" #define MAX_IDE_BUS 2
hw/arm/nseries.c +1 -1
@@ -19,7 +19,7 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #include "sysemu/sysemu.h" #include "hw/arm/omap.h" #include "hw/arm/arm.h"
hw/arm/omap1.c +2 -0
@@ -28,6 +28,8 @@#include "sysemu/blockdev.h" #include "qemu/range.h" #include "hw/sysbus.h" +#include "qemu/cutils.h" +#include "qemu/bcd.h" /* Should signal the TCMI/GPMC */ uint32_t omap_badwidth_read8 (void *opaque,hwaddr addr)
hw/arm/pxa2xx.c +1 -0
@@ -17,6 +17,7 @@#include "sysemu/char.h" #include "sysemu/block-backend.h" #include "sysemu/blockdev.h" +#include "qemu/cutils.h" static struct { hwaddr io_base;
hw/arm/strongarm.c +1 -0
@@ -36,6 +36,7 @@#include "sysemu/char.h" #include "sysemu/sysemu.h" #include "hw/ssi/ssi.h" +#include "qemu/cutils.h" //#define DEBUG
hw/block/nvme.h +1 -0
@@ -1,5 +1,6 @@ #ifndef HW_NVME_H #define HW_NVME_H +#include "qemu/cutils.h" typedef struct NvmeBar { uint64_t cap;
hw/bt/hci.c +1 -0
@@ -26,6 +26,7 @@#include "hw/bt.h" #include "qapi/qmp/qerror.h" #include "sysemu/replay.h" +#include "qemu/cutils.h" struct bt_hci_s {uint8_t *(*evt_packet)(void *opaque);
hw/core/loader.c +1 -0
@@ -53,6 +53,7 @@#include "exec/memory.h" #include "exec/address-spaces.h" #include "hw/boards.h" +#include "qemu/cutils.h" #include <zlib.h>
hw/core/machine.c +1 -0
@@ -17,6 +17,7 @@#include "hw/sysbus.h" #include "sysemu/sysemu.h" #include "qemu/error-report.h" +#include "qemu/cutils.h" static char *machine_get_accel (Object *obj,Error **errp) {
hw/core/qdev-properties.c +1 -0
@@ -8,6 +8,7 @@#include "net/hub.h" #include "qapi/visitor.h" #include "sysemu/char.h" +#include "qemu/path.h" void qdev_prop_set_after_realize (DeviceState *dev,const char *name,Error **errp)
hw/core/qdev.c +1 -0
@@ -36,6 +36,7 @@#include "hw/hotplug.h" #include "hw/boards.h" #include "qapi-event.h" +#include "qemu/path.h" int qdev_hotplug =0 ;static bool qdev_hot_added = false;
hw/cris/boot.c +1 -0
@@ -27,6 +27,7 @@#include "hw/loader.h" #include "elf.h" #include "boot.h" +#include "qemu/cutils.h" static void main_cpu_reset (void *opaque) {
hw/dma/pl330.c +1 -0
@@ -18,6 +18,7 @@#include "hw/sysbus.h" #include "qemu/timer.h" #include "sysemu/dma.h" +#include "qemu/unicode.h" #ifndef PL330_ERR_DEBUG #define PL330_ERR_DEBUG 0
hw/ide/core.c +1 -0
@@ -33,6 +33,7 @@#include "sysemu/dma.h" #include "hw/block/block.h" #include "sysemu/block-backend.h" +#include "qemu/cutils.h" #include <hw/ide/internal.h>
hw/lm32/lm32_hwsetup.h +1 -0
@@ -26,6 +26,7 @@#define QEMU_HW_LM32_HWSETUP_H #include "qemu-common.h" +#include "qemu/cutils.h" #include "hw/loader.h" typedef struct {
hw/lm32/milkymist.c +1 -0
@@ -31,6 +31,7 @@#include "milkymist-hw.h" #include "lm32.h" #include "exec/address-spaces.h" +#include "qemu/cutils.h" #define BIOS_FILENAME "mmone-bios.bin"#define BIOS_OFFSET 0x00860000
hw/microblaze/boot.c +1 -0
@@ -33,6 +33,7 @@#include "sysemu/sysemu.h" #include "hw/loader.h" #include "elf.h" +#include "qemu/cutils.h" #include "boot.h"
hw/mips/mips_jazz.c +1 -0
@@ -45,6 +45,7 @@#include "exec/address-spaces.h" #include "sysemu/qtest.h" #include "qemu/error-report.h" +#include "qemu/help_option.h" enum jazz_model_e {
hw/misc/ivshmem.c +1 -0
@@ -17,6 +17,7 @@* GNU GPL, version 2 or (at your option) any later version. */ #include "qemu/osdep.h" +#include "qemu/cutils.h" #include "hw/hw.h" #include "hw/i386/pc.h" #include "hw/pci/pci.h"
hw/misc/macio/cuda.c +1 -0
@@ -28,6 +28,7 @@#include "hw/input/adb.h" #include "qemu/timer.h" #include "sysemu/sysemu.h" +#include "qemu/cutils.h" /* XXX: implement all timer modes */
hw/net/fsl_etsec/etsec.c +1 -0
@@ -33,6 +33,7 @@#include "hw/ptimer.h" #include "etsec.h" #include "registers.h" +#include "qemu/unicode.h" /* #define HEX_DUMP */ /* #define DEBUG_REGISTER */
hw/net/fsl_etsec/rings.c +1 -0
@@ -23,6 +23,7 @@*/ #include "qemu/osdep.h" #include "net/checksum.h" +#include "qemu/unicode.h" #include "etsec.h" #include "registers.h"
hw/nvram/fw_cfg.c +1 -0
@@ -31,6 +31,7 @@#include "trace.h" #include "qemu/error-report.h" #include "qemu/config-file.h" +#include "qemu/cutils.h" #define FW_CFG_NAME "fw_cfg"#define FW_CFG_PATH "/machine/" FW_CFG_NAME
hw/nvram/mac_nvram.c +1 -0
@@ -27,6 +27,7 @@#include "hw/nvram/openbios_firmware_abi.h" #include "sysemu/sysemu.h" #include "hw/ppc/mac.h" +#include "qemu/cutils.h" #include <zlib.h> /* debug NVR */
hw/pci/pci.c +1 -0
@@ -40,6 +40,7 @@#include "exec/address-spaces.h" #include "hw/hotplug.h" #include "hw/boards.h" +#include "qemu/cutils.h" //#define DEBUG_PCI #ifdef DEBUG_PCI
hw/ppc/mac_newworld.c +1 -0
@@ -70,6 +70,7 @@#include "sysemu/block-backend.h" #include "exec/address-spaces.h" #include "hw/sysbus.h" +#include "qemu/cutils.h" #define MAX_IDE_BUS 2#define CFG_ADDR 0xf0000510
hw/ppc/mac_oldworld.c +1 -0
@@ -44,6 +44,7 @@#include "kvm_ppc.h" #include "sysemu/block-backend.h" #include "exec/address-spaces.h" +#include "qemu/cutils.h" #define MAX_IDE_BUS 2#define CFG_ADDR 0xf0000510
hw/ppc/prep.c +1 -0
@@ -46,6 +46,7 @@#include "exec/address-spaces.h" #include "trace.h" #include "elf.h" +#include "qemu/cutils.h" /* SMP is not enabled, for now */ #define MAX_CPUS 1
hw/ppc/spapr.c +1 -1
@@ -63,7 +63,7 @@#include "hw/nmi.h" #include "hw/compat.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #include <libfdt.h>
hw/ppc/spapr_drc.c +1 -0
@@ -11,6 +11,7 @@*/ #include "qemu/osdep.h" +#include "qemu/cutils.h" #include "hw/ppc/spapr_drc.h" #include "qom/object.h" #include "hw/qdev.h"
hw/ppc/spapr_events.c +2 -1
@@ -36,7 +36,8 @@#include "hw/pci/pci.h" #include "hw/pci-host/spapr.h" #include "hw/ppc/spapr_drc.h" - +#include "qemu/help_option.h" +#include "qemu/bcd.h" #include <libfdt.h> struct rtas_error_log {
hw/ppc/spapr_rtas.c +1 -0
@@ -39,6 +39,7 @@#include <libfdt.h> #include "hw/ppc/spapr_drc.h" +#include "qemu/cutils.h" /* #define DEBUG_SPAPR */
hw/ppc/spapr_rtc.c +1 -0
@@ -31,6 +31,7 @@#include "sysemu/sysemu.h" #include "hw/ppc/spapr.h" #include "qapi-event.h" +#include "qemu/cutils.h" #define SPAPR_RTC (obj) \ OBJECT_CHECK(sPAPRRTCState, (obj), TYPE_SPAPR_RTC)
hw/scsi/scsi-bus.c +1 -0
@@ -8,6 +8,7 @@#include "sysemu/blockdev.h" #include "trace.h" #include "sysemu/dma.h" +#include "qemu/cutils.h" static char *scsibus_get_dev_path (DeviceState *dev);static char *scsibus_get_fw_dev_path (DeviceState *dev);
hw/scsi/scsi-disk.c +1 -1
@@ -29,7 +29,6 @@ do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0)#endif #include "qemu/osdep.h" -#include "qemu-common.h" #include "qemu/error-report.h" #include "hw/scsi/scsi.h" #include "block/scsi.h"
@@ -38,6 +37,7 @@ do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0)#include "sysemu/blockdev.h" #include "hw/block/block.h" #include "sysemu/dma.h" +#include "qemu/cutils.h" #ifdef __linux#include <scsi/sg.h>
hw/scsi/vhost-scsi.c +1 -0
@@ -27,6 +27,7 @@#include "hw/virtio/virtio-access.h" #include "hw/fw-path-provider.h" #include "linux/vhost.h" +#include "qemu/cutils.h" /* Features supported by host kernel. */ static const int kernel_feature_bits[] = {
hw/sparc/sun4m.c +1 -0
@@ -43,6 +43,7 @@#include "elf.h" #include "sysemu/block-backend.h" #include "trace.h" +#include "qemu/cutils.h" /* * Sun4m architecture was used in the following machines:
hw/sparc64/sun4u.c +1 -0
@@ -41,6 +41,7 @@#include "elf.h" #include "sysemu/block-backend.h" #include "exec/address-spaces.h" +#include "qemu/cutils.h" //#define DEBUG_IRQ //#define DEBUG_EBUS
hw/timer/ds1338.c +1 -0
@@ -12,6 +12,7 @@#include "qemu/osdep.h" #include "hw/i2c/i2c.h" +#include "qemu/bcd.h" /* Size of NVRAM including both the user-accessible area and the * secondary register area.
hw/timer/exynos4210_rtc.c +1 -0
@@ -29,6 +29,7 @@#include "hw/sysbus.h" #include "qemu/timer.h" #include "qemu-common.h" +#include "qemu/bcd.h" #include "hw/ptimer.h" #include "hw/hw.h"
hw/timer/m48t59.c +1 -0
@@ -30,6 +30,7 @@#include "hw/sysbus.h" #include "hw/isa/isa.h" #include "exec/address-spaces.h" +#include "qemu/bcd.h" //#define DEBUG_NVRAM
hw/timer/mc146818rtc.c +2 -0
@@ -22,6 +22,8 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/cutils.h" +#include "qemu/bcd.h" #include "hw/hw.h" #include "qemu/timer.h" #include "sysemu/sysemu.h"
hw/timer/pl031.c +1 -0
@@ -15,6 +15,7 @@#include "hw/sysbus.h" #include "qemu/timer.h" #include "sysemu/sysemu.h" +#include "qemu/cutils.h" //#define DEBUG_PL031
hw/timer/twl92230.c +1 -0
@@ -25,6 +25,7 @@#include "hw/i2c/i2c.h" #include "sysemu/sysemu.h" #include "ui/console.h" +#include "qemu/bcd.h" #define VERBOSE 1
hw/usb/bus.c +1 -0
@@ -6,6 +6,7 @@#include "sysemu/sysemu.h" #include "monitor/monitor.h" #include "trace.h" +#include "qemu/cutils.h" static void usb_bus_dev_print (Monitor *mon,DeviceState *qdev,int indent);
hw/usb/dev-network.c +1 -0
@@ -33,6 +33,7 @@#include "qemu/config-file.h" #include "sysemu/sysemu.h" #include "qemu/iov.h" +#include "qemu/cutils.h" /*#define TRAFFIC_DEBUG*/ /* Thanks to NetChip Technologies for donating this product ID.
hw/usb/dev-serial.c +1 -0
@@ -10,6 +10,7 @@#include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/cutils.h" #include "qemu/error-report.h" #include "hw/usb.h" #include "hw/usb/desc.h"
hw/usb/dev-storage.c +1 -0
@@ -21,6 +21,7 @@#include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "qapi/visitor.h" +#include "qemu/cutils.h" //#define DEBUG_MSD
hw/usb/redirect.c +1 -0
@@ -33,6 +33,7 @@#include "qemu/error-report.h" #include "qemu/iov.h" #include "sysemu/char.h" +#include "qemu/path.h" #include <sys/ioctl.h> #include <usbredirparser.h>
hw/watchdog/watchdog.c +1 -1
@@ -20,7 +20,6 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qemu/option.h" #include "qemu/config-file.h" #include "qemu/queue.h"
@@ -29,6 +28,7 @@#include "sysemu/watchdog.h" #include "qapi-event.h" #include "hw/nmi.h" +#include "qemu/help_option.h" static int watchdog_action =WDT_RESET ; static QLIST_HEAD(watchdog_list, WatchdogTimerModel) watchdog_list;
hw/xen/xen-host-pci-device.c +1 -0
@@ -8,6 +8,7 @@#include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/cutils.h" #include "xen-host-pci-device.h" #define XEN_HOST_PCI_MAX_EXT_CAP \
include/qemu-common.h +0 -265
283 lines not on this page · raw message
include/qemu/bcd.h new file +10 -0
@@ -0,0 +1,10 @@ +/* Convert a byte between binary and BCD. */ +static inline uint8_t to_bcd (uint8_t val) +{ +return ((val /10 ) <<4 ) | (val %10 ); +} + +static inline uint8_t from_bcd (uint8_t val) +{ +return ((val >>4 ) *10 ) + (val &0x0f ); +}
include/qemu/cutils.h new file +167 -0
167 lines not on this page · raw message
include/qemu/help_option.h new file +17 -0
@@ -0,0 +1,17 @@ +/** +* is_help_option: +* @s: string to test +* +* Check whether @s is one of the standard strings which indicate +* that the user is asking for a list of the valid values for a +* command option like -cpu or -M. The current accepted strings +* are 'help' and '?'. '?' is deprecated (it is a shell wildcard +* which makes it annoying to use in a reliable way) but provided +* for backwards compatibility. +* +* Returns: true if @s is a request for a list. +*/ +static inline bool is_help_option (const char *s) +{ +return !strcmp (s,"?" ) || !strcmp (s,"help" ); +}
include/qemu/id.h new file +8 -0
@@ -0,0 +1,8 @@ +typedef enum IdSubSystems { +ID_QDEV , +ID_BLOCK , +ID_MAX /* last element, used as array size */ +}IdSubSystems ; + +char *id_generate (IdSubSystems id); +bool id_wellformed (const char *id);
include/qemu/path.h new file +47 -0
47 lines not on this page · raw message
include/qemu/unicode.h new file +5 -0
@@ -0,0 +1,5 @@ +int mod_utf8_codepoint (const char *s,size_t n,char **end); +/* +Hexdump a buffer to a file. An optional string prefix is added to every line +*/ +void qemu_hexdump (const char *buf,FILE *fp,const char *prefix,size_t size);
io/channel-socket.c +1 -0
@@ -22,6 +22,7 @@#include "io/channel-socket.h" #include "io/channel-watch.h" #include "trace.h" +#include "qemu/path.h" #define SOCKET_MAX_FDS 16
io/channel-util.c +1 -1
@@ -22,7 +22,7 @@#include "io/channel-util.h" #include "io/channel-file.h" #include "io/channel-socket.h" - +#include "qemu/path.h" static bool fd_is_socket (int fd) {
linux-user/elfload.c +1 -0
@@ -7,6 +7,7 @@#include "qemu.h" #include "disas/disas.h" +#include "qemu/path.h" #ifdef _ARCH_PPC64#undef ARCH_DLINFO
linux-user/main.c +3 -1
@@ -22,7 +22,9 @@#include <sys/resource.h> #include "qemu.h" -#include "qemu-common.h" +#include "qemu/path.h" +#include "qemu/cutils.h" +#include "qemu/help_option.h" #include "cpu.h" #include "tcg.h" #include "qemu/timer.h"
linux-user/syscall.c +2 -0
@@ -18,6 +18,8 @@*/ #define _ATFILE_SOURCE#include "qemu/osdep.h" +#include "qemu/cutils.h" +#include "qemu/path.h" #include <elf.h> #include <endian.h> #include <grp.h>
linux-user/uaccess.c +1 -0
@@ -1,5 +1,6 @@/* User memory access */ #include "qemu/osdep.h" +#include "qemu/cutils.h" #include "qemu.h"
main-loop.c +1 -1
@@ -23,7 +23,7 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #include "qemu/timer.h" #include "qemu/sockets.h" // struct in_addr needed for libslirp.h #include "sysemu/qtest.h"
migration/migration.c +1 -1
@@ -14,7 +14,7 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "migration/migration.h"
migration/qemu-file-unix.c +1 -1
@@ -22,13 +22,13 @@* THE SOFTWARE. */ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qemu/error-report.h" #include "qemu/iov.h" #include "qemu/sockets.h" #include "qemu/coroutine.h" #include "migration/qemu-file.h" #include "migration/qemu-file-internal.h" +#include "qemu/path.h" typedef struct QEMUFileSocket { int fd;
migration/savevm.c +1 -2
@@ -27,7 +27,6 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" #include "hw/boards.h" #include "hw/hw.h" #include "hw/qdev.h"
@@ -50,7 +49,7 @@#include "qemu/iov.h" #include "block/snapshot.h" #include "block/qapi.h" - +#include "qemu/cutils.h" #ifndef ETH_P_RARP #define ETH_P_RARP 0x8035
monitor.c +2 -0
@@ -76,6 +76,8 @@#include "qapi-event.h" #include "qmp-introspect.h" #include "sysemu/block-backend.h" +#include "qemu/cutils.h" +#include "qemu/path.h" /* for hmp_info_irq/pic */ #if defined(TARGET_SPARC )
net/net.c +2 -1
@@ -31,7 +31,8 @@#include "util.h" #include "monitor/monitor.h" -#include "qemu-common.h" +#include "qemu/path.h" +#include "qemu/help_option.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "qemu/sockets.h"
net/netmap.c +1 -0
@@ -37,6 +37,7 @@#include "sysemu/sysemu.h" #include "qemu/error-report.h" #include "qemu/iov.h" +#include "qemu/cutils.h" typedef struct NetmapState { NetClientState nc;
net/slirp.c +1 -0
@@ -37,6 +37,7 @@#include "qemu/sockets.h" #include "slirp/libslirp.h" #include "sysemu/char.h" +#include "qemu/cutils.h" static int get_str_sep (char *buf,int buf_size,const char **pp,int sep) {
net/socket.c +1 -1
@@ -26,7 +26,7 @@#include "net/net.h" #include "clients.h" #include "monitor/monitor.h" -#include "qemu-common.h" +#include "qemu/path.h" #include "qemu/error-report.h" #include "qemu/option.h" #include "qemu/sockets.h"
net/tap-bsd.c +1 -1
@@ -24,7 +24,7 @@#include "qemu/osdep.h" #include "tap_int.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #include "sysemu/sysemu.h" #include "qemu/error-report.h"
net/tap-linux.c +1 -1
@@ -32,8 +32,8 @@#include <sys/ioctl.h> #include "sysemu/sysemu.h" -#include "qemu-common.h" #include "qemu/error-report.h" +#include "qemu/cutils.h" #define PATH_NET_TUN "/dev/net/tun"
net/tap-solaris.c +1 -0
@@ -25,6 +25,7 @@#include "qemu/osdep.h" #include "tap_int.h" #include "sysemu/sysemu.h" +#include "qemu/cutils.h" #include <sys/ethernet.h> #include <sys/sockio.h>
net/tap.c +1 -0
@@ -37,6 +37,7 @@#include "monitor/monitor.h" #include "sysemu/sysemu.h" #include "qemu-common.h" +#include "qemu/cutils.h" #include "qemu/error-report.h" #include "net/tap.h"
os-posix.c +1 -0
@@ -38,6 +38,7 @@#include "qemu/rcu.h" #include "qemu/error-report.h" #include "qemu/log.h" +#include "qemu/cutils.h" #ifdef CONFIG_LINUX #include <sys/prctl.h>
qapi/opts-visitor.c +1 -1
@@ -11,7 +11,7 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #include "qapi/qmp/qerror.h" #include "qapi/opts-visitor.h" #include "qemu/queue.h"
qdev-monitor.c +1 -0
@@ -27,6 +27,7 @@#include "qapi/qmp/qerror.h" #include "qemu/config-file.h" #include "qemu/error-report.h" +#include "qemu/help_option.h" /* * Aliases were a bad idea from the start. Let's keep them
qemu-char.c +2 -1
@@ -22,7 +22,8 @@* THE SOFTWARE. */ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" +#include "qemu/path.h" #include "monitor/monitor.h" #include "sysemu/sysemu.h" #include "qemu/error-report.h"
qemu-img.c +1 -1
@@ -26,7 +26,7 @@#include "qapi/qmp-output-visitor.h" #include "qapi/qmp/qerror.h" #include "qapi/qmp/qjson.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #include "qemu/config-file.h" #include "qemu/option.h" #include "qemu/error-report.h"
qemu-io-cmds.c +1 -0
@@ -18,6 +18,7 @@#include "qemu/main-loop.h" #include "qemu/timer.h" #include "sysemu/block-backend.h" +#include "qemu/cutils.h" #define CMD_NOFILE_OK 0x01
qemu-nbd.c +2 -1
@@ -17,7 +17,8 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" +#include "qemu/path.h" #include "sysemu/block-backend.h" #include "block/block_int.h" #include "block/nbd.h"
qga/commands-posix.c +2 -0
@@ -23,6 +23,8 @@#include "qemu/host-utils.h" #include "qemu/sockets.h" #include "qemu/base64.h" +#include "qemu/cutils.h" +#include "qemu/path.h" #ifndef CONFIG_HAS_ENVIRON #ifdef __APPLE__
qga/commands.c +1 -0
@@ -16,6 +16,7 @@#include "qga-qmp-commands.h" #include "qapi/qmp/qerror.h" #include "qemu/base64.h" +#include "qemu/cutils.h" /* Maximum captured guest-exec out_data/err_data - 16MB */ #define GUEST_EXEC_MAX_OUTPUT (16*1024*1024)
qga/main.c +1 -0
@@ -29,6 +29,7 @@#include "qapi/qmp/dispatch.h" #include "qga/channel.h" #include "qemu/bswap.h" +#include "qemu/help_option.h" #ifdef _WIN32#include "qga/service-win32.h" #include "qga/vss-win32.h"
qmp.c +1 -1
@@ -14,7 +14,7 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #include "monitor/monitor.h" #include "sysemu/sysemu.h" #include "qmp-commands.h"
qobject/json-parser.c +1 -1
@@ -13,7 +13,7 @@#include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/path.h" #include "qapi/qmp/qstring.h" #include "qapi/qmp/qint.h" #include "qapi/qmp/qdict.h"
qobject/qdict.c +1 -0
@@ -19,6 +19,7 @@#include "qapi/qmp/qobject.h" #include "qemu/queue.h" #include "qemu-common.h" +#include "qemu/cutils.h" /** * qdict_new(): Create a new QDict
qobject/qjson.c +1 -0
@@ -21,6 +21,7 @@#include "qapi/qmp/qbool.h" #include "qapi/qmp/qfloat.h" #include "qapi/qmp/qdict.h" +#include "qemu/unicode.h" typedef struct JSONParsingState {
qom/object.c +1 -1
@@ -13,7 +13,7 @@#include "qemu/osdep.h" #include "qom/object.h" #include "qom/object_interfaces.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #include "qapi/visitor.h" #include "qapi-visit.h" #include "qapi/string-input-visitor.h"
slirp/ip_icmp.c +1 -0
@@ -33,6 +33,7 @@#include "qemu/osdep.h" #include "slirp.h" #include "ip_icmp.h" +#include "qemu/path.h" /* The message sent when emulating PING */ /* Be nice and tell them it's just a pseudo-ping packet */
slirp/misc.c +1 -0
@@ -12,6 +12,7 @@#include "monitor/monitor.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" +#include "qemu/path.h" #ifdef DEBUG int slirp_debug =DBG_CALL |DBG_MISC |DBG_ERROR ;
slirp/slirp.c +1 -0
@@ -28,6 +28,7 @@#include "sysemu/char.h" #include "slirp.h" #include "hw/hw.h" +#include "qemu/cutils.h" /* host loopback address */ struct in_addr loopback_addr;
slirp/socket.c +1 -1
@@ -6,7 +6,7 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/path.h" #include <slirp.h> #include "ip_icmp.h" #ifdef __sun__
slirp/tcp_subr.c +1 -0
@@ -40,6 +40,7 @@#include "qemu/osdep.h" #include <slirp.h> +#include "qemu/path.h" /* patchable/settable parameters for tcp */ /* Don't do rfc1323 performance enhancements */
slirp/tftp.c +1 -0
@@ -25,6 +25,7 @@#include "qemu/osdep.h" #include <slirp.h> #include "qemu-common.h" +#include "qemu/cutils.h" static inline int tftp_session_in_use (struct tftp_session *spt) {
target-arm/arm-semi.c +1 -0
@@ -30,6 +30,7 @@#include "qemu-common.h" #include "exec/gdbstub.h" #include "hw/arm/arm.h" +#include "qemu/cutils.h" #endif #define TARGET_SYS_OPEN 0x01
target-i386/cpu.c +1 -0
@@ -17,6 +17,7 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ #include "qemu/osdep.h" +#include "qemu/cutils.h" #include "cpu.h" #include "sysemu/kvm.h"
target-ppc/kvm.c +1 -0
@@ -42,6 +42,7 @@#include "exec/gdbstub.h" #include "exec/memattrs.h" #include "sysemu/hostmem.h" +#include "qemu/cutils.h" //#define DEBUG_KVM
target-ppc/translate_init.c +1 -0
@@ -31,6 +31,7 @@#include "qemu/error-report.h" #include "qapi/visitor.h" #include "hw/qdev-properties.h" +#include "qemu/path.h" //#define PPC_DUMP_CPU //#define PPC_DEBUG_SPR
target-s390x/cpu.c +1 -0
@@ -26,6 +26,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "qemu-common.h" +#include "qemu/cutils.h" #include "qemu/timer.h" #include "qemu/error-report.h" #include "hw/hw.h"
tcg/tcg.c +1 -1
@@ -36,7 +36,7 @@#define NDEBUG #endif -#include "qemu-common.h" +#include "qemu/cutils.h" #include "qemu/host-utils.h" #include "qemu/timer.h"
tests/bios-tables-test.c +1 -1
@@ -13,7 +13,7 @@#include "qemu/osdep.h" #include <glib.h> #include <glib/gstdio.h> -#include "qemu-common.h" +#include "qemu/path.h" #include "libqtest.h" #include "hw/acpi/acpi-defs.h" #include "hw/smbios/smbios.h"
tests/ivshmem-test.c +1 -0
@@ -16,6 +16,7 @@#include "libqos/pci-pc.h" #include "libqtest.h" #include "qemu-common.h" +#include "qemu/path.h" #define TMPSHMSIZE (1 << 20)static char *tmpshm;
tests/qom-test.c +1 -0
@@ -11,6 +11,7 @@#include <glib.h> #include "qemu-common.h" +#include "qemu/cutils.h" #include "libqtest.h" #include "qapi/qmp/types.h"
tests/tcg/linux-test.c +1 -0
@@ -39,6 +39,7 @@#include <dirent.h> #include <setjmp.h> #include <sys/shm.h> +#include "qemu/cutils.h" #define TESTPATH "/tmp/linux-test.tmp"#define TESTPORT 7654
tests/test-cutils.c +1 -2
@@ -28,8 +28,7 @@#include "qemu/osdep.h" #include <glib.h> -#include "qemu-common.h" - +#include "qemu/cutils.h" static void test_parse_uint_null (void ) {
tests/test-rfifolock.c +1 -0
@@ -13,6 +13,7 @@#include "qemu/osdep.h" #include <glib.h> #include "qemu-common.h" +#include "qemu/path.h" #include "qemu/rfifolock.h" static void test_nesting (void )
trace/control.c +1 -0
@@ -9,6 +9,7 @@#include "qemu/osdep.h" #include "trace/control.h" +#include "qemu/help_option.h" #ifdef CONFIG_TRACE_SIMPLE #include "trace/simple.h" #endif
ui/gtk.c +1 -0
@@ -36,6 +36,7 @@#include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/cutils.h" #include "ui/console.h" #include "ui/gtk.h"
ui/keymaps.c +1 -0
@@ -25,6 +25,7 @@#include "qemu/osdep.h" #include "keymaps.h" #include "sysemu/sysemu.h" +#include "qemu/path.h" static int get_keysym (const name2keysym_t *table,const char *name)
ui/sdl.c +1 -0
@@ -30,6 +30,7 @@#include <SDL_syswm.h> #include "qemu-common.h" +#include "qemu/cutils.h" #include "ui/console.h" #include "ui/input.h" #include "sysemu/sysemu.h"
ui/vnc.c +1 -0
@@ -44,6 +44,7 @@#include "crypto/tlscredsanon.h" #include "crypto/tlscredsx509.h" #include "qom/object_interfaces.h" +#include "qemu/cutils.h" #define VNC_REFRESH_INTERVAL_BASE GUI_REFRESH_INTERVAL_DEFAULT#define VNC_REFRESH_INTERVAL_INC 50
util/cutils.c +2 -1
@@ -22,13 +22,14 @@* THE SOFTWARE. */ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qemu/host-utils.h" #include <math.h> #include "qemu/sockets.h" #include "qemu/iov.h" #include "net/net.h" +#include "qemu/cutils.h" +#include "qemu/path.h" void strpadcpy (char *buf,int buf_size,const char *str,char pad) {
util/event_notifier-posix.c +2 -1
@@ -11,7 +11,8 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/cutils.h" +#include "qemu/path.h" #include "qemu/event_notifier.h" #include "sysemu/char.h" #include "qemu/main-loop.h"
util/hexdump.c +1 -1
@@ -14,7 +14,7 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/unicode.h" void qemu_hexdump (const char *buf,FILE *fp,const char *prefix,size_t size) {
util/id.c +2 -1
@@ -11,7 +11,8 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/id.h" +#include "qemu/path.h" bool id_wellformed (const char *id) {
util/iov.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "qemu/iov.h" #include "qemu/sockets.h" +#include "qemu/unicode.h" size_t iov_from_buf_full (const struct iovec *iov,unsigned int iov_cnt,size_t offset,const void *buf,size_t bytes)
util/osdep.c +2 -1
@@ -36,7 +36,8 @@extern int madvise (caddr_t ,size_t ,int );#endif -#include "qemu-common.h" +#include "qemu/cutils.h" +#include "qemu/path.h" #include "qemu/sockets.h" #include "qemu/error-report.h" #include "monitor/monitor.h"
util/oslib-posix.c +2 -0
@@ -51,6 +51,8 @@#include <libgen.h> #include <setjmp.h> #include <sys/signal.h> +#include "qemu/cutils.h" +#include "qemu/path.h" #ifdef CONFIG_LINUX #include <sys/syscall.h>
util/oslib-win32.c +1 -0
@@ -36,6 +36,7 @@#include "qemu/main-loop.h" #include "trace.h" #include "qemu/sockets.h" +#include "qemu/cutils.h" /* this must come after including "trace.h" */ #include <shlobj.h>
util/path.c +2 -1
@@ -6,7 +6,8 @@#include "qemu/osdep.h" #include <sys/param.h> #include <dirent.h> -#include "qemu-common.h" +#include "qemu/cutils.h" +#include "qemu/path.h" struct pathelem {
util/qemu-openpty.c +1 -0
@@ -34,6 +34,7 @@#include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/path.h" #if defined(__GLIBC__)# include <pty.h>
util/qemu-option.c +3 -0
@@ -30,6 +30,9 @@#include "qapi/qmp/types.h" #include "qapi/qmp/qerror.h" #include "qemu/option_int.h" +#include "qemu/cutils.h" +#include "qemu/id.h" +#include "qemu/help_option.h" /* * Extracts the name of an option from the parameter string (p points at the
util/qemu-sockets.c +2 -0
@@ -23,6 +23,8 @@#include "qapi/qmp-input-visitor.h" #include "qapi/qmp-output-visitor.h" #include "qapi-visit.h" +#include "qemu/cutils.h" +#include "qemu/path.h" #ifndef AI_ADDRCONFIG # define AI_ADDRCONFIG 0
util/readline.c +2 -1
@@ -23,8 +23,9 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qemu/readline.h" +#include "qemu/cutils.h" +#include "qemu/path.h" #define IS_NORM 0#define IS_ESC 1
util/unicode.c +1 -1
@@ -11,7 +11,7 @@*/ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/unicode.h" /** * mod_utf8_codepoint:
vl.c +2 -1
@@ -22,7 +22,8 @@* THE SOFTWARE. */ #include "qemu/osdep.h" - +#include "qemu/cutils.h" +#include "qemu/help_option.h" #ifdef CONFIG_SECCOMP #include "sysemu/seccomp.h"
Signature · 1 line
1.7.9.5
There are only two issues with the patch, which I fixed before queuing it for my next pull request.
include/qemu-common.h int qemu_main(int argc, char **argv, char **envp); · line 259
Quoted 3 lines · On 20/03/2016 18:16, [email protected] wrote:
include/qemu-common.h +0
-3-/* path.c */ -void init_paths (const char *prefix); -const char *path (const char *pathname);
The first is that only the above two lines were really for path.c, so I have removed everything else from path.h. Likewise, unicode.c only has mod_utf8_codepoint.
Quoted 18 lines
include/qemu-common.h +0
-9-/* unicode.c */ -int mod_utf8_codepoint (const char *s,size_t n,char **end); - -/* -* Hexdump a buffer to a file. An optional string prefix is added to every line -*/ - -void qemu_hexdump (const char *buf,FILE *fp,const char *prefix,size_t size); -/* vector definitions */ #ifdef __ALTIVEC__#include <altivec.h> include/qemu/bcd.h new file +0
-0
include/qemu/bcd.h line 10
Quoted 10 lines
include/qemu/bcd.h new file +10
-0@@ -0,0 +1,10 @@ +/* Convert a byte between binary and BCD. */ +static inline uint8_t to_bcd (uint8_t val) +{ +return ((val /10 ) <<4 ) | (val %10 ); +} + +static inline uint8_t from_bcd (uint8_t val) +{ +return ((val >>4 ) *10 ) + (val &0x0f ); +}
The second is that you need multiple-inclusion guards here, like
#ifndef QEMU_BCD_H
#define QEMU_BCD_H 1
/* Convert a byte between binary and BCD. */
static inline uint8_t to_bcd(uint8_t val)
{
return ((val / 10) << 4) | (val % 10);
}static inline uint8_t from_bcd(uint8_t val)
{
return ((val >> 4) * 10) + (val & 0x0f);
}#endif
That said, great job, considering that even just creating qemu/bcd.h would have been enough. Instead, you went ahead and touched 140 files.
Thanks!
Paolo