mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge tag 'pull-misc-2022-12-14' of https://repo.or.cz/qemu/armbru into staging
Miscellaneous patches for 2022-12-14 # gpg: Signature made Wed 14 Dec 2022 15:23:02 GMT # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * tag 'pull-misc-2022-12-14' of https://repo.or.cz/qemu/armbru: ppc4xx_sdram: Simplify sdram_ddr_size() to return block/vmdk: Simplify vmdk_co_create() to return directly cleanup: Tweak and re-run return_directly.cocci io: Tidy up fat-fingered parameter name qapi: Use returned bool to check for failure (again) sockets: Use ERRP_GUARD() where obviously appropriate qemu-config: Use ERRP_GUARD() where obviously appropriate qemu-config: Make config_parse_qdict() return bool monitor: Use ERRP_GUARD() in monitor_init() monitor: Simplify monitor_fd_param()'s error handling error: Move ERRP_GUARD() to the beginning of the function error: Drop a few superfluous ERRP_GUARD() error: Drop some obviously superfluous error_propagate() Drop more useless casts from void * to pointer Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
+1
-4
@@ -3586,7 +3586,6 @@ static void kvm_set_dirty_ring_size(Object *obj, Visitor *v,
|
||||
Error **errp)
|
||||
{
|
||||
KVMState *s = KVM_STATE(obj);
|
||||
Error *error = NULL;
|
||||
uint32_t value;
|
||||
|
||||
if (s->fd != -1) {
|
||||
@@ -3594,9 +3593,7 @@ static void kvm_set_dirty_ring_size(Object *obj, Visitor *v,
|
||||
return;
|
||||
}
|
||||
|
||||
visit_type_uint32(v, name, &value, &error);
|
||||
if (error) {
|
||||
error_propagate(errp, error);
|
||||
if (!visit_type_uint32(v, name, &value, errp)) {
|
||||
return;
|
||||
}
|
||||
if (value & (value - 1)) {
|
||||
|
||||
+1
-3
@@ -297,9 +297,7 @@ static int read_config(BDRVBlkdebugState *s, const char *filename,
|
||||
}
|
||||
}
|
||||
|
||||
qemu_config_parse_qdict(options, config_groups, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!qemu_config_parse_qdict(options, config_groups, errp)) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -522,7 +522,6 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *source,
|
||||
BlockCopyState **bcs,
|
||||
Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
BDRVCopyBeforeWriteState *state;
|
||||
BlockDriverState *top;
|
||||
QDict *opts;
|
||||
|
||||
+11
-17
@@ -2821,7 +2821,6 @@ static BlockBackend *vmdk_co_create_cb(int64_t size, int idx,
|
||||
static int coroutine_fn vmdk_co_create(BlockdevCreateOptions *create_options,
|
||||
Error **errp)
|
||||
{
|
||||
int ret;
|
||||
BlockdevCreateOptionsVmdk *opts;
|
||||
|
||||
opts = &create_options->u.vmdk;
|
||||
@@ -2829,24 +2828,19 @@ static int coroutine_fn vmdk_co_create(BlockdevCreateOptions *create_options,
|
||||
/* Validate options */
|
||||
if (!QEMU_IS_ALIGNED(opts->size, BDRV_SECTOR_SIZE)) {
|
||||
error_setg(errp, "Image size must be a multiple of 512 bytes");
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = vmdk_co_do_create(opts->size,
|
||||
opts->subformat,
|
||||
opts->adapter_type,
|
||||
opts->backing_file,
|
||||
opts->hwversion,
|
||||
opts->toolsversion,
|
||||
false,
|
||||
opts->zeroed_grain,
|
||||
vmdk_co_create_cb,
|
||||
opts, errp);
|
||||
return ret;
|
||||
|
||||
out:
|
||||
return ret;
|
||||
return vmdk_co_do_create(opts->size,
|
||||
opts->subformat,
|
||||
opts->adapter_type,
|
||||
opts->backing_file,
|
||||
opts->hwversion,
|
||||
opts->toolsversion,
|
||||
false,
|
||||
opts->zeroed_grain,
|
||||
vmdk_co_create_cb,
|
||||
opts, errp);
|
||||
}
|
||||
|
||||
static void vmdk_close(BlockDriverState *bs)
|
||||
|
||||
+1
-1
@@ -156,7 +156,7 @@ static abi_ulong copy_elf_strings(int argc, char **argv, void **page,
|
||||
--p; --tmp; --len;
|
||||
if (--offset < 0) {
|
||||
offset = p % TARGET_PAGE_SIZE;
|
||||
pag = (char *)page[p / TARGET_PAGE_SIZE];
|
||||
pag = page[p / TARGET_PAGE_SIZE];
|
||||
if (!pag) {
|
||||
pag = g_try_malloc0(TARGET_PAGE_SIZE);
|
||||
page[p / TARGET_PAGE_SIZE] = pag;
|
||||
|
||||
@@ -405,7 +405,7 @@ static void vcpu_mem_access(unsigned int vcpu_index, qemu_plugin_meminfo_t info,
|
||||
g_mutex_lock(&l1_dcache_locks[cache_idx]);
|
||||
hit_in_l1 = access_cache(l1_dcaches[cache_idx], effective_addr);
|
||||
if (!hit_in_l1) {
|
||||
insn = (InsnData *) userdata;
|
||||
insn = userdata;
|
||||
__atomic_fetch_add(&insn->l1_dmisses, 1, __ATOMIC_SEQ_CST);
|
||||
l1_dcaches[cache_idx]->misses++;
|
||||
}
|
||||
@@ -419,7 +419,7 @@ static void vcpu_mem_access(unsigned int vcpu_index, qemu_plugin_meminfo_t info,
|
||||
|
||||
g_mutex_lock(&l2_ucache_locks[cache_idx]);
|
||||
if (!access_cache(l2_ucaches[cache_idx], effective_addr)) {
|
||||
insn = (InsnData *) userdata;
|
||||
insn = userdata;
|
||||
__atomic_fetch_add(&insn->l2_misses, 1, __ATOMIC_SEQ_CST);
|
||||
l2_ucaches[cache_idx]->misses++;
|
||||
}
|
||||
@@ -440,7 +440,7 @@ static void vcpu_insn_exec(unsigned int vcpu_index, void *userdata)
|
||||
g_mutex_lock(&l1_icache_locks[cache_idx]);
|
||||
hit_in_l1 = access_cache(l1_icaches[cache_idx], insn_addr);
|
||||
if (!hit_in_l1) {
|
||||
insn = (InsnData *) userdata;
|
||||
insn = userdata;
|
||||
__atomic_fetch_add(&insn->l1_imisses, 1, __ATOMIC_SEQ_CST);
|
||||
l1_icaches[cache_idx]->misses++;
|
||||
}
|
||||
@@ -454,7 +454,7 @@ static void vcpu_insn_exec(unsigned int vcpu_index, void *userdata)
|
||||
|
||||
g_mutex_lock(&l2_ucache_locks[cache_idx]);
|
||||
if (!access_cache(l2_ucaches[cache_idx], insn_addr)) {
|
||||
insn = (InsnData *) userdata;
|
||||
insn = userdata;
|
||||
__atomic_fetch_add(&insn->l2_misses, 1, __ATOMIC_SEQ_CST);
|
||||
l2_ucaches[cache_idx]->misses++;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ vub_discard_write_zeroes(VubReq *req, struct iovec *iov, uint32_t iovcnt,
|
||||
|
||||
#if defined(__linux__) && defined(BLKDISCARD) && defined(BLKZEROOUT)
|
||||
VubDev *vdev_blk = req->vdev_blk;
|
||||
desc = (struct virtio_blk_discard_write_zeroes *)buf;
|
||||
desc = buf;
|
||||
uint64_t range[2] = { le64toh(desc->sector) << 9,
|
||||
le32toh(desc->num_sectors) << 9 };
|
||||
if (type == VIRTIO_BLK_T_DISCARD) {
|
||||
|
||||
@@ -357,7 +357,6 @@ static void write_elf32_notes(WriteCoreDumpFunction f, DumpState *s,
|
||||
|
||||
static void write_elf_phdr_note(DumpState *s, Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
Elf32_Phdr phdr32;
|
||||
Elf64_Phdr phdr64;
|
||||
void *phdr;
|
||||
@@ -773,7 +772,6 @@ static void dump_iterate(DumpState *s, Error **errp)
|
||||
static void dump_end(DumpState *s, Error **errp)
|
||||
{
|
||||
int rc;
|
||||
ERRP_GUARD();
|
||||
|
||||
if (s->elf_section_data_size) {
|
||||
s->elf_section_data = g_malloc0(s->elf_section_data_size);
|
||||
|
||||
+4
-10
@@ -72,7 +72,6 @@ static V9fsSynthNode *v9fs_add_dir_node(V9fsSynthNode *parent, int mode,
|
||||
int qemu_v9fs_synth_mkdir(V9fsSynthNode *parent, int mode,
|
||||
const char *name, V9fsSynthNode **result)
|
||||
{
|
||||
int ret;
|
||||
V9fsSynthNode *node, *tmp;
|
||||
|
||||
if (!synth_fs) {
|
||||
@@ -87,8 +86,7 @@ int qemu_v9fs_synth_mkdir(V9fsSynthNode *parent, int mode,
|
||||
QEMU_LOCK_GUARD(&synth_mutex);
|
||||
QLIST_FOREACH(tmp, &parent->child, sibling) {
|
||||
if (!strcmp(tmp->name, name)) {
|
||||
ret = EEXIST;
|
||||
return ret;
|
||||
return EEXIST;
|
||||
}
|
||||
}
|
||||
/* Add the name */
|
||||
@@ -98,15 +96,13 @@ int qemu_v9fs_synth_mkdir(V9fsSynthNode *parent, int mode,
|
||||
v9fs_add_dir_node(node, node->attr->mode, ".",
|
||||
node->attr, node->attr->inode);
|
||||
*result = node;
|
||||
ret = 0;
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int qemu_v9fs_synth_add_file(V9fsSynthNode *parent, int mode,
|
||||
const char *name, v9fs_synth_read read,
|
||||
v9fs_synth_write write, void *arg)
|
||||
{
|
||||
int ret;
|
||||
V9fsSynthNode *node, *tmp;
|
||||
|
||||
if (!synth_fs) {
|
||||
@@ -122,8 +118,7 @@ int qemu_v9fs_synth_add_file(V9fsSynthNode *parent, int mode,
|
||||
QEMU_LOCK_GUARD(&synth_mutex);
|
||||
QLIST_FOREACH(tmp, &parent->child, sibling) {
|
||||
if (!strcmp(tmp->name, name)) {
|
||||
ret = EEXIST;
|
||||
return ret;
|
||||
return EEXIST;
|
||||
}
|
||||
}
|
||||
/* Add file type and remove write bits */
|
||||
@@ -138,8 +133,7 @@ int qemu_v9fs_synth_add_file(V9fsSynthNode *parent, int mode,
|
||||
node->private = arg;
|
||||
pstrcpy(node->name, sizeof(node->name), name);
|
||||
QLIST_INSERT_HEAD_RCU(&parent->child, node, sibling);
|
||||
ret = 0;
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void synth_fill_statbuf(V9fsSynthNode *node, struct stat *stbuf)
|
||||
|
||||
+1
-2
@@ -900,6 +900,7 @@ static qemu_irq armsse_get_common_irq_in(ARMSSE *s, int irqno)
|
||||
|
||||
static void armsse_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
ARMSSE *s = ARM_SSE(dev);
|
||||
ARMSSEClass *asc = ARM_SSE_GET_CLASS(dev);
|
||||
const ARMSSEInfo *info = asc->info;
|
||||
@@ -914,8 +915,6 @@ static void armsse_realize(DeviceState *dev, Error **errp)
|
||||
DeviceState *dev_splitter;
|
||||
uint32_t addr_width_max;
|
||||
|
||||
ERRP_GUARD();
|
||||
|
||||
if (!s->board_memory) {
|
||||
error_setg(errp, "memory property was not set");
|
||||
return;
|
||||
|
||||
+5
-9
@@ -2771,24 +2771,20 @@ static void virt_dimm_unplug_request(HotplugHandler *hotplug_dev,
|
||||
DeviceState *dev, Error **errp)
|
||||
{
|
||||
VirtMachineState *vms = VIRT_MACHINE(hotplug_dev);
|
||||
Error *local_err = NULL;
|
||||
|
||||
if (!vms->acpi_dev) {
|
||||
error_setg(&local_err,
|
||||
error_setg(errp,
|
||||
"memory hotplug is not enabled: missing acpi-ged device");
|
||||
goto out;
|
||||
return;
|
||||
}
|
||||
|
||||
if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) {
|
||||
error_setg(&local_err,
|
||||
"nvdimm device hot unplug is not supported yet.");
|
||||
goto out;
|
||||
error_setg(errp, "nvdimm device hot unplug is not supported yet.");
|
||||
return;
|
||||
}
|
||||
|
||||
hotplug_handler_unplug_request(HOTPLUG_HANDLER(vms->acpi_dev), dev,
|
||||
&local_err);
|
||||
out:
|
||||
error_propagate(errp, local_err);
|
||||
errp);
|
||||
}
|
||||
|
||||
static void virt_dimm_unplug(HotplugHandler *hotplug_dev,
|
||||
|
||||
@@ -274,7 +274,6 @@ SiFiveUARTState *sifive_uart_create(MemoryRegion *address_space, hwaddr base,
|
||||
{
|
||||
DeviceState *dev;
|
||||
SysBusDevice *s;
|
||||
SiFiveUARTState *r;
|
||||
|
||||
dev = qdev_new("riscv.sifive.uart");
|
||||
s = SYS_BUS_DEVICE(dev);
|
||||
@@ -284,6 +283,5 @@ SiFiveUARTState *sifive_uart_create(MemoryRegion *address_space, hwaddr base,
|
||||
sysbus_mmio_get_region(s, 0));
|
||||
sysbus_connect_irq(s, 0, irq);
|
||||
|
||||
r = SIFIVE_UART(dev);
|
||||
return r;
|
||||
return SIFIVE_UART(dev);
|
||||
}
|
||||
|
||||
+1
-2
@@ -554,12 +554,11 @@ static void machine_get_mem(Object *obj, Visitor *v, const char *name,
|
||||
static void machine_set_mem(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
MachineState *ms = MACHINE(obj);
|
||||
MachineClass *mc = MACHINE_GET_CLASS(obj);
|
||||
MemorySizeConfiguration *mem;
|
||||
|
||||
ERRP_GUARD();
|
||||
|
||||
if (!visit_type_MemorySizeConfiguration(v, name, &mem, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ void qdev_init_clocks(DeviceState *dev, const ClockPortInitArray clocks)
|
||||
Clock **clkp;
|
||||
/* offset cannot be inside the DeviceState part */
|
||||
assert(elem->offset > sizeof(DeviceState));
|
||||
clkp = (Clock **)(((void *) dev) + elem->offset);
|
||||
clkp = ((void *)dev) + elem->offset;
|
||||
if (elem->is_output) {
|
||||
*clkp = qdev_init_clock_out(dev, elem->name);
|
||||
} else {
|
||||
|
||||
@@ -679,14 +679,11 @@ static void set_reserved_region(Object *obj, Visitor *v, const char *name,
|
||||
{
|
||||
Property *prop = opaque;
|
||||
ReservedRegion *rr = object_field_prop_ptr(obj, prop);
|
||||
Error *local_err = NULL;
|
||||
const char *endptr;
|
||||
char *str;
|
||||
int ret;
|
||||
|
||||
visit_type_str(v, name, &str, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!visit_type_str(v, name, &str, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -493,8 +493,6 @@ void qdev_del_unplug_blocker(DeviceState *dev, Error *reason)
|
||||
|
||||
bool qdev_unplug_blocked(DeviceState *dev, Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
|
||||
if (dev->unplug_blockers) {
|
||||
error_propagate(errp, error_copy(dev->unplug_blockers->data));
|
||||
return true;
|
||||
|
||||
+4
-6
@@ -2104,7 +2104,7 @@ static void process_message(VMBus *vmbus)
|
||||
goto out;
|
||||
}
|
||||
msgdata = hv_msg->payload;
|
||||
msg = (struct vmbus_message_header *)msgdata;
|
||||
msg = msgdata;
|
||||
|
||||
trace_vmbus_process_incoming_message(msg->message_type);
|
||||
|
||||
@@ -2404,7 +2404,6 @@ static const TypeInfo vmbus_dev_type_info = {
|
||||
static void vmbus_realize(BusState *bus, Error **errp)
|
||||
{
|
||||
int ret = 0;
|
||||
Error *local_err = NULL;
|
||||
VMBus *vmbus = VMBUS(bus);
|
||||
|
||||
qemu_mutex_init(&vmbus->rx_queue_lock);
|
||||
@@ -2415,13 +2414,13 @@ static void vmbus_realize(BusState *bus, Error **errp)
|
||||
ret = hyperv_set_msg_handler(VMBUS_MESSAGE_CONNECTION_ID,
|
||||
vmbus_recv_message, vmbus);
|
||||
if (ret != 0) {
|
||||
error_setg(&local_err, "hyperv set message handler failed: %d", ret);
|
||||
error_setg(errp, "hyperv set message handler failed: %d", ret);
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
ret = event_notifier_init(&vmbus->notifier, 0);
|
||||
if (ret != 0) {
|
||||
error_setg(&local_err, "event notifier failed to init with %d", ret);
|
||||
error_setg(errp, "event notifier failed to init with %d", ret);
|
||||
goto remove_msg_handler;
|
||||
}
|
||||
|
||||
@@ -2429,7 +2428,7 @@ static void vmbus_realize(BusState *bus, Error **errp)
|
||||
ret = hyperv_set_event_flag_handler(VMBUS_EVENT_CONNECTION_ID,
|
||||
&vmbus->notifier);
|
||||
if (ret != 0) {
|
||||
error_setg(&local_err, "hyperv set event handler failed with %d", ret);
|
||||
error_setg(errp, "hyperv set event handler failed with %d", ret);
|
||||
goto clear_event_notifier;
|
||||
}
|
||||
|
||||
@@ -2441,7 +2440,6 @@ remove_msg_handler:
|
||||
hyperv_set_msg_handler(VMBUS_MESSAGE_CONNECTION_ID, NULL, NULL);
|
||||
error_out:
|
||||
qemu_mutex_destroy(&vmbus->rx_queue_lock);
|
||||
error_propagate(errp, local_err);
|
||||
}
|
||||
|
||||
static void vmbus_unrealize(BusState *bus)
|
||||
|
||||
+1
-4
@@ -1782,12 +1782,9 @@ static void pc_machine_set_max_fw_size(Object *obj, Visitor *v,
|
||||
Error **errp)
|
||||
{
|
||||
PCMachineState *pcms = PC_MACHINE(obj);
|
||||
Error *error = NULL;
|
||||
uint64_t value;
|
||||
|
||||
visit_type_size(v, name, &value, &error);
|
||||
if (error) {
|
||||
error_propagate(errp, error);
|
||||
if (!visit_type_size(v, name, &value, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1429,7 +1429,7 @@ static uint64_t gem_read(void *opaque, hwaddr offset, unsigned size)
|
||||
{
|
||||
CadenceGEMState *s;
|
||||
uint32_t retval;
|
||||
s = (CadenceGEMState *)opaque;
|
||||
s = opaque;
|
||||
|
||||
offset >>= 2;
|
||||
retval = s->regs[offset];
|
||||
|
||||
+1
-1
@@ -2471,7 +2471,7 @@ static size_t virtio_net_rsc_receive6(void *opq, NetClientState *nc,
|
||||
VirtioNetRscChain *chain;
|
||||
VirtioNetRscUnit unit;
|
||||
|
||||
chain = (VirtioNetRscChain *)opq;
|
||||
chain = opq;
|
||||
hdr_len = ((VirtIONet *)(chain->n))->guest_hdr_len;
|
||||
|
||||
if (size < (hdr_len + sizeof(struct eth_header) + sizeof(struct ip6_header)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user