trivial patches for 2018-05-20

-----BEGIN PGP SIGNATURE-----
 
 iQFDBAABCAAtFiEEe3O61ovnosKJMUsicBtPaxppPlkFAlsBEgAPHG1qdEB0bHMu
 bXNrLnJ1AAoJEHAbT2saaT5Z74oH/1rKw64XSout5P3RNbhy8LjDfhu/wxtda8oR
 I3e/KbAOsmdU956Bvzk9eiL6gYyG2LrXgY5mJYaY5b+IwRZZEoywRvUX042fSEU0
 Hdkrjx8MpAVPN0RztLM2UDQta2NPv9uBc/X9tMR+brRnLID6qXDdd1tjKG5e8vDt
 iAfEgGdSg1opJlEyhOI3EPokdGa0QnrBgdPnEqhxtTWNhWWPxbdRVVTeyzJYOztC
 sM647Ca6P5y+0lBQNB4CXydiAR0GnE/SS1krFWbrpuI6rbOwzBOsPTi84JtwQzv+
 VWjmXfjnXy5c0+DG93e0sS6vqJF4V2ZoHKca2VVzLcBFPUxmZPw=
 =MQI4
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging

trivial patches for 2018-05-20

# gpg: Signature made Sun 20 May 2018 07:13:20 BST
# gpg:                using RSA key 701B4F6B1A693E59
# gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
# gpg:                 aka "Michael Tokarev <mjt@corpit.ru>"
# gpg:                 aka "Michael Tokarev <mjt@debian.org>"
# Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
#      Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931  4B22 701B 4F6B 1A69 3E59

* remotes/mjt/tags/trivial-patches-fetch: (22 commits)
  acpi: fix a comment about aml_call0()
  qapi/net.json: Fix the version number of the "vlan" removal
  gdbstub: Handle errors in gdb_accept()
  gdbstub: Use qemu_set_cloexec()
  replace functions which are only available in glib-2.24
  typedefs: Remove PcGuestInfo from qemu/typedefs.h
  qemu-options: Allow -no-user-config again
  hw/timer/mt48t59: Fix bit-rotten NVRAM_PRINTF format strings
  Remove unnecessary variables for function return value
  trivial: Do not include pci.h if it is not necessary
  tests: fix tpm-crb tpm-tis tests race
  hw/ide/ahci: Keep ALLWINNER_AHCI() macro internal
  qemu-img-cmds.hx: add passive-aggressive note
  qemu-img: Make documentation between .texi and .hx consistent
  qemu-img: remove references to GEN_DOCS
  qemu-img.texi: fix command ordering
  qemu-img-commands.hx: argument ordering fixups
  HACKING: document preference for g_new instead of g_malloc
  qemu-option-trace: -trace enable= is a pattern, not a file
  slirp/debug: Print IP addresses in human readable form
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2018-05-21 10:50:32 +01:00
commit 9802316ed6
48 changed files with 187 additions and 348 deletions

View File

@ -118,6 +118,15 @@ Please note that g_malloc will exit on allocation failure, so there
is no need to test for failure (as you would have to with malloc). is no need to test for failure (as you would have to with malloc).
Calling g_malloc with a zero size is valid and will return NULL. Calling g_malloc with a zero size is valid and will return NULL.
Prefer g_new(T, n) instead of g_malloc(sizeof(T) * n) for the following
reasons:
a. It catches multiplication overflowing size_t;
b. It returns T * instead of void *, letting compiler catch more type
errors.
Declarations like T *v = g_malloc(sizeof(*v)) are acceptable, though.
Memory allocated by qemu_memalign or qemu_blockalign must be freed with Memory allocated by qemu_memalign or qemu_blockalign must be freed with
qemu_vfree, since breaking this will cause problems on Win32. qemu_vfree, since breaking this will cause problems on Win32.

View File

@ -644,11 +644,8 @@ static inline void *alloc_code_gen_buffer(void)
static inline void *alloc_code_gen_buffer(void) static inline void *alloc_code_gen_buffer(void)
{ {
size_t size = tcg_ctx->code_gen_buffer_size; size_t size = tcg_ctx->code_gen_buffer_size;
void *buf; return VirtualAlloc(NULL, size, MEM_RESERVE | MEM_COMMIT,
buf = VirtualAlloc(NULL, size, MEM_RESERVE | MEM_COMMIT,
PAGE_EXECUTE_READWRITE); PAGE_EXECUTE_READWRITE);
return buf;
} }
#else #else
static inline void *alloc_code_gen_buffer(void) static inline void *alloc_code_gen_buffer(void)

View File

@ -613,7 +613,7 @@ static void read_quorum_children_entry(void *opaque)
static int read_quorum_children(QuorumAIOCB *acb) static int read_quorum_children(QuorumAIOCB *acb)
{ {
BDRVQuorumState *s = acb->bs->opaque; BDRVQuorumState *s = acb->bs->opaque;
int i, ret; int i;
acb->children_read = s->num_children; acb->children_read = s->num_children;
for (i = 0; i < s->num_children; i++) { for (i = 0; i < s->num_children; i++) {
@ -648,9 +648,7 @@ static int read_quorum_children(QuorumAIOCB *acb)
qemu_coroutine_yield(); qemu_coroutine_yield();
} }
ret = acb->vote_ret; return acb->vote_ret;
return ret;
} }
static int read_fifo_child(QuorumAIOCB *acb) static int read_fifo_child(QuorumAIOCB *acb)

View File

@ -1814,7 +1814,7 @@ void gdb_signalled(CPUArchState *env, int sig)
put_packet(s, buf); put_packet(s, buf);
} }
static void gdb_accept(void) static bool gdb_accept(void)
{ {
GDBState *s; GDBState *s;
struct sockaddr_in sockaddr; struct sockaddr_in sockaddr;
@ -1826,17 +1826,18 @@ static void gdb_accept(void)
fd = accept(gdbserver_fd, (struct sockaddr *)&sockaddr, &len); fd = accept(gdbserver_fd, (struct sockaddr *)&sockaddr, &len);
if (fd < 0 && errno != EINTR) { if (fd < 0 && errno != EINTR) {
perror("accept"); perror("accept");
return; return false;
} else if (fd >= 0) { } else if (fd >= 0) {
#ifndef _WIN32 qemu_set_cloexec(fd);
fcntl(fd, F_SETFD, FD_CLOEXEC);
#endif
break; break;
} }
} }
/* set short latency */ /* set short latency */
socket_set_nodelay(fd); if (socket_set_nodelay(fd)) {
perror("setsockopt");
return false;
}
s = g_malloc0(sizeof(GDBState)); s = g_malloc0(sizeof(GDBState));
s->c_cpu = first_cpu; s->c_cpu = first_cpu;
@ -1845,6 +1846,7 @@ static void gdb_accept(void)
gdb_has_xml = false; gdb_has_xml = false;
gdbserver_state = s; gdbserver_state = s;
return true;
} }
static int gdbserver_open(int port) static int gdbserver_open(int port)
@ -1857,9 +1859,7 @@ static int gdbserver_open(int port)
perror("socket"); perror("socket");
return -1; return -1;
} }
#ifndef _WIN32 qemu_set_cloexec(fd);
fcntl(fd, F_SETFD, FD_CLOEXEC);
#endif
socket_set_fast_reuse(fd); socket_set_fast_reuse(fd);
@ -1887,7 +1887,11 @@ int gdbserver_start(int port)
if (gdbserver_fd < 0) if (gdbserver_fd < 0)
return -1; return -1;
/* accept connections */ /* accept connections */
gdb_accept(); if (!gdb_accept()) {
close(gdbserver_fd);
gdbserver_fd = -1;
return -1;
}
return 0; return 0;
} }

View File

@ -627,7 +627,7 @@ Aml *aml_notify(Aml *arg1, Aml *arg2)
return var; return var;
} }
/* helper to call method with 1 argument */ /* helper to call method without argument */
Aml *aml_call0(const char *method) Aml *aml_call0(const char *method)
{ {
Aml *var = aml_alloc(); Aml *var = aml_alloc();

View File

@ -156,12 +156,8 @@ void exynos4210_write_secondary(ARMCPU *cpu,
static uint64_t exynos4210_calc_affinity(int cpu) static uint64_t exynos4210_calc_affinity(int cpu)
{ {
uint64_t mp_affinity;
/* Exynos4210 has 0x9 as cluster ID */ /* Exynos4210 has 0x9 as cluster ID */
mp_affinity = (0x9 << ARM_AFF1_SHIFT) | cpu; return (0x9 << ARM_AFF1_SHIFT) | cpu;
return mp_affinity;
} }
Exynos4210State *exynos4210_init(MemoryRegion *system_mem) Exynos4210State *exynos4210_init(MemoryRegion *system_mem)

View File

@ -196,7 +196,6 @@ static uint64_t vhost_user_blk_get_features(VirtIODevice *vdev,
Error **errp) Error **errp)
{ {
VHostUserBlk *s = VHOST_USER_BLK(vdev); VHostUserBlk *s = VHOST_USER_BLK(vdev);
uint64_t get_features;
/* Turn on pre-defined features */ /* Turn on pre-defined features */
virtio_add_feature(&features, VIRTIO_BLK_F_SEG_MAX); virtio_add_feature(&features, VIRTIO_BLK_F_SEG_MAX);
@ -215,9 +214,7 @@ static uint64_t vhost_user_blk_get_features(VirtIODevice *vdev,
virtio_add_feature(&features, VIRTIO_BLK_F_MQ); virtio_add_feature(&features, VIRTIO_BLK_F_MQ);
} }
get_features = vhost_get_features(&s->dev, user_feature_bits, features); return vhost_get_features(&s->dev, user_feature_bits, features);
return get_features;
} }
static void vhost_user_blk_handle_output(VirtIODevice *vdev, VirtQueue *vq) static void vhost_user_blk_handle_output(VirtIODevice *vdev, VirtQueue *vq)

View File

@ -403,13 +403,10 @@ static void dino_set_irq(void *opaque, int irq, int level)
static int dino_pci_map_irq(PCIDevice *d, int irq_num) static int dino_pci_map_irq(PCIDevice *d, int irq_num)
{ {
int slot = d->devfn >> 3; int slot = d->devfn >> 3;
int local_irq;
assert(irq_num >= 0 && irq_num <= 3); assert(irq_num >= 0 && irq_num <= 3);
local_irq = slot & 0x03; return slot & 0x03;
return local_irq;
} }
static void dino_set_timer_irq(void *opaque, int irq, int level) static void dino_set_timer_irq(void *opaque, int irq, int level)

View File

@ -24,6 +24,9 @@
#include "trace.h" #include "trace.h"
#define ALLWINNER_AHCI(obj) \
OBJECT_CHECK(AllwinnerAHCIState, (obj), TYPE_ALLWINNER_AHCI)
#define ALLWINNER_AHCI_BISTAFR ((0xa0 - ALLWINNER_AHCI_MMIO_OFF) / 4) #define ALLWINNER_AHCI_BISTAFR ((0xa0 - ALLWINNER_AHCI_MMIO_OFF) / 4)
#define ALLWINNER_AHCI_BISTCR ((0xa4 - ALLWINNER_AHCI_MMIO_OFF) / 4) #define ALLWINNER_AHCI_BISTCR ((0xa4 - ALLWINNER_AHCI_MMIO_OFF) / 4)
#define ALLWINNER_AHCI_BISTFCTR ((0xa8 - ALLWINNER_AHCI_MMIO_OFF) / 4) #define ALLWINNER_AHCI_BISTFCTR ((0xa8 - ALLWINNER_AHCI_MMIO_OFF) / 4)

View File

@ -375,7 +375,4 @@ void ahci_reset(AHCIState *s);
#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI) #define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI)
#define ALLWINNER_AHCI(obj) OBJECT_CHECK(AllwinnerAHCIState, (obj), \
TYPE_ALLWINNER_AHCI)
#endif /* HW_IDE_AHCI_H */ #endif /* HW_IDE_AHCI_H */

View File

@ -108,8 +108,8 @@ ahci_dma_prepare_buf_fail(void *s, int port) "ahci(%p)[%d]: sglist population fa
ahci_dma_rw_buf(void *s, int port, int l) "ahci(%p)[%d] len=0x%x" ahci_dma_rw_buf(void *s, int port, int l) "ahci(%p)[%d] len=0x%x"
ahci_cmd_done(void *s, int port) "ahci(%p)[%d]: cmd done" ahci_cmd_done(void *s, int port) "ahci(%p)[%d]: cmd done"
ahci_reset(void *s) "ahci(%p): HBA reset" ahci_reset(void *s) "ahci(%p): HBA reset"
allwinner_ahci_mem_read(void *s, void *a, uint64_t addr, uint64_t val, unsigned size) "ahci(%p): read a=%p addr=0x%"HWADDR_PRIx" val=0x%"PRIx64", size=%d" allwinner_ahci_mem_read(void *s, void *a, uint64_t addr, uint64_t val, unsigned size) "ahci(%p): read a=%p addr=0x%"PRIx64" val=0x%"PRIx64", size=%d"
allwinner_ahci_mem_write(void *s, void *a, uint64_t addr, uint64_t val, unsigned size) "ahci(%p): write a=%p addr=0x%"HWADDR_PRIx" val=0x%"PRIx64", size=%d" allwinner_ahci_mem_write(void *s, void *a, uint64_t addr, uint64_t val, unsigned size) "ahci(%p): write a=%p addr=0x%"PRIx64" val=0x%"PRIx64", size=%d"
# Warning: Verbose # Warning: Verbose
handle_reg_h2d_fis_dump(void *s, int port, const char *fis) "ahci(%p)[%d]: %s" handle_reg_h2d_fis_dump(void *s, int port, const char *fis) "ahci(%p)[%d]: %s"

View File

@ -176,12 +176,8 @@ static void mos6522_set_sr_int(MOS6522State *s)
static uint64_t mos6522_get_counter_value(MOS6522State *s, MOS6522Timer *ti) static uint64_t mos6522_get_counter_value(MOS6522State *s, MOS6522Timer *ti)
{ {
uint64_t d; return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - ti->load_time,
d = muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - ti->load_time,
ti->frequency, NANOSECONDS_PER_SECOND); ti->frequency, NANOSECONDS_PER_SECOND);
return d;
} }
static uint64_t mos6522_get_load_time(MOS6522State *s, MOS6522Timer *ti) static uint64_t mos6522_get_load_time(MOS6522State *s, MOS6522Timer *ti)

View File

@ -69,13 +69,13 @@ mps2_fpgaio_reset(void) "MPS2 FPGAIO: reset"
mps2_fpgaio_leds(char led1, char led0) "MPS2 FPGAIO LEDs: %c%c" mps2_fpgaio_leds(char led1, char led0) "MPS2 FPGAIO LEDs: %c%c"
# hw/misc/msf2-sysreg.c # hw/misc/msf2-sysreg.c
msf2_sysreg_write(uint64_t offset, uint32_t val, uint32_t prev) "msf2-sysreg write: addr 0x%08" HWADDR_PRIx " data 0x%" PRIx32 " prev 0x%" PRIx32 msf2_sysreg_write(uint64_t offset, uint32_t val, uint32_t prev) "msf2-sysreg write: addr 0x%08" PRIx64 " data 0x%" PRIx32 " prev 0x%" PRIx32
msf2_sysreg_read(uint64_t offset, uint32_t val) "msf2-sysreg read: addr 0x%08" HWADDR_PRIx " data 0x%08" PRIx32 msf2_sysreg_read(uint64_t offset, uint32_t val) "msf2-sysreg read: addr 0x%08" PRIx64 " data 0x%08" PRIx32
msf2_sysreg_write_pll_status(void) "Invalid write to read only PLL status register" msf2_sysreg_write_pll_status(void) "Invalid write to read only PLL status register"
#hw/misc/imx7_gpr.c #hw/misc/imx7_gpr.c
imx7_gpr_read(uint64_t offset) "addr 0x%08" HWADDR_PRIx imx7_gpr_read(uint64_t offset) "addr 0x%08" PRIx64
imx7_gpr_write(uint64_t offset, uint64_t value) "addr 0x%08" HWADDR_PRIx "value 0x%08" HWADDR_PRIx imx7_gpr_write(uint64_t offset, uint64_t value) "addr 0x%08" PRIx64 "value 0x%08" PRIx64
# hw/misc/mos6522.c # hw/misc/mos6522.c
mos6522_set_counter(int index, unsigned int val) "T%d.counter=%d" mos6522_set_counter(int index, unsigned int val) "T%d.counter=%d"

View File

@ -511,7 +511,6 @@ static uint32_t ftgmac100_rxpoll(FTGMAC100State *s)
uint32_t cnt = 1024 * FTGMAC100_APTC_RXPOLL_CNT(s->aptcr); uint32_t cnt = 1024 * FTGMAC100_APTC_RXPOLL_CNT(s->aptcr);
uint32_t speed = (s->maccr & FTGMAC100_MACCR_FAST_MODE) ? 1 : 0; uint32_t speed = (s->maccr & FTGMAC100_MACCR_FAST_MODE) ? 1 : 0;
uint32_t period;
if (s->aptcr & FTGMAC100_APTC_RXPOLL_TIME_SEL) { if (s->aptcr & FTGMAC100_APTC_RXPOLL_TIME_SEL) {
cnt <<= 4; cnt <<= 4;
@ -521,9 +520,7 @@ static uint32_t ftgmac100_rxpoll(FTGMAC100State *s)
speed = 2; speed = 2;
} }
period = cnt / div[speed]; return cnt / div[speed];
return period;
} }
static void ftgmac100_reset(DeviceState *d) static void ftgmac100_reset(DeviceState *d)

View File

@ -125,25 +125,17 @@ static int pnv_lpc_dt_xscom(PnvXScomInterface *dev, void *fdt, int xscom_offset)
static bool opb_read(PnvLpcController *lpc, uint32_t addr, uint8_t *data, static bool opb_read(PnvLpcController *lpc, uint32_t addr, uint8_t *data,
int sz) int sz)
{ {
bool success;
/* XXX Handle access size limits and FW read caching here */ /* XXX Handle access size limits and FW read caching here */
success = !address_space_rw(&lpc->opb_as, addr, MEMTXATTRS_UNSPECIFIED, return !address_space_rw(&lpc->opb_as, addr, MEMTXATTRS_UNSPECIFIED,
data, sz, false); data, sz, false);
return success;
} }
static bool opb_write(PnvLpcController *lpc, uint32_t addr, uint8_t *data, static bool opb_write(PnvLpcController *lpc, uint32_t addr, uint8_t *data,
int sz) int sz)
{ {
bool success;
/* XXX Handle access size limits here */ /* XXX Handle access size limits here */
success = !address_space_rw(&lpc->opb_as, addr, MEMTXATTRS_UNSPECIFIED, return !address_space_rw(&lpc->opb_as, addr, MEMTXATTRS_UNSPECIFIED,
data, sz, true); data, sz, true);
return success;
} }
#define ECCB_CTL_READ PPC_BIT(15) #define ECCB_CTL_READ PPC_BIT(15)

View File

@ -25,13 +25,10 @@
#ifndef HW_M48T59_INTERNAL_H #ifndef HW_M48T59_INTERNAL_H
#define HW_M48T59_INTERNAL_H 1 #define HW_M48T59_INTERNAL_H 1
//#define DEBUG_NVRAM #define M48T59_DEBUG 0
#if defined(DEBUG_NVRAM) #define NVRAM_PRINTF(fmt, ...) do { \
#define NVRAM_PRINTF(fmt, ...) do { printf(fmt , ## __VA_ARGS__); } while (0) if (M48T59_DEBUG) { printf(fmt , ## __VA_ARGS__); } } while (0)
#else
#define NVRAM_PRINTF(fmt, ...) do { } while (0)
#endif
/* /*
* The M48T02, M48T08 and M48T59 chips are very similar. The newer '59 has * The M48T02, M48T08 and M48T59 chips are very similar. The newer '59 has

View File

@ -456,7 +456,7 @@ static void NVRAM_writeb(void *opaque, hwaddr addr, uint64_t val,
{ {
M48t59State *NVRAM = opaque; M48t59State *NVRAM = opaque;
NVRAM_PRINTF("%s: 0x%08x => 0x%08x\n", __func__, addr, val); NVRAM_PRINTF("%s: 0x%"HWADDR_PRIx" => 0x%"PRIx64"\n", __func__, addr, val);
switch (addr) { switch (addr) {
case 0: case 0:
NVRAM->addr &= ~0x00FF; NVRAM->addr &= ~0x00FF;
@ -488,7 +488,7 @@ static uint64_t NVRAM_readb(void *opaque, hwaddr addr, unsigned size)
retval = -1; retval = -1;
break; break;
} }
NVRAM_PRINTF("%s: 0x%08x <= 0x%08x\n", __func__, addr, retval); NVRAM_PRINTF("%s: 0x%"HWADDR_PRIx" <= 0x%08x\n", __func__, addr, retval);
return retval; return retval;
} }

View File

@ -25,8 +25,6 @@
#ifndef PPC4XX_H #ifndef PPC4XX_H
#define PPC4XX_H #define PPC4XX_H
#include "hw/pci/pci.h"
/* PowerPC 4xx core initialization */ /* PowerPC 4xx core initialization */
PowerPCCPU *ppc4xx_init(const char *cpu_model, PowerPCCPU *ppc4xx_init(const char *cpu_model,
clk_setup_t *cpu_clk, clk_setup_t *tb_clk, clk_setup_t *cpu_clk, clk_setup_t *tb_clk,

View File

@ -17,7 +17,6 @@
#include "standard-headers/linux/virtio_balloon.h" #include "standard-headers/linux/virtio_balloon.h"
#include "hw/virtio/virtio.h" #include "hw/virtio/virtio.h"
#include "hw/pci/pci.h"
#define TYPE_VIRTIO_BALLOON "virtio-balloon-device" #define TYPE_VIRTIO_BALLOON "virtio-balloon-device"
#define VIRTIO_BALLOON(obj) \ #define VIRTIO_BALLOON(obj) \

View File

@ -18,7 +18,6 @@
#include "ui/qemu-pixman.h" #include "ui/qemu-pixman.h"
#include "ui/console.h" #include "ui/console.h"
#include "hw/virtio/virtio.h" #include "hw/virtio/virtio.h"
#include "hw/pci/pci.h"
#include "qemu/log.h" #include "qemu/log.h"
#include "standard-headers/linux/virtio_gpu.h" #include "standard-headers/linux/virtio_gpu.h"

View File

@ -62,7 +62,6 @@ typedef struct NetClientState NetClientState;
typedef struct NetFilterState NetFilterState; typedef struct NetFilterState NetFilterState;
typedef struct NICInfo NICInfo; typedef struct NICInfo NICInfo;
typedef struct NumaNodeMem NumaNodeMem; typedef struct NumaNodeMem NumaNodeMem;
typedef struct PcGuestInfo PcGuestInfo;
typedef struct PCIBridge PCIBridge; typedef struct PCIBridge PCIBridge;
typedef struct PCIBus PCIBus; typedef struct PCIBus PCIBus;
typedef struct PCIDevice PCIDevice; typedef struct PCIDevice PCIDevice;

View File

@ -25,11 +25,7 @@
QIONetListener *qio_net_listener_new(void) QIONetListener *qio_net_listener_new(void)
{ {
QIONetListener *ret; return QIO_NET_LISTENER(object_new(TYPE_QIO_NET_LISTENER));
ret = QIO_NET_LISTENER(object_new(TYPE_QIO_NET_LISTENER));
return ret;
} }
void qio_net_listener_set_name(QIONetListener *listener, void qio_net_listener_set_name(QIONetListener *listener,

View File

@ -450,7 +450,7 @@
# #
# Since: 2.7 # Since: 2.7
# #
# 'dump' - removed with 2.12 # 'dump': dropped in 2.12
## ##
{ 'enum': 'NetClientDriver', { 'enum': 'NetClientDriver',
'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
@ -498,7 +498,7 @@
# #
# Since: 1.2 # Since: 1.2
# #
# 'vlan' - removed with 2.12 # 'vlan': dropped in 2.13
## ##
{ 'struct': 'NetLegacy', { 'struct': 'NetLegacy',
'data': { 'data': {

View File

@ -6,6 +6,9 @@ HXCOMM DEF(command, callback, arg_string) is used to construct
HXCOMM command structures and help message. HXCOMM command structures and help message.
HXCOMM HXCOMM can be used for comments, discarded from both texi and C HXCOMM HXCOMM can be used for comments, discarded from both texi and C
HXCOMM When amending the TEXI sections, please remember to copy the usage
HXCOMM over to the per-command sections in qemu-img.texi.
STEXI STEXI
@table @option @table @option
ETEXI ETEXI
@ -23,13 +26,13 @@ STEXI
ETEXI ETEXI
DEF("check", img_check, DEF("check", img_check,
"check [-q] [--object objectdef] [--image-opts] [-f fmt] [--output=ofmt] [-r [leaks | all]] [-T src_cache] [-U] filename") "check [--object objectdef] [--image-opts] [-q] [-f fmt] [--output=ofmt] [-r [leaks | all]] [-T src_cache] [-U] filename")
STEXI STEXI
@item check [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] [--output=@var{ofmt}] [-r [leaks | all]] [-T @var{src_cache}] [-U] @var{filename} @item check [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] [--output=@var{ofmt}] [-r [leaks | all]] [-T @var{src_cache}] [-U] @var{filename}
ETEXI ETEXI
DEF("commit", img_commit, DEF("commit", img_commit,
"commit [-q] [--object objectdef] [--image-opts] [-f fmt] [-t cache] [-b base] [-d] [-p] filename") "commit [--object objectdef] [--image-opts] [-q] [-f fmt] [-t cache] [-b base] [-d] [-p] filename")
STEXI STEXI
@item commit [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] [-t @var{cache}] [-b @var{base}] [-d] [-p] @var{filename} @item commit [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] [-t @var{cache}] [-b @var{base}] [-d] [-p] @var{filename}
ETEXI ETEXI
@ -47,7 +50,7 @@ STEXI
ETEXI ETEXI
DEF("create", img_create, DEF("create", img_create,
"create [-q] [--object objectdef] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]") "create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]")
STEXI STEXI
@item create [--object @var{objectdef}] [-q] [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}] @item create [--object @var{objectdef}] [-q] [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}]
ETEXI ETEXI
@ -89,9 +92,9 @@ STEXI
ETEXI ETEXI
DEF("resize", img_resize, DEF("resize", img_resize,
"resize [--object objectdef] [--image-opts] [-q] [--shrink] filename [+ | -]size") "resize [--object objectdef] [--image-opts] [-f fmt] [--preallocation=prealloc] [-q] [--shrink] filename [+ | -]size")
STEXI STEXI
@item resize [--object @var{objectdef}] [--image-opts] [-q] [--shrink] @var{filename} [+ | -]@var{size} @item resize [--object @var{objectdef}] [--image-opts] [-f @var{fmt}] [--preallocation=@var{prealloc}] [-q] [--shrink] @var{filename} [+ | -]@var{size}
ETEXI ETEXI
STEXI STEXI

View File

@ -123,7 +123,6 @@ static void QEMU_NORETURN help(void)
" " arg_string "\n" " " arg_string "\n"
#include "qemu-img-cmds.h" #include "qemu-img-cmds.h"
#undef DEF #undef DEF
#undef GEN_DOCS
"\n" "\n"
"Command parameters:\n" "Command parameters:\n"
" 'filename' is a disk image filename\n" " 'filename' is a disk image filename\n"
@ -4716,7 +4715,6 @@ static const img_cmd_t img_cmds[] = {
{ option, callback }, { option, callback },
#include "qemu-img-cmds.h" #include "qemu-img-cmds.h"
#undef DEF #undef DEF
#undef GEN_DOCS
{ NULL, NULL, }, { NULL, NULL, },
}; };

View File

@ -193,7 +193,13 @@ sets the number of input blocks to skip
Command description: Command description:
@table @option @table @option
@item bench [-c @var{count}] [-d @var{depth}] [-f @var{fmt}] [--flush-interval=@var{flush_interval}] [-n] [--no-drain] [-o @var{offset}] [--pattern=@var{pattern}] [-q] [-s @var{buffer_size}] [-S @var{step_size}] [-t @var{cache}] [-w] @var{filename}
@item amend [--object @var{objectdef}] [--image-opts] [-p] [-p] [-f @var{fmt}] [-t @var{cache}] -o @var{options} @var{filename}
Amends the image format specific @var{options} for the image file
@var{filename}. Not all file formats support this operation.
@item bench [-c @var{count}] [-d @var{depth}] [-f @var{fmt}] [--flush-interval=@var{flush_interval}] [-n] [--no-drain] [-o @var{offset}] [--pattern=@var{pattern}] [-q] [-s @var{buffer_size}] [-S @var{step_size}] [-t @var{cache}] [-w] [-U] @var{filename}
Run a simple sequential I/O benchmark on the specified image. If @code{-w} is Run a simple sequential I/O benchmark on the specified image. If @code{-w} is
specified, a write test is performed, otherwise a read test is performed. specified, a write test is performed, otherwise a read test is performed.
@ -217,7 +223,7 @@ specified as well.
For write tests, by default a buffer filled with zeros is written. This can be For write tests, by default a buffer filled with zeros is written. This can be
overridden with a pattern byte specified by @var{pattern}. overridden with a pattern byte specified by @var{pattern}.
@item check [-f @var{fmt}] [--output=@var{ofmt}] [-r [leaks | all]] [-T @var{src_cache}] @var{filename} @item check [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] [--output=@var{ofmt}] [-r [leaks | all]] [-T @var{src_cache}] [-U] @var{filename}
Perform a consistency check on the disk image @var{filename}. The command can Perform a consistency check on the disk image @var{filename}. The command can
output in the format @var{ofmt} which is either @code{human} or @code{json}. output in the format @var{ofmt} which is either @code{human} or @code{json}.
@ -253,31 +259,7 @@ If @code{-r} is specified, exit codes representing the image state refer to the
state after (the attempt at) repairing it. That is, a successful @code{-r all} state after (the attempt at) repairing it. That is, a successful @code{-r all}
will yield the exit code 0, independently of the image state before. will yield the exit code 0, independently of the image state before.
@item create [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}] @item commit [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] [-t @var{cache}] [-b @var{base}] [-d] [-p] @var{filename}
Create the new disk image @var{filename} of size @var{size} and format
@var{fmt}. Depending on the file format, you can add one or more @var{options}
that enable additional features of this format.
If the option @var{backing_file} is specified, then the image will record
only the differences from @var{backing_file}. No size needs to be specified in
this case. @var{backing_file} will never be modified unless you use the
@code{commit} monitor command (or qemu-img commit).
If a relative path name is given, the backing file is looked up relative to
the directory containing @var{filename}.
Note that a given backing file will be opened to check that it is valid. Use
the @code{-u} option to enable unsafe backing file mode, which means that the
image will be created even if the associated backing file cannot be opened. A
matching backing file must be created or additional options be used to make the
backing file specification valid when you want to use an image created this
way.
The size can also be specified using the @var{size} option with @code{-o},
it doesn't need to be specified separately in this case.
@item commit [-q] [-f @var{fmt}] [-t @var{cache}] [-b @var{base}] [-d] [-p] @var{filename}
Commit the changes recorded in @var{filename} in its base image or backing file. Commit the changes recorded in @var{filename} in its base image or backing file.
If the backing file is smaller than the snapshot, then the backing file will be If the backing file is smaller than the snapshot, then the backing file will be
@ -299,7 +281,7 @@ all images between @var{base} and the top image will be invalid and may return
garbage data when read. For this reason, @code{-b} implies @code{-d} (so that garbage data when read. For this reason, @code{-b} implies @code{-d} (so that
the top image stays valid). the top image stays valid).
@item compare [-f @var{fmt}] [-F @var{fmt}] [-T @var{src_cache}] [-p] [-s] [-q] @var{filename1} @var{filename2} @item compare [--object @var{objectdef}] [--image-opts] [-f @var{fmt}] [-F @var{fmt}] [-T @var{src_cache}] [-p] [-q] [-s] [-U] @var{filename1} @var{filename2}
Check if two images have the same content. You can compare images with Check if two images have the same content. You can compare images with
different format or settings. different format or settings.
@ -340,7 +322,7 @@ Error on reading data
@end table @end table
@item convert [-c] [-p] [-n] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-O @var{output_fmt}] [-B @var{backing_file}] [-o @var{options}] [-s @var{snapshot_id_or_name}] [-l @var{snapshot_param}] [-m @var{num_coroutines}] [-W] [-S @var{sparse_size}] @var{filename} [@var{filename2} [...]] @var{output_filename} @item convert [--object @var{objectdef}] [--image-opts] [--target-image-opts] [-U] [-c] [-p] [-q] [-n] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-O @var{output_fmt}] [-B @var{backing_file}] [-o @var{options}] [-s @var{snapshot_id_or_name}] [-l @var{snapshot_param}] [-S @var{sparse_size}] [-m @var{num_coroutines}] [-W] @var{filename} [@var{filename2} [...]] @var{output_filename}
Convert the disk image @var{filename} or a snapshot @var{snapshot_param}(@var{snapshot_id_or_name} is deprecated) Convert the disk image @var{filename} or a snapshot @var{snapshot_param}(@var{snapshot_id_or_name} is deprecated)
to disk image @var{output_filename} using format @var{output_fmt}. It can be optionally compressed (@code{-c} to disk image @var{output_filename} using format @var{output_fmt}. It can be optionally compressed (@code{-c}
@ -381,7 +363,31 @@ creating compressed images.
@var{num_coroutines} specifies how many coroutines work in parallel during @var{num_coroutines} specifies how many coroutines work in parallel during
the convert process (defaults to 8). the convert process (defaults to 8).
@item dd [-f @var{fmt}] [-O @var{output_fmt}] [bs=@var{block_size}] [count=@var{blocks}] [skip=@var{blocks}] if=@var{input} of=@var{output} @item create [--object @var{objectdef}] [-q] [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}]
Create the new disk image @var{filename} of size @var{size} and format
@var{fmt}. Depending on the file format, you can add one or more @var{options}
that enable additional features of this format.
If the option @var{backing_file} is specified, then the image will record
only the differences from @var{backing_file}. No size needs to be specified in
this case. @var{backing_file} will never be modified unless you use the
@code{commit} monitor command (or qemu-img commit).
If a relative path name is given, the backing file is looked up relative to
the directory containing @var{filename}.
Note that a given backing file will be opened to check that it is valid. Use
the @code{-u} option to enable unsafe backing file mode, which means that the
image will be created even if the associated backing file cannot be opened. A
matching backing file must be created or additional options be used to make the
backing file specification valid when you want to use an image created this
way.
The size can also be specified using the @var{size} option with @code{-o},
it doesn't need to be specified separately in this case.
@item dd [--image-opts] [-U] [-f @var{fmt}] [-O @var{output_fmt}] [bs=@var{block_size}] [count=@var{blocks}] [skip=@var{blocks}] if=@var{input} of=@var{output}
Dd copies from @var{input} file to @var{output} file converting it from Dd copies from @var{input} file to @var{output} file converting it from
@var{fmt} format to @var{output_fmt} format. @var{fmt} format to @var{output_fmt} format.
@ -392,7 +398,7 @@ dd will stop reading input after reading @var{blocks} input blocks.
The size syntax is similar to dd(1)'s size syntax. The size syntax is similar to dd(1)'s size syntax.
@item info [-f @var{fmt}] [--output=@var{ofmt}] [--backing-chain] @var{filename} @item info [--object @var{objectdef}] [--image-opts] [-f @var{fmt}] [--output=@var{ofmt}] [--backing-chain] [-U] @var{filename}
Give information about the disk image @var{filename}. Use it in Give information about the disk image @var{filename}. Use it in
particular to know the size reserved on disk which can be different particular to know the size reserved on disk which can be different
@ -500,11 +506,11 @@ been written to all sectors. This is the maximum size that the image file can
occupy with the exception of internal snapshots, dirty bitmaps, vmstate data, occupy with the exception of internal snapshots, dirty bitmaps, vmstate data,
and other advanced image format features. and other advanced image format features.
@item snapshot [-l | -a @var{snapshot} | -c @var{snapshot} | -d @var{snapshot} ] @var{filename} @item snapshot [--object @var{objectdef}] [--image-opts] [-U] [-q] [-l | -a @var{snapshot} | -c @var{snapshot} | -d @var{snapshot}] @var{filename}
List, apply, create or delete snapshots in image @var{filename}. List, apply, create or delete snapshots in image @var{filename}.
@item rebase [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-p] [-u] -b @var{backing_file} [-F @var{backing_fmt}] @var{filename} @item rebase [--object @var{objectdef}] [--image-opts] [-U] [-q] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-p] [-u] -b @var{backing_file} [-F @var{backing_fmt}] @var{filename}
Changes the backing file of an image. Only the formats @code{qcow2} and Changes the backing file of an image. Only the formats @code{qcow2} and
@code{qed} support changing the backing file. @code{qed} support changing the backing file.
@ -564,7 +570,7 @@ qemu-img rebase -b base.img diff.qcow2
At this point, @code{modified.img} can be discarded, since At this point, @code{modified.img} can be discarded, since
@code{base.img + diff.qcow2} contains the same information. @code{base.img + diff.qcow2} contains the same information.
@item resize [--shrink] [--preallocation=@var{prealloc}] @var{filename} [+ | -]@var{size} @item resize [--object @var{objectdef}] [--image-opts] [-f @var{fmt}] [--preallocation=@var{prealloc}] [-q] [--shrink] @var{filename} [+ | -]@var{size}
Change the disk image as if it had been created with @var{size}. Change the disk image as if it had been created with @var{size}.
@ -585,10 +591,6 @@ how the additional image area should be allocated on the host. See the format
description in the @code{NOTES} section which values are allowed. Using this description in the @code{NOTES} section which values are allowed. Using this
option may result in slightly more data being allocated than necessary. option may result in slightly more data being allocated than necessary.
@item amend [-p] [-f @var{fmt}] [-t @var{cache}] -o @var{options} @var{filename}
Amends the image format specific @var{options} for the image file
@var{filename}. Not all file formats support this operation.
@end table @end table
@c man end @c man end

View File

@ -2,9 +2,8 @@ Specify tracing options.
@table @option @table @option
@item [enable=]@var{pattern} @item [enable=]@var{pattern}
Immediately enable events matching @var{pattern}. Immediately enable events matching @var{pattern}
The file must contain one event name (as listed in the @file{trace-events-all} (either event name or a globbing pattern). This option is only
file) per line; globbing patterns are accepted too. This option is only
available if QEMU has been compiled with the @var{simple}, @var{log} available if QEMU has been compiled with the @var{simple}, @var{log}
or @var{ftrace} tracing backend. To specify multiple events or patterns, or @var{ftrace} tracing backend. To specify multiple events or patterns,
specify the @option{-trace} option multiple times. specify the @option{-trace} option multiple times.

View File

@ -34,7 +34,6 @@
#undef DEF #undef DEF
#undef DEFHEADING #undef DEFHEADING
#undef ARCHHEADING #undef ARCHHEADING
#undef GEN_DOCS
#undef QEMU_OPTIONS_GENERATE_ENUM #undef QEMU_OPTIONS_GENERATE_ENUM
#undef QEMU_OPTIONS_GENERATE_HELP #undef QEMU_OPTIONS_GENERATE_HELP

View File

@ -33,7 +33,7 @@ void arp_table_add(Slirp *slirp, uint32_t ip_addr, uint8_t ethaddr[ETH_ALEN])
int i; int i;
DEBUG_CALL("arp_table_add"); DEBUG_CALL("arp_table_add");
DEBUG_ARG("ip = 0x%x", ip_addr); DEBUG_ARG("ip = %s", inet_ntoa(*(struct in_addr *)&ip_addr));
DEBUG_ARGS((dfd, " hw addr = %02x:%02x:%02x:%02x:%02x:%02x\n", DEBUG_ARGS((dfd, " hw addr = %02x:%02x:%02x:%02x:%02x:%02x\n",
ethaddr[0], ethaddr[1], ethaddr[2], ethaddr[0], ethaddr[1], ethaddr[2],
ethaddr[3], ethaddr[4], ethaddr[5])); ethaddr[3], ethaddr[4], ethaddr[5]));
@ -67,7 +67,7 @@ bool arp_table_search(Slirp *slirp, uint32_t ip_addr,
int i; int i;
DEBUG_CALL("arp_table_search"); DEBUG_CALL("arp_table_search");
DEBUG_ARG("ip = 0x%x", ip_addr); DEBUG_ARG("ip = %s", inet_ntoa(*(struct in_addr *)&ip_addr));
/* If broadcast address */ /* If broadcast address */
if (ip_addr == 0xffffffff || ip_addr == broadcast_addr) { if (ip_addr == 0xffffffff || ip_addr == broadcast_addr) {

View File

@ -701,10 +701,10 @@ tcp_listen(Slirp *slirp, uint32_t haddr, u_int hport, uint32_t laddr,
memset(&addr, 0, addrlen); memset(&addr, 0, addrlen);
DEBUG_CALL("tcp_listen"); DEBUG_CALL("tcp_listen");
DEBUG_ARG("haddr = %x", haddr); DEBUG_ARG("haddr = %s", inet_ntoa(*(struct in_addr *)&haddr));
DEBUG_ARG("hport = %d", hport); DEBUG_ARG("hport = %d", ntohs(hport));
DEBUG_ARG("laddr = %x", laddr); DEBUG_ARG("laddr = %s", inet_ntoa(*(struct in_addr *)&laddr));
DEBUG_ARG("lport = %d", lport); DEBUG_ARG("lport = %d", ntohs(lport));
DEBUG_ARG("flags = %x", flags); DEBUG_ARG("flags = %x", flags);
so = socreate(slirp); so = socreate(slirp);

View File

@ -241,8 +241,8 @@ int udp_output(struct socket *so, struct mbuf *m,
DEBUG_CALL("udp_output"); DEBUG_CALL("udp_output");
DEBUG_ARG("so = %p", so); DEBUG_ARG("so = %p", so);
DEBUG_ARG("m = %p", m); DEBUG_ARG("m = %p", m);
DEBUG_ARG("saddr = %lx", (long)saddr->sin_addr.s_addr); DEBUG_ARG("saddr = %s", inet_ntoa(saddr->sin_addr));
DEBUG_ARG("daddr = %lx", (long)daddr->sin_addr.s_addr); DEBUG_ARG("daddr = %s", inet_ntoa(daddr->sin_addr));
/* /*
* Adjust for header * Adjust for header

View File

@ -257,10 +257,7 @@ int hax_host_setup_vcpu_channel(struct hax_vcpu_state *vcpu)
int hax_vcpu_run(struct hax_vcpu_state *vcpu) int hax_vcpu_run(struct hax_vcpu_state *vcpu)
{ {
int ret; return ioctl(vcpu->fd, HAX_VCPU_IOCTL_RUN, NULL);
ret = ioctl(vcpu->fd, HAX_VCPU_IOCTL_RUN, NULL);
return ret;
} }
int hax_sync_fpu(CPUArchState *env, struct fx_layout *fl, int set) int hax_sync_fpu(CPUArchState *env, struct fx_layout *fl, int set)
@ -315,13 +312,12 @@ int hax_sync_vcpu_state(CPUArchState *env, struct vcpu_state_t *state, int set)
int hax_inject_interrupt(CPUArchState *env, int vector) int hax_inject_interrupt(CPUArchState *env, int vector)
{ {
int ret, fd; int fd;
fd = hax_vcpu_get_fd(env); fd = hax_vcpu_get_fd(env);
if (fd <= 0) { if (fd <= 0) {
return -1; return -1;
} }
ret = ioctl(fd, HAX_VCPU_IOCTL_INTERRUPT, &vector); return ioctl(fd, HAX_VCPU_IOCTL_INTERRUPT, &vector);
return ret;
} }

View File

@ -113,7 +113,7 @@ typedef struct DisasContext {
int rex_x, rex_b; int rex_x, rex_b;
#endif #endif
int vex_l; /* vex vector length */ int vex_l; /* vex vector length */
int vex_v; /* vex vvvv register, without 1's compliment. */ int vex_v; /* vex vvvv register, without 1's complement. */
int ss32; /* 32 bit stack segment */ int ss32; /* 32 bit stack segment */
CCOp cc_op; /* current CC operation */ CCOp cc_op; /* current CC operation */
bool cc_op_dirty; bool cc_op_dirty;

View File

@ -4002,7 +4002,7 @@ DISAS_INSN(bfext_reg)
TCGv shift; TCGv shift;
/* In general, we're going to rotate the field so that it's at the /* In general, we're going to rotate the field so that it's at the
top of the word and then right-shift by the compliment of the top of the word and then right-shift by the complement of the
width to extend the field. */ width to extend the field. */
if (ext & 0x20) { if (ext & 0x20) {
/* Variable width. */ /* Variable width. */

View File

@ -3274,14 +3274,11 @@ target_ulong helper_dextr_l(target_ulong ac, target_ulong shift,
CPUMIPSState *env) CPUMIPSState *env)
{ {
uint64_t temp[3]; uint64_t temp[3];
target_ulong result;
shift = shift & 0x3F; shift = shift & 0x3F;
mipsdsp_rndrashift_acc(temp, ac, shift, env); mipsdsp_rndrashift_acc(temp, ac, shift, env);
result = (temp[1] << 63) | (temp[0] >> 1); return (temp[1] << 63) | (temp[0] >> 1);
return result;
} }
target_ulong helper_dextr_r_l(target_ulong ac, target_ulong shift, target_ulong helper_dextr_r_l(target_ulong ac, target_ulong shift,
@ -3289,7 +3286,6 @@ target_ulong helper_dextr_r_l(target_ulong ac, target_ulong shift,
{ {
uint64_t temp[3]; uint64_t temp[3];
uint32_t temp128; uint32_t temp128;
target_ulong result;
shift = shift & 0x3F; shift = shift & 0x3F;
mipsdsp_rndrashift_acc(temp, ac, shift, env); mipsdsp_rndrashift_acc(temp, ac, shift, env);
@ -3309,9 +3305,7 @@ target_ulong helper_dextr_r_l(target_ulong ac, target_ulong shift,
set_DSPControl_overflow_flag(1, 23, env); set_DSPControl_overflow_flag(1, 23, env);
} }
result = (temp[1] << 63) | (temp[0] >> 1); return (temp[1] << 63) | (temp[0] >> 1);
return result;
} }
target_ulong helper_dextr_rs_l(target_ulong ac, target_ulong shift, target_ulong helper_dextr_rs_l(target_ulong ac, target_ulong shift,
@ -3319,7 +3313,6 @@ target_ulong helper_dextr_rs_l(target_ulong ac, target_ulong shift,
{ {
uint64_t temp[3]; uint64_t temp[3];
uint32_t temp128; uint32_t temp128;
target_ulong result;
shift = shift & 0x3F; shift = shift & 0x3F;
mipsdsp_rndrashift_acc(temp, ac, shift, env); mipsdsp_rndrashift_acc(temp, ac, shift, env);
@ -3345,9 +3338,7 @@ target_ulong helper_dextr_rs_l(target_ulong ac, target_ulong shift,
} }
set_DSPControl_overflow_flag(1, 23, env); set_DSPControl_overflow_flag(1, 23, env);
} }
result = (temp[1] << 63) | (temp[0] >> 1); return (temp[1] << 63) | (temp[0] >> 1);
return result;
} }
#endif #endif

View File

@ -1736,9 +1736,7 @@ Operand_arr_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_arr_encode (uint32 *valp) Operand_arr_encode (uint32 *valp)
{ {
int error; return (*valp & ~0xf) != 0;
error = (*valp & ~0xf) != 0;
return error;
} }
static int static int
@ -1750,9 +1748,7 @@ Operand_ars_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ars_encode (uint32 *valp) Operand_ars_encode (uint32 *valp)
{ {
int error; return (*valp & ~0xf) != 0;
error = (*valp & ~0xf) != 0;
return error;
} }
static int static int
@ -1764,9 +1760,7 @@ Operand_art_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_art_encode (uint32 *valp) Operand_art_encode (uint32 *valp)
{ {
int error; return (*valp & ~0xf) != 0;
error = (*valp & ~0xf) != 0;
return error;
} }
static int static int
@ -1778,9 +1772,7 @@ Operand_ar0_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ar0_encode (uint32 *valp) Operand_ar0_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x1f) != 0;
error = (*valp & ~0x1f) != 0;
return error;
} }
static int static int
@ -1792,9 +1784,7 @@ Operand_ar4_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ar4_encode (uint32 *valp) Operand_ar4_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x1f) != 0;
error = (*valp & ~0x1f) != 0;
return error;
} }
static int static int
@ -1806,9 +1796,7 @@ Operand_ar8_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ar8_encode (uint32 *valp) Operand_ar8_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x1f) != 0;
error = (*valp & ~0x1f) != 0;
return error;
} }
static int static int
@ -1820,9 +1808,7 @@ Operand_ar12_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ar12_encode (uint32 *valp) Operand_ar12_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x1f) != 0;
error = (*valp & ~0x1f) != 0;
return error;
} }
static int static int
@ -1834,9 +1820,7 @@ Operand_ars_entry_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ars_entry_encode (uint32 *valp) Operand_ars_entry_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x1f) != 0;
error = (*valp & ~0x1f) != 0;
return error;
} }
static int static int
@ -2406,9 +2390,7 @@ Operand_mx_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_mx_encode (uint32 *valp) Operand_mx_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3) != 0;
error = (*valp & ~0x3) != 0;
return error;
} }
static int static int
@ -2436,9 +2418,7 @@ Operand_mw_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_mw_encode (uint32 *valp) Operand_mw_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3) != 0;
error = (*valp & ~0x3) != 0;
return error;
} }
static int static int
@ -2450,9 +2430,7 @@ Operand_mr0_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_mr0_encode (uint32 *valp) Operand_mr0_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3) != 0;
error = (*valp & ~0x3) != 0;
return error;
} }
static int static int
@ -2464,9 +2442,7 @@ Operand_mr1_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_mr1_encode (uint32 *valp) Operand_mr1_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3) != 0;
error = (*valp & ~0x3) != 0;
return error;
} }
static int static int
@ -2478,9 +2454,7 @@ Operand_mr2_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_mr2_encode (uint32 *valp) Operand_mr2_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3) != 0;
error = (*valp & ~0x3) != 0;
return error;
} }
static int static int
@ -2492,9 +2466,7 @@ Operand_mr3_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_mr3_encode (uint32 *valp) Operand_mr3_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3) != 0;
error = (*valp & ~0x3) != 0;
return error;
} }
static int static int

View File

@ -1817,9 +1817,7 @@ Operand_arr_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_arr_encode (uint32 *valp) Operand_arr_encode (uint32 *valp)
{ {
int error; return (*valp & ~0xf) != 0;
error = (*valp & ~0xf) != 0;
return error;
} }
static int static int
@ -1831,9 +1829,7 @@ Operand_ars_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ars_encode (uint32 *valp) Operand_ars_encode (uint32 *valp)
{ {
int error; return (*valp & ~0xf) != 0;
error = (*valp & ~0xf) != 0;
return error;
} }
static int static int
@ -1845,9 +1841,7 @@ Operand_art_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_art_encode (uint32 *valp) Operand_art_encode (uint32 *valp)
{ {
int error; return (*valp & ~0xf) != 0;
error = (*valp & ~0xf) != 0;
return error;
} }
static int static int
@ -1859,9 +1853,7 @@ Operand_ar0_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ar0_encode (uint32 *valp) Operand_ar0_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x1f) != 0;
error = (*valp & ~0x1f) != 0;
return error;
} }
static int static int
@ -1873,9 +1865,7 @@ Operand_ar4_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ar4_encode (uint32 *valp) Operand_ar4_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x1f) != 0;
error = (*valp & ~0x1f) != 0;
return error;
} }
static int static int
@ -1887,9 +1877,7 @@ Operand_ar8_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ar8_encode (uint32 *valp) Operand_ar8_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x1f) != 0;
error = (*valp & ~0x1f) != 0;
return error;
} }
static int static int
@ -1901,9 +1889,7 @@ Operand_ar12_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ar12_encode (uint32 *valp) Operand_ar12_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x1f) != 0;
error = (*valp & ~0x1f) != 0;
return error;
} }
static int static int
@ -1915,9 +1901,7 @@ Operand_ars_entry_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ars_entry_encode (uint32 *valp) Operand_ars_entry_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x1f) != 0;
error = (*valp & ~0x1f) != 0;
return error;
} }
static int static int
@ -2487,9 +2471,7 @@ Operand_mx_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_mx_encode (uint32 *valp) Operand_mx_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3) != 0;
error = (*valp & ~0x3) != 0;
return error;
} }
static int static int
@ -2517,9 +2499,7 @@ Operand_mw_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_mw_encode (uint32 *valp) Operand_mw_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3) != 0;
error = (*valp & ~0x3) != 0;
return error;
} }
static int static int
@ -2531,9 +2511,7 @@ Operand_mr0_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_mr0_encode (uint32 *valp) Operand_mr0_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3) != 0;
error = (*valp & ~0x3) != 0;
return error;
} }
static int static int
@ -2545,9 +2523,7 @@ Operand_mr1_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_mr1_encode (uint32 *valp) Operand_mr1_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3) != 0;
error = (*valp & ~0x3) != 0;
return error;
} }
static int static int
@ -2559,9 +2535,7 @@ Operand_mr2_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_mr2_encode (uint32 *valp) Operand_mr2_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3) != 0;
error = (*valp & ~0x3) != 0;
return error;
} }
static int static int
@ -2573,9 +2547,7 @@ Operand_mr3_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_mr3_encode (uint32 *valp) Operand_mr3_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3) != 0;
error = (*valp & ~0x3) != 0;
return error;
} }
static int static int

View File

@ -1798,9 +1798,7 @@ OperandSem_opnd_sem_AR_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_AR_encode (uint32 *valp) OperandSem_opnd_sem_AR_encode (uint32 *valp)
{ {
int error; return (*valp >= 32);
error = (*valp >= 32);
return error;
} }
static int static int
@ -1812,9 +1810,7 @@ OperandSem_opnd_sem_AR_0_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_AR_0_encode (uint32 *valp) OperandSem_opnd_sem_AR_0_encode (uint32 *valp)
{ {
int error; return (*valp >= 32);
error = (*valp >= 32);
return error;
} }
static int static int
@ -1826,9 +1822,7 @@ OperandSem_opnd_sem_AR_1_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_AR_1_encode (uint32 *valp) OperandSem_opnd_sem_AR_1_encode (uint32 *valp)
{ {
int error; return (*valp >= 32);
error = (*valp >= 32);
return error;
} }
static int static int
@ -1840,9 +1834,7 @@ OperandSem_opnd_sem_AR_2_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_AR_2_encode (uint32 *valp) OperandSem_opnd_sem_AR_2_encode (uint32 *valp)
{ {
int error; return (*valp >= 32);
error = (*valp >= 32);
return error;
} }
static int static int
@ -1854,9 +1846,7 @@ OperandSem_opnd_sem_AR_3_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_AR_3_encode (uint32 *valp) OperandSem_opnd_sem_AR_3_encode (uint32 *valp)
{ {
int error; return (*valp >= 32);
error = (*valp >= 32);
return error;
} }
static int static int
@ -1868,9 +1858,7 @@ OperandSem_opnd_sem_AR_4_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_AR_4_encode (uint32 *valp) OperandSem_opnd_sem_AR_4_encode (uint32 *valp)
{ {
int error; return (*valp >= 32);
error = (*valp >= 32);
return error;
} }
static int static int
@ -2464,9 +2452,7 @@ OperandSem_opnd_sem_MR_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_MR_encode (uint32 *valp) OperandSem_opnd_sem_MR_encode (uint32 *valp)
{ {
int error; return (*valp >= 4);
error = (*valp >= 4);
return error;
} }
static int static int
@ -2478,9 +2464,7 @@ OperandSem_opnd_sem_MR_1_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_MR_1_encode (uint32 *valp) OperandSem_opnd_sem_MR_1_encode (uint32 *valp)
{ {
int error; return (*valp >= 4);
error = (*valp >= 4);
return error;
} }
static int static int
@ -2492,9 +2476,7 @@ OperandSem_opnd_sem_MR_2_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_MR_2_encode (uint32 *valp) OperandSem_opnd_sem_MR_2_encode (uint32 *valp)
{ {
int error; return (*valp >= 4);
error = (*valp >= 4);
return error;
} }
static int static int
@ -2506,9 +2488,7 @@ OperandSem_opnd_sem_MR_3_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_MR_3_encode (uint32 *valp) OperandSem_opnd_sem_MR_3_encode (uint32 *valp)
{ {
int error; return (*valp >= 4);
error = (*valp >= 4);
return error;
} }
static int static int
@ -2520,9 +2500,7 @@ OperandSem_opnd_sem_MR_4_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_MR_4_encode (uint32 *valp) OperandSem_opnd_sem_MR_4_encode (uint32 *valp)
{ {
int error; return (*valp >= 4);
error = (*valp >= 4);
return error;
} }
static int static int
@ -2534,9 +2512,7 @@ OperandSem_opnd_sem_MR_5_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_MR_5_encode (uint32 *valp) OperandSem_opnd_sem_MR_5_encode (uint32 *valp)
{ {
int error; return (*valp >= 4);
error = (*valp >= 4);
return error;
} }
static int static int

View File

@ -1379,9 +1379,7 @@ Operand_arr_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_arr_encode (uint32 *valp) Operand_arr_encode (uint32 *valp)
{ {
int error; return (*valp & ~0xf) != 0;
error = (*valp & ~0xf) != 0;
return error;
} }
static int static int
@ -1393,9 +1391,7 @@ Operand_ars_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ars_encode (uint32 *valp) Operand_ars_encode (uint32 *valp)
{ {
int error; return (*valp & ~0xf) != 0;
error = (*valp & ~0xf) != 0;
return error;
} }
static int static int
@ -1407,9 +1403,7 @@ Operand_art_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_art_encode (uint32 *valp) Operand_art_encode (uint32 *valp)
{ {
int error; return (*valp & ~0xf) != 0;
error = (*valp & ~0xf) != 0;
return error;
} }
static int static int
@ -1421,9 +1415,7 @@ Operand_ar0_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ar0_encode (uint32 *valp) Operand_ar0_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3f) != 0;
error = (*valp & ~0x3f) != 0;
return error;
} }
static int static int
@ -1435,9 +1427,7 @@ Operand_ar4_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ar4_encode (uint32 *valp) Operand_ar4_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3f) != 0;
error = (*valp & ~0x3f) != 0;
return error;
} }
static int static int
@ -1449,9 +1439,7 @@ Operand_ar8_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ar8_encode (uint32 *valp) Operand_ar8_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3f) != 0;
error = (*valp & ~0x3f) != 0;
return error;
} }
static int static int
@ -1463,9 +1451,7 @@ Operand_ar12_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ar12_encode (uint32 *valp) Operand_ar12_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3f) != 0;
error = (*valp & ~0x3f) != 0;
return error;
} }
static int static int
@ -1477,9 +1463,7 @@ Operand_ars_entry_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
Operand_ars_entry_encode (uint32 *valp) Operand_ars_entry_encode (uint32 *valp)
{ {
int error; return (*valp & ~0x3f) != 0;
error = (*valp & ~0x3f) != 0;
return error;
} }
static int static int

View File

@ -1570,9 +1570,7 @@ OperandSem_opnd_sem_AR_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_AR_encode (uint32 *valp) OperandSem_opnd_sem_AR_encode (uint32 *valp)
{ {
int error; return (*valp >= 32);
error = (*valp >= 32);
return error;
} }
static int static int
@ -1584,9 +1582,7 @@ OperandSem_opnd_sem_AR_0_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_AR_0_encode (uint32 *valp) OperandSem_opnd_sem_AR_0_encode (uint32 *valp)
{ {
int error; return (*valp >= 32);
error = (*valp >= 32);
return error;
} }
static int static int
@ -1598,9 +1594,7 @@ OperandSem_opnd_sem_AR_1_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_AR_1_encode (uint32 *valp) OperandSem_opnd_sem_AR_1_encode (uint32 *valp)
{ {
int error; return (*valp >= 32);
error = (*valp >= 32);
return error;
} }
static int static int
@ -1612,9 +1606,7 @@ OperandSem_opnd_sem_AR_2_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_AR_2_encode (uint32 *valp) OperandSem_opnd_sem_AR_2_encode (uint32 *valp)
{ {
int error; return (*valp >= 32);
error = (*valp >= 32);
return error;
} }
static int static int
@ -1626,9 +1618,7 @@ OperandSem_opnd_sem_AR_3_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_AR_3_encode (uint32 *valp) OperandSem_opnd_sem_AR_3_encode (uint32 *valp)
{ {
int error; return (*valp >= 32);
error = (*valp >= 32);
return error;
} }
static int static int
@ -1640,9 +1630,7 @@ OperandSem_opnd_sem_AR_4_decode (uint32 *valp ATTRIBUTE_UNUSED)
static int static int
OperandSem_opnd_sem_AR_4_encode (uint32 *valp) OperandSem_opnd_sem_AR_4_encode (uint32 *valp)
{ {
int error; return (*valp >= 32);
error = (*valp >= 32);
return error;
} }
static int static int

View File

@ -1272,11 +1272,8 @@ XtensaOpcodeOps *
xtensa_find_opcode_ops(const XtensaOpcodeTranslators *t, xtensa_find_opcode_ops(const XtensaOpcodeTranslators *t,
const char *name) const char *name)
{ {
XtensaOpcodeOps *ops; return bsearch(name, t->opcode, t->num_opcodes,
ops = bsearch(name, t->opcode, t->num_opcodes,
sizeof(XtensaOpcodeOps), compare_opcode_ops); sizeof(XtensaOpcodeOps), compare_opcode_ops);
return ops;
} }
static void translate_abs(DisasContext *dc, const uint32_t arg[], static void translate_abs(DisasContext *dc, const uint32_t arg[],

View File

@ -561,7 +561,7 @@ E.g. VECL=1 -> 64 << 1 -> v128, and VECE=2 -> 1 << 2 -> i32.
* orc_vec v0, v1, v2 * orc_vec v0, v1, v2
* not_vec v0, v1 * not_vec v0, v1
Similarly, logical operations with and without compliment. Similarly, logical operations with and without complement.
Note that VECE is unused. Note that VECE is unused.
* shli_vec v0, v1, i2 * shli_vec v0, v1, i2

View File

@ -256,8 +256,6 @@ static void base_setup(void)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int ret;
base_setup(); base_setup();
g_test_init(&argc, &argv, NULL); g_test_init(&argc, &argv, NULL);
@ -267,7 +265,5 @@ int main(int argc, char **argv)
qtest_add_func("/rtc/bcd-check-time", bcd_check_time); qtest_add_func("/rtc/bcd-check-time", bcd_check_time);
} }
qtest_add_func("/rtc/fuzz-registers", fuzz_registers); qtest_add_func("/rtc/fuzz-registers", fuzz_registers);
ret = g_test_run(); return g_test_run();
return ret;
} }

View File

@ -224,8 +224,6 @@ static void test_cancel_async(void)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int ret;
qemu_init_main_loop(&error_abort); qemu_init_main_loop(&error_abort);
ctx = qemu_get_current_aio_context(); ctx = qemu_get_current_aio_context();
pool = aio_get_thread_pool(ctx); pool = aio_get_thread_pool(ctx);
@ -238,7 +236,5 @@ int main(int argc, char **argv)
g_test_add_func("/thread-pool/cancel", test_cancel); g_test_add_func("/thread-pool/cancel", test_cancel);
g_test_add_func("/thread-pool/cancel-async", test_cancel_async); g_test_add_func("/thread-pool/cancel-async", test_cancel_async);
ret = g_test_run(); return g_test_run();
return ret;
} }

View File

@ -125,7 +125,7 @@ void *tpm_emu_ctrl_thread(void *data)
case CMD_SHUTDOWN: { case CMD_SHUTDOWN: {
ptm_res res = 0; ptm_res res = 0;
qio_channel_write(ioc, (char *)&res, sizeof(res), &error_abort); qio_channel_write(ioc, (char *)&res, sizeof(res), &error_abort);
qio_channel_close(s->tpm_ioc, &error_abort); /* the tpm data thread is expected to finish now */
g_thread_join(s->emu_tpm_thread); g_thread_join(s->emu_tpm_thread);
break; break;
} }

View File

@ -1065,10 +1065,7 @@ URI *uri_parse_raw(const char *str, int raw)
*/ */
URI *uri_new(void) URI *uri_new(void)
{ {
URI *ret; return g_new0(URI, 1);
ret = g_new0(URI, 1);
return ret;
} }
/** /**

View File

@ -522,8 +522,7 @@ static IOVAMapping *qemu_vfio_add_mapping(QEMUVFIOState *s,
assert(index >= 0); assert(index >= 0);
s->nr_mappings++; s->nr_mappings++;
s->mappings = g_realloc_n(s->mappings, sizeof(s->mappings[0]), s->mappings = g_renew(IOVAMapping, s->mappings, s->nr_mappings);
s->nr_mappings);
insert = &s->mappings[index]; insert = &s->mappings[index];
shift = s->nr_mappings - index - 1; shift = s->nr_mappings - index - 1;
if (shift) { if (shift) {
@ -577,8 +576,7 @@ static void qemu_vfio_undo_mapping(QEMUVFIOState *s, IOVAMapping *mapping,
memmove(mapping, &s->mappings[index + 1], memmove(mapping, &s->mappings[index + 1],
sizeof(s->mappings[0]) * (s->nr_mappings - index - 1)); sizeof(s->mappings[0]) * (s->nr_mappings - index - 1));
s->nr_mappings--; s->nr_mappings--;
s->mappings = g_realloc_n(s->mappings, sizeof(s->mappings[0]), s->mappings = g_renew(IOVAMapping, s->mappings, s->nr_mappings);
s->nr_mappings);
} }
/* Check if the mapping list is (ascending) ordered. */ /* Check if the mapping list is (ascending) ordered. */

4
vl.c
View File

@ -4011,6 +4011,10 @@ int main(int argc, char **argv, char **envp)
exit(1); exit(1);
} }
break; break;
case QEMU_OPTION_nodefconfig:
case QEMU_OPTION_nouserconfig:
/* Nothing to be parsed here. Especially, do not error out below. */
break;
default: default:
if (os_parse_cmd_args(popt->index, optarg)) { if (os_parse_cmd_args(popt->index, optarg)) {
error_report("Option not supported in this build"); error_report("Option not supported in this build");