Skip to content

Commit

Permalink
include: move C/util-related declarations to cutils.h
Browse files Browse the repository at this point in the history
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220323155743.1585078-22-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
elmarco authored and bonzini committed Apr 3, 2022
1 parent 82a9ca8 commit 6b166a2
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion hw/dma/xlnx_dpdma.c
Expand Up @@ -23,7 +23,7 @@
*/

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/cutils.h"
#include "qemu/log.h"
#include "qemu/module.h"
#include "hw/dma/xlnx_dpdma.h"
Expand Down
2 changes: 1 addition & 1 deletion hw/usb/ccid-card-passthru.c
Expand Up @@ -9,7 +9,7 @@
*/

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/cutils.h"
#include "qemu/units.h"
#include <libcacard.h>
#include "chardev/char-fe.h"
Expand Down
2 changes: 1 addition & 1 deletion hw/usb/dev-smartcard-reader.c
Expand Up @@ -37,7 +37,7 @@
#include "qemu/osdep.h"
#include "qemu/units.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "hw/qdev-properties.h"
Expand Down
2 changes: 1 addition & 1 deletion hw/usb/redirect.c
Expand Up @@ -26,7 +26,7 @@
*/

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/cutils.h"
#include "qemu/units.h"
#include "qapi/error.h"
#include "qemu/timer.h"
Expand Down
2 changes: 1 addition & 1 deletion hw/virtio/vhost-vdpa.c
Expand Up @@ -20,10 +20,10 @@
#include "hw/virtio/vhost-shadow-virtqueue.h"
#include "hw/virtio/vhost-vdpa.h"
#include "exec/address-spaces.h"
#include "qemu/cutils.h"
#include "qemu/main-loop.h"
#include "cpu.h"
#include "trace.h"
#include "qemu-common.h"
#include "qapi/error.h"

/*
Expand Down
20 changes: 0 additions & 20 deletions include/qemu-common.h
Expand Up @@ -54,26 +54,6 @@ const char *qemu_get_vm_name(void);
void os_setup_early_signal_handling(void);
int os_parse_cmd_args(int index, const char *optarg);

/*
* Hexdump a line of a byte buffer into a hexadecimal/ASCII buffer
*/
#define QEMU_HEXDUMP_LINE_BYTES 16 /* Number of bytes to dump */
#define QEMU_HEXDUMP_LINE_LEN 75 /* Number of characters in line */
void qemu_hexdump_line(char *line, unsigned int b, const void *bufptr,
unsigned int len, bool ascii);

/*
* Hexdump a buffer to a file. An optional string prefix is added to every line
*/

void qemu_hexdump(FILE *fp, const char *prefix,
const void *bufptr, size_t size);

/*
* helper to parse debug environment variables
*/
int parse_debug_env(const char *name, int max, int initial);

void page_size_init(void);

#endif
20 changes: 20 additions & 0 deletions include/qemu/cutils.h
Expand Up @@ -214,4 +214,24 @@ static inline const char *yes_no(bool b)
return b ? "yes" : "no";
}

/*
* helper to parse debug environment variables
*/
int parse_debug_env(const char *name, int max, int initial);

/*
* Hexdump a line of a byte buffer into a hexadecimal/ASCII buffer
*/
#define QEMU_HEXDUMP_LINE_BYTES 16 /* Number of bytes to dump */
#define QEMU_HEXDUMP_LINE_LEN 75 /* Number of characters in line */
void qemu_hexdump_line(char *line, unsigned int b, const void *bufptr,
unsigned int len, bool ascii);

/*
* Hexdump a buffer to a file. An optional string prefix is added to every line
*/

void qemu_hexdump(FILE *fp, const char *prefix,
const void *bufptr, size_t size);

#endif
2 changes: 1 addition & 1 deletion net/announce.c
Expand Up @@ -7,7 +7,7 @@
*/

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/cutils.h"
#include "net/announce.h"
#include "net/net.h"
#include "qapi/clone-visitor.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/qtest/npcm7xx_rng-test.c
Expand Up @@ -20,7 +20,7 @@

#include "libqtest-single.h"
#include "qemu/bitops.h"
#include "qemu-common.h"
#include "qemu/cutils.h"

#define RNG_BASE_ADDR 0xf000b000

Expand Down
2 changes: 1 addition & 1 deletion util/hexdump.c
Expand Up @@ -14,7 +14,7 @@
*/

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/cutils.h"

void qemu_hexdump_line(char *line, unsigned int b, const void *bufptr,
unsigned int len, bool ascii)
Expand Down

0 comments on commit 6b166a2

Please sign in to comment.