aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2022-12-15 10:13:46 +0000
committerPeter Maydell <peter.maydell@linaro.org>2022-12-15 10:13:46 +0000
commit48804eebd4a327e4b11f902ba80a00876ee53a43 (patch)
tree67987d8d9d35b3019a3f98805df654bec7f5af8d /hw/virtio
parentae2b87341b5ddb0dcb1b3f2d4f586ef18de75873 (diff)
parent6c5aaee4b61eb8bf60c7c30365432710b4346421 (diff)
downloadqemu-48804eebd4a327e4b11f902ba80a00876ee53a43.zip
qemu-48804eebd4a327e4b11f902ba80a00876ee53a43.tar.gz
qemu-48804eebd4a327e4b11f902ba80a00876ee53a43.tar.bz2
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>
Diffstat (limited to 'hw/virtio')
-rw-r--r--hw/virtio/vhost-user.c6
-rw-r--r--hw/virtio/vhost-vdpa.c2
-rw-r--r--hw/virtio/virtio-balloon.c20
-rw-r--r--hw/virtio/virtio-iommu.c3
-rw-r--r--hw/virtio/virtio-mem.c10
5 files changed, 14 insertions, 27 deletions
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 8f63584..b8aaa99 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -2533,11 +2533,7 @@ vhost_user_crypto_close_session(struct vhost_dev *dev, uint64_t session_id)
static bool vhost_user_mem_section_filter(struct vhost_dev *dev,
MemoryRegionSection *section)
{
- bool result;
-
- result = memory_region_get_fd(section->mr) >= 0;
-
- return result;
+ return memory_region_get_fd(section->mr) >= 0;
}
static int vhost_user_get_inflight_fd(struct vhost_dev *dev,
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 7468e44..bc1c79b 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -963,6 +963,7 @@ static bool vhost_vdpa_svq_map_rings(struct vhost_dev *dev,
struct vhost_vring_addr *addr,
Error **errp)
{
+ ERRP_GUARD();
DMAMap device_region, driver_region;
struct vhost_vring_addr svq_addr;
struct vhost_vdpa *v = dev->opaque;
@@ -971,7 +972,6 @@ static bool vhost_vdpa_svq_map_rings(struct vhost_dev *dev,
size_t avail_offset;
bool ok;
- ERRP_GUARD();
vhost_svq_get_vring_addr(svq, &svq_addr);
driver_region = (DMAMap) {
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 73ac5eb..746f07c 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -241,36 +241,34 @@ static void balloon_stats_poll_cb(void *opaque)
static void balloon_stats_get_all(Object *obj, Visitor *v, const char *name,
void *opaque, Error **errp)
{
- Error *err = NULL;
VirtIOBalloon *s = VIRTIO_BALLOON(obj);
+ bool ok = false;
int i;
- if (!visit_start_struct(v, name, NULL, 0, &err)) {
- goto out;
+ if (!visit_start_struct(v, name, NULL, 0, errp)) {
+ return;
}
- if (!visit_type_int(v, "last-update", &s->stats_last_update, &err)) {
+ if (!visit_type_int(v, "last-update", &s->stats_last_update, errp)) {
goto out_end;
}
- if (!visit_start_struct(v, "stats", NULL, 0, &err)) {
+ if (!visit_start_struct(v, "stats", NULL, 0, errp)) {
goto out_end;
}
for (i = 0; i < VIRTIO_BALLOON_S_NR; i++) {
- if (!visit_type_uint64(v, balloon_stat_names[i], &s->stats[i], &err)) {
+ if (!visit_type_uint64(v, balloon_stat_names[i], &s->stats[i], errp)) {
goto out_nested;
}
}
- visit_check_struct(v, &err);
+ ok = visit_check_struct(v, errp);
out_nested:
visit_end_struct(v, NULL);
- if (!err) {
- visit_check_struct(v, &err);
+ if (ok) {
+ visit_check_struct(v, errp);
}
out_end:
visit_end_struct(v, NULL);
-out:
- error_propagate(errp, err);
}
static void balloon_stats_get_poll_interval(Object *obj, Visitor *v,
diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c
index 62e07ec..23c4709 100644
--- a/hw/virtio/virtio-iommu.c
+++ b/hw/virtio/virtio-iommu.c
@@ -775,8 +775,7 @@ static void virtio_iommu_handle_command(VirtIODevice *vdev, VirtQueue *vq)
output_size = s->config.probe_size + sizeof(tail);
buf = g_malloc0(output_size);
- ptail = (struct virtio_iommu_req_tail *)
- (buf + s->config.probe_size);
+ ptail = buf + s->config.probe_size;
ptail->status = virtio_iommu_handle_probe(s, iov, iov_cnt, buf);
break;
}
diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index ed170de..d96bde1 100644
--- a/hw/virtio/virtio-mem.c
+++ b/hw/virtio/virtio-mem.c
@@ -1094,12 +1094,9 @@ static void virtio_mem_set_requested_size(Object *obj, Visitor *v,
Error **errp)
{
VirtIOMEM *vmem = VIRTIO_MEM(obj);
- Error *err = NULL;
uint64_t value;
- visit_type_size(v, name, &value, &err);
- if (err) {
- error_propagate(errp, err);
+ if (!visit_type_size(v, name, &value, errp)) {
return;
}
@@ -1159,7 +1156,6 @@ static void virtio_mem_set_block_size(Object *obj, Visitor *v, const char *name,
void *opaque, Error **errp)
{
VirtIOMEM *vmem = VIRTIO_MEM(obj);
- Error *err = NULL;
uint64_t value;
if (DEVICE(obj)->realized) {
@@ -1167,9 +1163,7 @@ static void virtio_mem_set_block_size(Object *obj, Visitor *v, const char *name,
return;
}
- visit_type_size(v, name, &value, &err);
- if (err) {
- error_propagate(errp, err);
+ if (!visit_type_size(v, name, &value, errp)) {
return;
}