qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 5c7eed: hw/cxl/cxl-host: Fix missing ERRP_GUA


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 5c7eed: hw/cxl/cxl-host: Fix missing ERRP_GUARD() in cxl_f...
Date: Tue, 12 Mar 2024 14:31:50 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 5c7eedf53d4487445ae8fb3498c75299b2ea59c1
      
https://github.com/qemu/qemu/commit/5c7eedf53d4487445ae8fb3498c75299b2ea59c1
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/cxl/cxl-host.c

  Log Message:
  -----------
  hw/cxl/cxl-host: Fix missing ERRP_GUARD() in cxl_fixed_memory_window_config()

As the comment in qapi/error, dereferencing @errp requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
* - It must not be dereferenced, because it may be null.
...
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.
*
* Using it when it's not needed is safe, but please avoid cluttering
* the source with useless code.

But in cxl_fixed_memory_window_config(), @errp is dereferenced in 2
places without ERRP_GUARD():

fw->enc_int_ways = cxl_interleave_ways_enc(fw->num_targets, errp);
if (*errp) {
    return;
}

and

fw->enc_int_gran =
    cxl_interleave_granularity_enc(object->interleave_granularity,
                                   errp);
if (*errp) {
    return;
}

For the above 2 places, we check "*errp", because neither function
returns a suitable error code. And since machine_set_cfmw() - the caller
of cxl_fixed_memory_window_config() - doesn't get the NULL @errp
parameter as the "set" method of object property,
cxl_fixed_memory_window_config() hasn't triggered the bug that
dereferencing the NULL @errp.

To follow the requirement of @errp, add missing ERRP_GUARD() in
cxl_fixed_memory_window_config().

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240223085653.1255438-2-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: d470fd6acd60630867bd09bd415005f4fe714996
      
https://github.com/qemu/qemu/commit/d470fd6acd60630867bd09bd415005f4fe714996
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/display/macfb.c

  Log Message:
  -----------
  hw/display/macfb: Fix missing ERRP_GUARD() in macfb_nubus_realize()

As the comment in qapi/error, dereferencing @errp requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
* - It must not be dereferenced, because it may be null.
...
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.
*
* Using it when it's not needed is safe, but please avoid cluttering
* the source with useless code.

But in macfb_nubus_realize(), @errp is dereferenced without
ERRP_GUARD():

ndc->parent_realize(dev, errp);
if (*errp) {
    return;
}

Here we check *errp, because the ndc->parent_realize(), as a
DeviceClass.realize() callback, returns void. And since
macfb_nubus_realize(), also as a DeviceClass.realize(), doesn't get the
NULL @errp parameter, it hasn't triggered the bug that dereferencing the
NULL @errp.

To follow the requirement of @errp, add missing ERRP_GUARD() in
macfb_nubus_realize().

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240223085653.1255438-3-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 294cbbf1753e95ac9d19a5a46102b79717312c61
      
https://github.com/qemu/qemu/commit/294cbbf1753e95ac9d19a5a46102b79717312c61
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/mem/cxl_type3.c

  Log Message:
  -----------
  hw/mem/cxl_type3: Fix missing ERRP_GUARD() in ct3_realize()

As the comment in qapi/error, dereferencing @errp requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
* - It must not be dereferenced, because it may be null.
...
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.
*
* Using it when it's not needed is safe, but please avoid cluttering
* the source with useless code.

But in ct3_realize(), @errp is dereferenced without ERRP_GUARD():

cxl_doe_cdat_init(cxl_cstate, errp);
if (*errp) {
    goto err_free_special_ops;
}

Here we check *errp, because cxl_doe_cdat_init() returns void. And
ct3_realize() - as a PCIDeviceClass.realize() method - doesn't get the
NULL @errp parameter, it hasn't triggered the bug that dereferencing
the NULL @errp.

To follow the requirement of @errp, add missing ERRP_GUARD() in
ct3_realize().

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240223085653.1255438-4-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 1e0efa9735635bf1eef18f7e4d41f8a9e720e574
      
https://github.com/qemu/qemu/commit/1e0efa9735635bf1eef18f7e4d41f8a9e720e574
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/misc/xlnx-versal-trng.c

  Log Message:
  -----------
  hw/misc/xlnx-versal-trng: Check returned bool in trng_prop_fault_event_set()

As the comment in qapi/error, dereferencing @errp requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
* - It must not be dereferenced, because it may be null.
...
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.
*
* Using it when it's not needed is safe, but please avoid cluttering
* the source with useless code.

But in trng_prop_fault_event_set, @errp is dereferenced without
ERRP_GUARD():

visit_type_uint32(v, name, events, errp);
if (*errp) {
    return;
}

Currently, since trng_prop_fault_event_set() doesn't get the NULL @errp
parameter as a "set" method of object property, it hasn't triggered the
bug that dereferencing the NULL @errp.

And since visit_type_uint32() returns bool, check the returned bool
directly instead of dereferencing @errp, then we needn't the add missing
ERRP_GUARD().

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240223085653.1255438-5-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 8cb84d7d6bd1f3aa66663553c6b4de3855cea4d9
      
https://github.com/qemu/qemu/commit/8cb84d7d6bd1f3aa66663553c6b4de3855cea4d9
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/pci-bridge/cxl_upstream.c

  Log Message:
  -----------
  hw/pci-bridge/cxl_upstream: Fix missing ERRP_GUARD() in cxl_usp_realize()

As the comment in qapi/error, dereferencing @errp requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
* - It must not be dereferenced, because it may be null.
...
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.
*
* Using it when it's not needed is safe, but please avoid cluttering
* the source with useless code.

But in cxl_usp_realize(), @errp is dereferenced without ERRP_GUARD():

cxl_doe_cdat_init(cxl_cstate, errp);
if (*errp) {
    goto err_cap;
}

Here we check *errp, because cxl_doe_cdat_init() returns void. And since
cxl_usp_realize() - as a PCIDeviceClass.realize() method - doesn't get
the NULL @errp parameter, it hasn't triggered the bug that dereferencing
the NULL @errp.

To follow the requirement of @errp, add missing ERRP_GUARD() in
cxl_usp_realize().

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20240223085653.1255438-6-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 4a9fafb478b5d9e6977d0c422f25062550ebce3a
      
https://github.com/qemu/qemu/commit/4a9fafb478b5d9e6977d0c422f25062550ebce3a
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/intc/ioapic_common.c

  Log Message:
  -----------
  hw/intc: Check @errp to handle the error of IOAPICCommonClass.realize()

IOAPICCommonClass implements its own private realize(), and this private
realize() allows error.

Since IOAPICCommonClass.realize() returns void, to check the error,
dereference @errp with ERRP_GUARD().

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240223085653.1255438-8-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 042e4942b926eb067cbc040d7c7fa87a7ebc0917
      
https://github.com/qemu/qemu/commit/042e4942b926eb067cbc040d7c7fa87a7ebc0917
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M include/qapi/error.h

  Log Message:
  -----------
  error: Add error_vprepend() in comment of ERRP_GUARD() rules

The error_vprepend() should use ERRP_GUARD() just as the documentation
of ERRP_GUARD() says:

> It must be used when the function dereferences @errp or passes
> @errp to error_prepend(), error_vprepend(), or error_append_hint().

Considering that error_vprepend() is also an API provided in error.h,
it is necessary to add it to the description of the rules for using
ERRP_GUARD().

Cc: Markus Armbruster <armbru@redhat.com>
Cc: Michael Roth <michael.roth@amd.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240311033822.3142585-2-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: c1cccad865ddf122c9daf5a3485487c0dcc53a15
      
https://github.com/qemu/qemu/commit/c1cccad865ddf122c9daf5a3485487c0dcc53a15
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M backends/iommufd.c

  Log Message:
  -----------
  backends/iommufd: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The iommufd_backend_set_fd() passes @errp to error_prepend(), to avoid
the above issue, add missing ERRP_GUARD() at the beginning of this
function.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Yi Liu <yi.l.liu@intel.com>
Cc: Eric Auger <eric.auger@redhat.com>
Cc: Zhenzhong Duan <zhenzhong.duan@intel.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-ID: <20240311033822.3142585-3-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 7b22e05582037c5f88b38039a99e48ddf2150cbd
      
https://github.com/qemu/qemu/commit/7b22e05582037c5f88b38039a99e48ddf2150cbd
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

In block.c, there are 4 functions passing @errp to error_prepend()
without ERRP_GUARD():
 - bdrv_co_create_opts_simple()
 - parse_json_filename()
 - bdrv_open_backing_file()
 - bdrv_append_temp_snapshot()

bdrv_co_create_opts_simple(), is an implementation of
BlockDriver.bdrv_co_create_opts(). There are too many possible callers
to check the impact of this defect; it may or may not be harmless. Thus
it is necessary to protect @errp with ERRP_GUARD().

Though the @errp parameters passed to parse_json_filename(),
bdrv_open_backing_file() and bdrv_append_temp_snapshot() points to their
callers' local_err, to follow the requirement of @errp, also add missing
ERRP_GUARD() at their beginning.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20240311033822.3142585-4-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: c79eabc5e539fc83546e757256afe81bd9a5bc5e
      
https://github.com/qemu/qemu/commit/c79eabc5e539fc83546e757256afe81bd9a5bc5e
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M block/copy-before-write.c

  Log Message:
  -----------
  block/copy-before-write: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The cbw_open() passes @errp to error_prepend() without ERRP_GUARD().

Though it is the BlockDriver.bdrv_open() method, and currently its
@errp parameter only points to callers' local_err, to follow the
requirement of @errp, add missing ERRP_GUARD() at the beginning of this
function.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: John Snow <jsnow@redhat.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-ID: <20240311033822.3142585-5-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: c835ca0027d6aaebce95886fc2be2579478c7b71
      
https://github.com/qemu/qemu/commit/c835ca0027d6aaebce95886fc2be2579478c7b71
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M block/nbd.c

  Log Message:
  -----------
  block/nbd: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The nbd_co_do_receive_one_chunk() passes @errp to error_prepend()
without ERRP_GUARD(), and though its @errp parameter points to its
caller's local_err, to follow the requirement of @errp, add missing
ERRP_GUARD() at the beginning of this function.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Eric Blake <eblake@redhat.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-ID: <20240311033822.3142585-6-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: ed46217d5d6c36233105860c0059de2f0398ed4f
      
https://github.com/qemu/qemu/commit/ed46217d5d6c36233105860c0059de2f0398ed4f
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

In nvme.c, there are 3 functions passing @errp to error_prepend()
without ERRP_GUARD():
- nvme_init_queue()
- nvme_create_queue_pair()
- nvme_identify()

All these 3 functions take their @errp parameters from the
nvme_file_open(), which is a BlockDriver.bdrv_nvme() method and its
@errp points to its caller's local_err.

Though these 3 cases haven't trigger the issue like [1] said, to
follow the requirement of @errp, add missing ERRP_GUARD() at their
beginning.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Fam Zheng <fam@euphon.net>
Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240311033822.3142585-7-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: e1081e3bffe0449e714c87ad1f82baf291b0a287
      
https://github.com/qemu/qemu/commit/e1081e3bffe0449e714c87ad1f82baf291b0a287
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M block/qcow2-bitmap.c

  Log Message:
  -----------
  block/qcow2-bitmap: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The qcow2_co_can_store_new_dirty_bitmap() passes @errp to
error_prepend(). As a BlockDriver.bdrv_co_can_store_new_dirty_bitmap
method, it's called by bdrv_co_can_store_new_dirty_bitmap().

Its caller is not being called anywhere, but as the API in
include/block/block-io.h, we can't ensure what kind of @errp future
users will pass in.

To avoid potential issues as [1] said, add missing ERRP_GUARD() at the
beginning of qcow2_co_can_store_new_dirty_bitmap().

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: John Snow <jsnow@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-ID: <20240311033822.3142585-8-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: d13e3b46700a58da5ea2a098003cd2ddaf0a3f76
      
https://github.com/qemu/qemu/commit/d13e3b46700a58da5ea2a098003cd2ddaf0a3f76
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  block/qcow2: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

In block/qcow2.c, there are 2 functions passing @errp to error_prepend()
without ERRP_GUARD():
 - qcow2_co_create()
 - qcow2_co_truncate()

There are too many possible callers to check the impact of the defect;
it may or may not be harmless. Thus it is necessary to protect @errp with
ERRP_GUARD().

Therefore, to avoid the issue like [1] said, add missing ERRP_GUARD() at
their beginning.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20240311033822.3142585-9-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: c66eec9094c9ead954ca0e65c8970f79ecd9107a
      
https://github.com/qemu/qemu/commit/c66eec9094c9ead954ca0e65c8970f79ecd9107a
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M block/qed.c

  Log Message:
  -----------
  block/qed: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The bdrv_qed_co_invalidate_cache() passes @errp to error_prepend()
without ERRP_GUARD().

Though it is a BlockDriver.bdrv_co_invalidate_cache() method, and
currently its @errp parameter only points to callers' local_err, to
follow the requirement of @errp, add missing ERRP_GUARD() at the
beginning of this function.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240311033822.3142585-10-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: ce33d85d45942647d6afdaf2875a097b6113fccd
      
https://github.com/qemu/qemu/commit/ce33d85d45942647d6afdaf2875a097b6113fccd
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M block/snapshot.c

  Log Message:
  -----------
  block/snapshot: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

In block/snapshot.c, there are 2 functions passing @errp to
error_prepend() without ERRP_GUARD():
 - bdrv_all_delete_snapshot()
 - bdrv_all_goto_snapshot()

As the APIs exposed in include/block/snapshot.h, they could be called
by other modules.

To avoid potential issues as [1] said, add missing ERRP_GUARD() at the
beginning of these 2 functions.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Message-ID: <20240311033822.3142585-11-zhao1.liu@linux.intel.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: f5ec96c92ed851fb4d907aea3a1cbf480d351cb7
      
https://github.com/qemu/qemu/commit/f5ec96c92ed851fb4d907aea3a1cbf480d351cb7
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M block/vdi.c

  Log Message:
  -----------
  block/vdi: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The vdi_co_do_create() passes @errp to error_prepend() without
ERRP_GUARD(), and its @errp parameter is so widely sourced that it is
necessary to protect it with ERRP_GUARD().

To avoid the potential issues as [1] said, add missing ERRP_GUARD() at
the beginning of this function.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Stefan Weil <sw@weilnetz.de>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Message-ID: <20240311033822.3142585-12-zhao1.liu@linux.intel.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 76db0ea3bf40cfe5ae1cae3cea05ac9cacbf7c26
      
https://github.com/qemu/qemu/commit/76db0ea3bf40cfe5ae1cae3cea05ac9cacbf7c26
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  block/vmdk: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The vmdk_parse_extents() passes @errp to error_prepend(), and its @errp
is from vmdk_open().

Though, vmdk_open(), as a BlockDriver.bdrv_open(), gets the @errp
parameter which is pointer of its caller's local_err, to follow the
requirement of @errp, add missing ERRP_GUARD() at the beginning of this
function.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Fam Zheng <fam@euphon.net>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Message-ID: <20240311033822.3142585-13-zhao1.liu@linux.intel.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 0ea5f594feca3a4240697685d25d6cb0d1e6fea0
      
https://github.com/qemu/qemu/commit/0ea5f594feca3a4240697685d25d6cb0d1e6fea0
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/block/virtio-blk.c

  Log Message:
  -----------
  block/virtio-blk: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The virtio_blk_vq_aio_context_init() passes @errp to error_prepend().

Though its @errp points its caller's local @err variable, to follow the
requirement of @errp, add missing ERRP_GUARD() at the beginning of
virtio_blk_vq_aio_context_init().

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: "Michael S. Tsirkin" <mst@redhat.com>
Message-ID: <20240311033822.3142585-14-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: d765ab2ad8c526119609436248f94633162918ea
      
https://github.com/qemu/qemu/commit/d765ab2ad8c526119609436248f94633162918ea
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/scsi/vhost-scsi.c

  Log Message:
  -----------
  hw/scsi/vhost-scsi: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The vhost_scsi_realize() passes @errp to error_prepend(), and as a
VirtioDeviceClass.realize method, its @errp is from DeviceClass.realize
so that there is no guarantee that the @errp won't point to
@error_fatal.

To avoid the issue like [1] said, add missing ERRP_GUARD() at the
beginning of this function.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Fam Zheng <fam@euphon.net>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Message-ID: <20240311033822.3142585-18-zhao1.liu@linux.intel.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: c9e21f998793b62a58406ead0286b09760fa7764
      
https://github.com/qemu/qemu/commit/c9e21f998793b62a58406ead0286b09760fa7764
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/vfio/ap.c

  Log Message:
  -----------
  hw/vfio/ap: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The vfio_ap_realize() passes @errp to error_prepend(), and as a
DeviceClass.realize method, there are too many possible callers to check
the impact of this defect; it may or may not be harmless. Thus it is
necessary to protect @errp with ERRP_GUARD().

To avoid the issue like [1] said, add missing ERRP_GUARD() at the
beginning of this function.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Cédric Le Goater <clg@redhat.com>
Cc: Tony Krowiak <akrowiak@linux.ibm.com>
Cc: Halil Pasic <pasic@linux.ibm.com>
Cc: Jason Herne <jjherne@linux.ibm.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: qemu-s390x@nongnu.org
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-ID: <20240311033822.3142585-19-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 93a518ba5688dbcfa1f5bc750fda176c49551f84
      
https://github.com/qemu/qemu/commit/93a518ba5688dbcfa1f5bc750fda176c49551f84
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/vfio/container.c

  Log Message:
  -----------
  hw/vfio/container: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The vfio_get_group() passes @errp to error_prepend(). Its @errp is
from vfio_attach_device(), and there are too many possible callers to
check the impact of this defect; it may or may not be harmless. Thus it
is necessary to protect @errp with ERRP_GUARD().

To avoid the issue like [1] said, add missing ERRP_GUARD() at the
beginning of this function.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-ID: <20240311033822.3142585-20-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 89a8a2e9c4ab4d71020a6e8722066b6c2dc92904
      
https://github.com/qemu/qemu/commit/89a8a2e9c4ab4d71020a6e8722066b6c2dc92904
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/vfio/helpers.c

  Log Message:
  -----------
  hw/vfio/helpers: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

In hw/vfio/helpers.c, there are 3 functions passing @errp to
error_prepend() without ERRP_GUARD():
 - vfio_set_irq_signaling()
 - vfio_device_get_name()
 - vfio_device_set_fd()

There are too many possible callers to check the impact of this defect;
it may or may not be harmless. Thus it is necessary to protect their
@errp with ERRP_GUARD().

To avoid the issue like [1] said, add missing ERRP_GUARD() at their
beginning.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-ID: <20240311033822.3142585-21-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 5cf8f51c033d0b2817f791757edcf7d6da787526
      
https://github.com/qemu/qemu/commit/5cf8f51c033d0b2817f791757edcf7d6da787526
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/vfio/iommufd.c

  Log Message:
  -----------
  hw/vfio/iommufd: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The iommufd_cdev_getfd() passes @errp to error_prepend(). Its @errp is
from vfio_attach_device(), and there are too many possible callers to
check the impact of this defect; it may or may not be harmless. Thus it
is necessary to protect @errp with ERRP_GUARD().

To avoid the issue like [1] said, add missing ERRP_GUARD() at the
beginning of this function.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-ID: <20240311033822.3142585-22-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 447655089ea0ed9ded07131fb7443ae483fd1b07
      
https://github.com/qemu/qemu/commit/447655089ea0ed9ded07131fb7443ae483fd1b07
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/vfio/pci-quirks.c

  Log Message:
  -----------
  hw/vfio/pci-quirks: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

In hw/vfio/pci-quirks.c, there are 2 functions passing @errp to
error_prepend() without ERRP_GUARD():
- vfio_add_nv_gpudirect_cap()
- vfio_add_vmd_shadow_cap()

There are too many possible callers to check the impact of this defect;
it may or may not be harmless. Thus it is necessary to protect their
@errp with ERRP_GUARD().

To avoid the issue like [1] said, add missing ERRP_GUARD() at the
beginning of this function.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-ID: <20240311033822.3142585-23-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: cf8afdfad4653ce0c96eb26d660cd86a807dbd86
      
https://github.com/qemu/qemu/commit/cf8afdfad4653ce0c96eb26d660cd86a807dbd86
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/vfio/pci.c

  Log Message:
  -----------
  hw/vfio/pci: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

In hw/vfio/pci.c, there are 2 functions passing @errp to error_prepend()
without ERRP_GUARD():
- vfio_add_std_cap()
- vfio_realize()

The @errp of vfio_add_std_cap() is also from vfio_realize(). And
vfio_realize(), as a PCIDeviceClass.realize method, its @errp is from
DeviceClass.realize so that there is no guarantee that the @errp won't
point to @error_fatal.

To avoid the issue like [1] said, add missing ERRP_GUARD() at their
beginning.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-ID: <20240311033822.3142585-24-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 498696ef7646b7ae9938336f34a5a97a44dd3af7
      
https://github.com/qemu/qemu/commit/498696ef7646b7ae9938336f34a5a97a44dd3af7
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/vfio/platform.c

  Log Message:
  -----------
  hw/vfio/platform: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The vfio_platform_realize() passes @errp to error_prepend(), and as a
DeviceClass.realize method, there are too many possible callers to check
the impact of this defect; it may or may not be harmless. Thus it is
necessary to protect @errp with ERRP_GUARD().

To avoid the issue like [1] said, add missing ERRP_GUARD() at the
beginning of this function.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-ID: <20240311033822.3142585-25-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: b403c8d5e07aead1a5834d21d4c6eeabd2669bd7
      
https://github.com/qemu/qemu/commit/b403c8d5e07aead1a5834d21d4c6eeabd2669bd7
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/virtio/vhost-vsock.c

  Log Message:
  -----------
  hw/virtio/vhost-vsock: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The vhost_vsock_device_realize() passes @errp to error_prepend(), and as
a VirtioDeviceClass.realize method, its @errp is from
DeviceClass.realize so that there is no guarantee that the @errp won't
point to @error_fatal.

To avoid the issue like [1] said, add missing ERRP_GUARD() at the
beginning of this function.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Message-ID: <20240311033822.3142585-26-zhao1.liu@linux.intel.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: ff88dbec81e02f5573996f7e45b5fd56e7b876bf
      
https://github.com/qemu/qemu/commit/ff88dbec81e02f5573996f7e45b5fd56e7b876bf
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/virtio/vhost.c

  Log Message:
  -----------
  hw/virtio/vhost: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

In hw/virtio/vhost.c, there are 2 functions passing @errp to
error_prepend() without ERRP_GUARD():
- vhost_save_backend_state()
- vhost_load_backend_state()

Their @errp both points to callers' @local_err. However, as the APIs
defined in include/hw/virtio/vhost.h, it is necessary to protect their
@errp with ERRP_GUARD().

To follow the requirement of @errp, add missing ERRP_GUARD() at their
beginning.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Message-ID: <20240311033822.3142585-27-zhao1.liu@linux.intel.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 35e83a9f614f8ae674ce27a88b9ba5f166e36e33
      
https://github.com/qemu/qemu/commit/35e83a9f614f8ae674ce27a88b9ba5f166e36e33
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M migration/options.c

  Log Message:
  -----------
  migration/option: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The migrate_params_check() passes @errp to error_prepend() without
ERRP_GUARD(), and it could be called from migration_object_init(),
where the passed @errp points to @error_fatal.

Therefore, the error message echoed in error_prepend() will be lost
because of the above issue.

To fix this, add missing ERRP_GUARD() at the beginning of this function.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Peter Xu <peterx@redhat.com>
Cc: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Acked-by: Peter Xu <peterx@redhat.com>
Message-ID: <20240311033822.3142585-28-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 3dd5fc5316705eff45e344a16c01aee2a72ba4a7
      
https://github.com/qemu/qemu/commit/3dd5fc5316705eff45e344a16c01aee2a72ba4a7
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M net/vhost-vdpa.c

  Log Message:
  -----------
  net/vhost-vdpa: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The net_init_vhost_vdpa() passes @errp to error_prepend(), and as a
member of net_client_init_fun[], it's called in net_client_init1() and
gets @errp from this caller.

But because netdev_init_modern() passes &error_fatal to
net_client_init1(), then @errp parameter of net_init_vhost_vdpa() would
point to @error_fatal. This causes the error message in error_prepend()
to be lost because of the above issue.

To fix this, add missing ERRP_GUARD() at the beginning of this function.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20240311033822.3142585-29-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 95e9053a34ca99b90f47073a30e02fa00afc3aeb
      
https://github.com/qemu/qemu/commit/95e9053a34ca99b90f47073a30e02fa00afc3aeb
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/s390x/cpu_models.c

  Log Message:
  -----------
  target/s390x/cpu_models: Fix missing ERRP_GUARD() for error_prepend()

As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

In target/s390x/cpu_models.c, there are 2 functions passing @errp to
error_prepend() without ERRP_GUARD():
- check_compatibility()
- s390_realize_cpu_model()

Though both their @errp parameters point to their callers' local @err
virables and don't cause the issue as [1] said, to follow the
requirement of @errp, also add missing ERRP_GUARD() at their beginning.

[1]: Issue description in the commit message of commit ae7c80a7bd73
     ("error: New macro ERRP_GUARD()").

Cc: David Hildenbrand <david@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Ilya Leoshkevich <iii@linux.ibm.com>
Cc: qemu-s390x@nongnu.org
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-ID: <20240311033822.3142585-30-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 46ff64a826bbd70e98484c8c7f4c3c1d83363f1d
      
https://github.com/qemu/qemu/commit/46ff64a826bbd70e98484c8c7f4c3c1d83363f1d
  Author: Zhao Liu <zhao1.liu@intel.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M block.c
    M block/qapi.c
    M hw/s390x/s390-virtio-ccw.c
    M migration/options.c
    M migration/postcopy-ram.c
    M net/vhost-vdpa.c

  Log Message:
  -----------
  error: Move ERRP_GUARD() to the beginning of the function

Since the commit 05e385d2a9 ("error: Move ERRP_GUARD() to the beginning
of the function"), there are new codes that don't put ERRP_GUARD() at
the beginning of the functions.

As stated in the commit 05e385d2a9: "include/qapi/error.h advises to put
ERRP_GUARD() right at the beginning of the function, because only then
can it guard the whole function.", so clean up the few spots
disregarding the advice.

Inspired-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240312060337.3240965-1-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: ee1004bba6eadeddf988a29716dc28849c0211c8
      
https://github.com/qemu/qemu/commit/ee1004bba6eadeddf988a29716dc28849c0211c8
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/display/ati.c
    M hw/misc/macio/pmu.c
    M hw/misc/pvpanic-pci.c
    M hw/pci-bridge/cxl_root_port.c
    M hw/ppc/pnv.c
    M hw/virtio/vhost-user-scmi.c
    M hw/virtio/virtio-pci.c
    M hw/xen/xen_pt.c
    M migration/multifd-zlib.c
    M target/arm/cpu.c
    M target/arm/kvm.c
    M target/arm/machine.c
    M target/i386/hvf/x86hvf.c
    M target/m68k/helper.c
    M target/ppc/kvm.c

  Log Message:
  -----------
  bulk: Access existing variables initialized to &S->F when available

When a variable is initialized to &struct->field, use it
in place. Rationale: while this makes the code more concise,
this also helps static analyzers.

Mechanical change using the following Coccinelle spatch script:

 @@
 type S, F;
 identifier s, m, v;
 @@
      S *s;
      ...
      F *v = &s->m;
      <+...
 -    &s->m
 +    v
      ...+>

Inspired-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-2-philmd@linaro.org>
Acked-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
[thuth: Dropped hunks that need a rebase, and fixed sizeof() in pmu_realize()]
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 97e03106018301969f9e7c1eb22d3838adbe0bcc
      
https://github.com/qemu/qemu/commit/97e03106018301969f9e7c1eb22d3838adbe0bcc
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/core/machine.c
    M hw/i386/x86.c
    M hw/loongarch/virt.c
    M hw/ppc/spapr.c
    M hw/s390x/s390-virtio-ccw.c
    M include/hw/boards.h

  Log Message:
  -----------
  hw/core: Declare CPUArchId::cpu as CPUState instead of Object

Do not accept any Object for CPUArchId::cpu field,
restrict it to CPUState type.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-3-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 94956d7b510d18f4449d1392b86e1a8f3e467612
      
https://github.com/qemu/qemu/commit/94956d7b510d18f4449d1392b86e1a8f3e467612
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M accel/tcg/cpu-exec.c
    M linux-user/i386/cpu_loop.c
    M target/hppa/mem_helper.c
    M target/hppa/translate.c
    M target/i386/nvmm/nvmm-all.c
    M target/i386/whpx/whpx-all.c
    M target/loongarch/tcg/translate.c
    M target/rx/translate.c
    M target/sh4/op_helper.c

  Log Message:
  -----------
  bulk: Call in place single use cpu_env()

Avoid CPUArchState local variable when cpu_env() is used once.

Mechanical patch using the following Coccinelle spatch script:

 @@
 type CPUArchState;
 identifier env;
 expression cs;
 @@
  {
 -    CPUArchState *env = cpu_env(cs);
      ... when != env
 -     env
 +     cpu_env(cs)
      ... when != env
  }

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240129164514.73104-5-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 348802b526e6449a97635dfcc38030cd00b56d27
      
https://github.com/qemu/qemu/commit/348802b526e6449a97635dfcc38030cd00b56d27
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/arm/cpu.c
    M target/avr/cpu.c
    M target/cris/cpu.c
    M target/hexagon/cpu.c
    M target/i386/cpu.c
    M target/loongarch/cpu.c
    M target/m68k/cpu.c
    M target/microblaze/cpu.c
    M target/mips/cpu.c
    M target/nios2/cpu.c
    M target/openrisc/cpu.c
    M target/ppc/cpu_init.c
    M target/riscv/cpu.c
    M target/rx/cpu.c
    M target/sh4/cpu.c
    M target/sparc/cpu.c
    M target/tricore/cpu.c
    M target/xtensa/cpu.c

  Log Message:
  -----------
  target: Replace CPU_GET_CLASS(cpu -> obj) in cpu_reset_hold() handler

Since CPU() macro is a simple cast, the following are equivalent:

  Object *obj;
  CPUState *cs = CPU(obj)

In order to ease static analysis when running
scripts/coccinelle/cpu_env.cocci from the previous commit,
replace:

 - CPU_GET_CLASS(cpu);
 + CPU_GET_CLASS(obj);

Most code use the 'cs' variable name for CPUState handle.
Replace few 's' -> 'cs' to unify cpu_reset_hold() style.

No logical change in this patch.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240129164514.73104-7-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 50cb36ce77906c24dd6f587c636d3d71dd6128f4
      
https://github.com/qemu/qemu/commit/50cb36ce77906c24dd6f587c636d3d71dd6128f4
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/alpha/cpu.c
    M target/alpha/gdbstub.c
    M target/alpha/helper.c
    M target/alpha/mem_helper.c
    M target/alpha/translate.c

  Log Message:
  -----------
  target/alpha: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-8-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 2db5b94d8343816e99527cf99cf14d090d174ef6
      
https://github.com/qemu/qemu/commit/2db5b94d8343816e99527cf99cf14d090d174ef6
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/avr/cpu.c
    M target/avr/gdbstub.c
    M target/avr/helper.c
    M target/avr/translate.c

  Log Message:
  -----------
  target/avr: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-10-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 2df4ab2fbc95076ab2f02f34da75a131e1594f24
      
https://github.com/qemu/qemu/commit/2df4ab2fbc95076ab2f02f34da75a131e1594f24
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/cris/cpu.c
    M target/cris/gdbstub.c
    M target/cris/helper.c
    M target/cris/translate.c

  Log Message:
  -----------
  target/cris: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-11-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 7ab7428199edb271fee5308c818f59270487bbe7
      
https://github.com/qemu/qemu/commit/7ab7428199edb271fee5308c818f59270487bbe7
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/hexagon/cpu.c
    M target/hexagon/gdbstub.c

  Log Message:
  -----------
  target/hexagon: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Brian Cain <bcain@quicinc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240129164514.73104-12-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: f8436a16054a13eaf969bba9b2733ec43969f952
      
https://github.com/qemu/qemu/commit/f8436a16054a13eaf969bba9b2733ec43969f952
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/i386/hvf/x86.c
    M target/i386/hvf/x86.h
    M target/i386/hvf/x86_descr.c
    M target/i386/hvf/x86_descr.h
    M target/i386/hvf/x86_emu.h
    M target/i386/hvf/x86_mmu.c
    M target/i386/hvf/x86_mmu.h

  Log Message:
  -----------
  target/i386/hvf: Use CPUState typedef

QEMU coding style recommend using structure typedefs:
https://www.qemu.org/docs/master/devel/style.html#typedefs

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-ID: <20240129164514.73104-14-philmd@linaro.org>
[thuth: Break long lines to avoid checkpatch.pl errors]
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: f3b603b95e7a4a47174557e18dac47e386766a13
      
https://github.com/qemu/qemu/commit/f3b603b95e7a4a47174557e18dac47e386766a13
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/loongarch/cpu.c
    M target/loongarch/cpu_helper.c
    M target/loongarch/gdbstub.c
    M target/loongarch/kvm/kvm.c
    M target/loongarch/tcg/tlb_helper.c

  Log Message:
  -----------
  target/loongarch: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-16-philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
[thuth: Adjusted patch for hunk that moved to cpu_helper.c]
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: e22a4560360144931976a0a2199cdb26428dc1b2
      
https://github.com/qemu/qemu/commit/e22a4560360144931976a0a2199cdb26428dc1b2
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/m68k/cpu.c
    M target/m68k/gdbstub.c
    M target/m68k/helper.c
    M target/m68k/m68k-semi.c
    M target/m68k/op_helper.c
    M target/m68k/translate.c

  Log Message:
  -----------
  target/m68k: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-17-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: da9536433fe9d35363fea26cee7f2de93c007ec2
      
https://github.com/qemu/qemu/commit/da9536433fe9d35363fea26cee7f2de93c007ec2
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/microblaze/gdbstub.c
    M target/microblaze/helper.c
    M target/microblaze/translate.c

  Log Message:
  -----------
  target/microblaze: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-18-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 4c44a9805127d8f6f065d40fd9f9c65fcf75bcc2
      
https://github.com/qemu/qemu/commit/4c44a9805127d8f6f065d40fd9f9c65fcf75bcc2
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/mips/cpu.c
    M target/mips/gdbstub.c
    M target/mips/kvm.c
    M target/mips/sysemu/physaddr.c
    M target/mips/tcg/exception.c
    M target/mips/tcg/op_helper.c
    M target/mips/tcg/sysemu/special_helper.c
    M target/mips/tcg/sysemu/tlb_helper.c
    M target/mips/tcg/translate.c

  Log Message:
  -----------
  target/mips: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240129164514.73104-19-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 6fed7e43fa56553bb9ac9c807e8de8ade9522417
      
https://github.com/qemu/qemu/commit/6fed7e43fa56553bb9ac9c807e8de8ade9522417
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/nios2/cpu.c
    M target/nios2/helper.c
    M target/nios2/nios2-semi.c
    M target/nios2/translate.c

  Log Message:
  -----------
  target/nios2: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-20-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 074bd799e73a23b0ce05ed45f2668ceb31db144e
      
https://github.com/qemu/qemu/commit/074bd799e73a23b0ce05ed45f2668ceb31db144e
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/openrisc/gdbstub.c
    M target/openrisc/interrupt.c
    M target/openrisc/translate.c

  Log Message:
  -----------
  target/openrisc: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-21-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 794511bc51bc89f384063103653e5f40c75cd49e
      
https://github.com/qemu/qemu/commit/794511bc51bc89f384063103653e5f40c75cd49e
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/ppc/mpc8544_guts.c
    M hw/ppc/pnv.c
    M hw/ppc/pnv_xscom.c
    M hw/ppc/ppce500_spin.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_caps.c
    M target/ppc/cpu_init.c
    M target/ppc/excp_helper.c
    M target/ppc/gdbstub.c
    M target/ppc/kvm.c
    M target/ppc/ppc-qmp-cmds.c
    M target/ppc/user_only_helper.c

  Log Message:
  -----------
  target/ppc: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-22-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: f2a4459db93dee8f333d6f1e85acac53e5a8609e
      
https://github.com/qemu/qemu/commit/f2a4459db93dee8f333d6f1e85acac53e5a8609e
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/rx/cpu.c
    M target/rx/gdbstub.c
    M target/rx/helper.c
    M target/rx/translate.c

  Log Message:
  -----------
  target/rx: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240129164514.73104-24-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 795bec96522356b5afb6c9ebb3ea0974fa3d4a27
      
https://github.com/qemu/qemu/commit/795bec96522356b5afb6c9ebb3ea0974fa3d4a27
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/sh4/cpu.c
    M target/sh4/gdbstub.c
    M target/sh4/helper.c
    M target/sh4/translate.c

  Log Message:
  -----------
  target/sh4: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-26-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 7797676965359a78817d35e5ed369f425e63e7db
      
https://github.com/qemu/qemu/commit/7797676965359a78817d35e5ed369f425e63e7db
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/sparc/cpu.c
    M target/sparc/gdbstub.c
    M target/sparc/int32_helper.c
    M target/sparc/int64_helper.c
    M target/sparc/ldst_helper.c
    M target/sparc/mmu_helper.c
    M target/sparc/translate.c

  Log Message:
  -----------
  target/sparc: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-27-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 39ac0bac99ac98e6e3cf7d3f8fd7958cc342175d
      
https://github.com/qemu/qemu/commit/39ac0bac99ac98e6e3cf7d3f8fd7958cc342175d
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/tricore/cpu.c
    M target/tricore/gdbstub.c
    M target/tricore/helper.c
    M target/tricore/translate.c

  Log Message:
  -----------
  target/tricore: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Message-ID: <20240129164514.73104-28-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 52049266e58e534739b9d72215930d6195dfd723
      
https://github.com/qemu/qemu/commit/52049266e58e534739b9d72215930d6195dfd723
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/xtensa/cpu.c
    M target/xtensa/dbg_helper.c
    M target/xtensa/exc_helper.c
    M target/xtensa/gdbstub.c
    M target/xtensa/helper.c
    M target/xtensa/translate.c

  Log Message:
  -----------
  target/xtensa: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-29-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 42e62aadfdcc44215482a85da55dc4758775d790
      
https://github.com/qemu/qemu/commit/42e62aadfdcc44215482a85da55dc4758775d790
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M bsd-user/signal.c
    M linux-user/signal.c

  Log Message:
  -----------
  user: Prefer fast cpu_env() over slower CPU QOM cast macro

Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-ID: <20240129164514.73104-30-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: ef6783d3f7d06cf185971afbb30ff35209e9db49
      
https://github.com/qemu/qemu/commit/ef6783d3f7d06cf185971afbb30ff35209e9db49
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/arm/arm-qmp-cmds.c
    M target/riscv/riscv-qmp-cmds.c
    M target/s390x/cpu_models_sysemu.c
    M tests/qtest/arm-cpu-features.c

  Log Message:
  -----------
  target: Simplify type checks for CpuModelInfo member @props

CpuModelInfo member @props is semantically a mapping from name to
value, and syntactically a JSON object on the wire.  This translates
to QDict in C.  Since the QAPI schema language lacks the means to
express 'object', we use 'any' instead.  This is QObject in C.
Commands taking a CpuModelInfo argument need to check the QObject is a
QDict.

For arm, riscv, and s390x, the code checks right before passing the
QObject to visit_start_struct().  visit_start_struct() then checks
again.

Delete the first check.

The error message for @props that are not an object changes slightly
to the the message we get for this kind of type error in other
contexts.  Minor improvement.

Additionally, error messages about members of @props now refer to
'props.prop-name' instead of just 'prop-name'.  Another minor
improvement.

Both changes are visible in tests/qtest/arm-cpu-features.c.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240305145919.2186971-2-armbru@redhat.com>
Acked-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
[Drop #include now superfluous]


  Commit: 68192a5ffd00e4b5123b86fe93986d03ff066c68
      
https://github.com/qemu/qemu/commit/68192a5ffd00e4b5123b86fe93986d03ff066c68
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/i386/cpu-sysemu.c

  Log Message:
  -----------
  target/i386: Fix query-cpu-model-expansion to reject props

CpuModelInfo member @props is semantically a mapping from name to
value, and syntactically a JSON object on the wire.  This translates
to QDict in C.  Since the QAPI schema language lacks the means to
express 'object', we use 'any' instead.  This is QObject in C.
Commands taking a CpuModelInfo argument need to check the QObject is a
QDict.

The i386 version of qmp_query_cpu_model_expansion() fails to check.
Instead, @props is silently ignored when it's not an object.  For
instance,

    {"execute": "query-cpu-model-expansion", "arguments": {"type": "full", 
"model": {"name": "qemu64", "props": null}}}

succeeds.

Fix by refactoring the code to match the other targets.  Now the
command fails as it should:

    {"error": {"class": "GenericError", "desc": "Invalid parameter type for 
'props', expected: object"}}

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240305145919.2186971-3-armbru@redhat.com>


  Commit: 8934643a0e2631d468940b05ae2332f219631d17
      
https://github.com/qemu/qemu/commit/8934643a0e2631d468940b05ae2332f219631d17
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/arm/arm-qmp-cmds.c
    M target/i386/cpu-sysemu.c
    M target/riscv/riscv-qmp-cmds.c
    M target/s390x/cpu_models_sysemu.c
    M tests/qtest/arm-cpu-features.c

  Log Message:
  -----------
  target: Improve error reporting for CpuModelInfo member @props

query-cpu-model-comparison, query-cpu-model-baseline, and
query-cpu-model-expansion take CpuModelInfo arguments.  Errors in
@props members of these arguments are reported for 'props', without
further context.  For instance, s390x rejects

    {"execute": "query-cpu-model-comparison", "arguments": {"modela": {"name": 
"z13", "props": {}}, "modelb": {"name": "z14", "props": []}}}

with

    {"error": {"class": "GenericError", "desc": "Invalid parameter type for 
'props', expected: object"}}

This is unusual; the common QAPI unmarshaling machinery would complain
about 'modelb.props'.  Our hand-written code to visit the @props
member neglects to provide the context.

Tweak it so it provides it.  The command above now fails with

    {"error": {"class": "GenericError", "desc": "Invalid parameter type for 
'modelb.props', expected: dict"}}

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240305145919.2186971-4-armbru@redhat.com>
Acked-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>


  Commit: 28054406715a90e3fab96d4a29190e8857e57fbc
      
https://github.com/qemu/qemu/commit/28054406715a90e3fab96d4a29190e8857e57fbc
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/loongarch/loongarch-qmp-cmds.c

  Log Message:
  -----------
  target/loongarch: Fix query-cpu-model-expansion to reject props

query-cpu-model-expansion takes a CpuModelInfo argument.  The
loongarch version of the command silently ignores the argument's
member @props.  For instance,

    {"execute": "query-cpu-model-expansion", "arguments": {"type": "static", 
"model": {"name": "la464", "props": null}}}

and

    {"execute": "query-cpu-model-expansion", "arguments": {"type": "static", 
"model": {"name": "la464", "props": {"prop": null}}}}

succeed.

Add skeleton code for property processing that recognizes no
properties.  Now the two commands fail as they should:

    {"error": {"class": "GenericError", "desc": "Invalid parameter type for 
'model.props', expected: object"}}

and

    {"error": {"class": "GenericError", "desc": "Parameter 'model.props.prop' 
is unexpected"}}

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240305145919.2186971-5-armbru@redhat.com>
[Drop #include now superfluous]


  Commit: 349b1881deeb28999639444df4d318787673aed9
      
https://github.com/qemu/qemu/commit/349b1881deeb28999639444df4d318787673aed9
  Author: Akihiko Odaki <akihiko.odaki@daynix.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M ui/vnc.c

  Log Message:
  -----------
  ui/vnc: Respect bound console

ui/vnc may have a bound console so pass it to qemu_console_is_graphic()
and qemu_text_console_put_keysym().

Fixes: 1d0d59fe2919 ("vnc: allow binding servers to qemu consoles")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20231211-vnc-v1-1-a3551d284809@daynix.com>


  Commit: 7945576cf298efb90a03b3e74912e3fe5952db56
      
https://github.com/qemu/qemu/commit/7945576cf298efb90a03b3e74912e3fe5952db56
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M ui/dbus-listener.c

  Log Message:
  -----------
  ui/dbus: factor out sending a scanout

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>


  Commit: fa88b85dea96ebad8d4380a3dee2a9e6e40c218c
      
https://github.com/qemu/qemu/commit/fa88b85dea96ebad8d4380a3dee2a9e6e40c218c
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M ui/dbus-listener.c
    M ui/trace-events

  Log Message:
  -----------
  ui/dbus: filter out pending messages when scanout

The "Listener" connection, being private and under the control of the
qemu display, allows for the optimization of discarding pending
intermediary messages when queuing a new scanout. This ensures that the
client receives only the latest scanout update, improving communication
efficiency.

While the current implementation does not provide a mechanism for
clients who may wish to receive all updates, making this behavior
optional could be considered in the future. For now, adopting this new
default behavior accelerates the communication process without a
guarantee of delivering all updates.

The filter is removed when the connection is dropped.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>


  Commit: cab47b210598c11b76053a01316df9835b94dc09
      
https://github.com/qemu/qemu/commit/cab47b210598c11b76053a01316df9835b94dc09
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/display/virtio-gpu.c

  Log Message:
  -----------
  virtio-gpu: remove needless condition

qemu_create_displaysurface_pixman() never returns NULL.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>


  Commit: dfcf74fa68c88233209aafc5f82728d0b9a1af5c
      
https://github.com/qemu/qemu/commit/dfcf74fa68c88233209aafc5f82728d0b9a1af5c
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/display/virtio-gpu.c
    M include/hw/virtio/virtio-gpu.h

  Log Message:
  -----------
  virtio-gpu: fix scanout migration post-load

The current post-loading code for scanout has a FIXME: it doesn't take
the resource region/rect into account. But there is more, when adding
blob migration support in commit f66767f75c9, I didn't realize that blob
resources could be used for scanouts. This situationn leads to a crash
during post-load, as they don't have an associated res->image.

virtio_gpu_do_set_scanout() handle all cases, but requires the
associated virtio_gpu_framebuffer, which is currently not saved during
migration.

Add a v2 of "virtio-gpu-one-scanout" with the framebuffer fields, so we
can restore blob scanouts, as well as fixing the existing FIXME.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Sebastian Ott <sebott@redhat.com>


  Commit: e692f9c6a681de1372a41999b14a947a553b6a1a
      
https://github.com/qemu/qemu/commit/e692f9c6a681de1372a41999b14a947a553b6a1a
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M accel/tcg/cpu-exec.c
    M backends/iommufd.c
    M block.c
    M block/copy-before-write.c
    M block/nbd.c
    M block/nvme.c
    M block/qapi.c
    M block/qcow2-bitmap.c
    M block/qcow2.c
    M block/qed.c
    M block/snapshot.c
    M block/vdi.c
    M block/vmdk.c
    M bsd-user/signal.c
    M hw/block/virtio-blk.c
    M hw/core/machine.c
    M hw/cxl/cxl-host.c
    M hw/display/ati.c
    M hw/display/macfb.c
    M hw/i386/x86.c
    M hw/intc/ioapic_common.c
    M hw/loongarch/virt.c
    M hw/mem/cxl_type3.c
    M hw/misc/macio/pmu.c
    M hw/misc/pvpanic-pci.c
    M hw/misc/xlnx-versal-trng.c
    M hw/pci-bridge/cxl_root_port.c
    M hw/pci-bridge/cxl_upstream.c
    M hw/ppc/mpc8544_guts.c
    M hw/ppc/pnv.c
    M hw/ppc/pnv_xscom.c
    M hw/ppc/ppce500_spin.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_caps.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/scsi/vhost-scsi.c
    M hw/vfio/ap.c
    M hw/vfio/container.c
    M hw/vfio/helpers.c
    M hw/vfio/iommufd.c
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    M hw/vfio/platform.c
    M hw/virtio/vhost-user-scmi.c
    M hw/virtio/vhost-vsock.c
    M hw/virtio/vhost.c
    M hw/virtio/virtio-pci.c
    M hw/xen/xen_pt.c
    M include/hw/boards.h
    M include/qapi/error.h
    M linux-user/i386/cpu_loop.c
    M linux-user/signal.c
    M migration/multifd-zlib.c
    M migration/options.c
    M migration/postcopy-ram.c
    M net/vhost-vdpa.c
    M target/alpha/cpu.c
    M target/alpha/gdbstub.c
    M target/alpha/helper.c
    M target/alpha/mem_helper.c
    M target/alpha/translate.c
    M target/arm/cpu.c
    M target/arm/kvm.c
    M target/arm/machine.c
    M target/avr/cpu.c
    M target/avr/gdbstub.c
    M target/avr/helper.c
    M target/avr/translate.c
    M target/cris/cpu.c
    M target/cris/gdbstub.c
    M target/cris/helper.c
    M target/cris/translate.c
    M target/hexagon/cpu.c
    M target/hexagon/gdbstub.c
    M target/hppa/mem_helper.c
    M target/hppa/translate.c
    M target/i386/cpu.c
    M target/i386/hvf/x86.c
    M target/i386/hvf/x86.h
    M target/i386/hvf/x86_descr.c
    M target/i386/hvf/x86_descr.h
    M target/i386/hvf/x86_emu.h
    M target/i386/hvf/x86_mmu.c
    M target/i386/hvf/x86_mmu.h
    M target/i386/hvf/x86hvf.c
    M target/i386/nvmm/nvmm-all.c
    M target/i386/whpx/whpx-all.c
    M target/loongarch/cpu.c
    M target/loongarch/cpu_helper.c
    M target/loongarch/gdbstub.c
    M target/loongarch/kvm/kvm.c
    M target/loongarch/tcg/tlb_helper.c
    M target/loongarch/tcg/translate.c
    M target/m68k/cpu.c
    M target/m68k/gdbstub.c
    M target/m68k/helper.c
    M target/m68k/m68k-semi.c
    M target/m68k/op_helper.c
    M target/m68k/translate.c
    M target/microblaze/cpu.c
    M target/microblaze/gdbstub.c
    M target/microblaze/helper.c
    M target/microblaze/translate.c
    M target/mips/cpu.c
    M target/mips/gdbstub.c
    M target/mips/kvm.c
    M target/mips/sysemu/physaddr.c
    M target/mips/tcg/exception.c
    M target/mips/tcg/op_helper.c
    M target/mips/tcg/sysemu/special_helper.c
    M target/mips/tcg/sysemu/tlb_helper.c
    M target/mips/tcg/translate.c
    M target/nios2/cpu.c
    M target/nios2/helper.c
    M target/nios2/nios2-semi.c
    M target/nios2/translate.c
    M target/openrisc/cpu.c
    M target/openrisc/gdbstub.c
    M target/openrisc/interrupt.c
    M target/openrisc/translate.c
    M target/ppc/cpu_init.c
    M target/ppc/excp_helper.c
    M target/ppc/gdbstub.c
    M target/ppc/kvm.c
    M target/ppc/ppc-qmp-cmds.c
    M target/ppc/user_only_helper.c
    M target/riscv/cpu.c
    M target/rx/cpu.c
    M target/rx/gdbstub.c
    M target/rx/helper.c
    M target/rx/translate.c
    M target/s390x/cpu_models.c
    M target/sh4/cpu.c
    M target/sh4/gdbstub.c
    M target/sh4/helper.c
    M target/sh4/op_helper.c
    M target/sh4/translate.c
    M target/sparc/cpu.c
    M target/sparc/gdbstub.c
    M target/sparc/int32_helper.c
    M target/sparc/int64_helper.c
    M target/sparc/ldst_helper.c
    M target/sparc/mmu_helper.c
    M target/sparc/translate.c
    M target/tricore/cpu.c
    M target/tricore/gdbstub.c
    M target/tricore/helper.c
    M target/tricore/translate.c
    M target/xtensa/cpu.c
    M target/xtensa/dbg_helper.c
    M target/xtensa/exc_helper.c
    M target/xtensa/gdbstub.c
    M target/xtensa/helper.c
    M target/xtensa/translate.c

  Log Message:
  -----------
  Merge tag 'pull-request-2024-03-12' of https://gitlab.com/thuth/qemu into 
staging

* Add missing ERRP_GUARD() statements in functions that need it
* Prefer fast cpu_env() over slower CPU QOM cast macro

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmXwPhYRHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbWHvBAAgKx5LHFjz3xREVA+LkDTQ49mz0lK3s32
# SGvNlIHjiaDGVttVYhVC4sinBWUruG4Lyv/2QN72OJBzn6WUsEUQE3KPH1d7Y3/s
# wS9X7mj70n4kugWJqeIJP5AXSRasHmWoQ4QJLVQRJd6+Eb9jqwep0x7bYkI1de6D
# bL1Q7bIfkFeNQBXaiPWAm2i+hqmT4C1r8HEAGZIjAsMFrjy/hzBEjNV+pnh6ZSq9
# Vp8BsPWRfLU2XHm4WX0o8d89WUMAfUGbVkddEl/XjIHDrUD+Zbd1HAhLyfhsmrnE
# jXIwSzm+ML1KX4MoF5ilGtg8Oo0gQDEBy9/xck6G0HCm9lIoLKlgTxK9glr2vdT8
# yxZmrM9Hder7F9hKKxmb127xgU6AmL7rYmVqsoQMNAq22D6Xr4UDpgFRXNk2/wO6
# zZZBkfZ4H4MpZXbd/KJpXvYH5mQA4IpkOy8LJdE+dbcHX7Szy9ksZdPA+Z10hqqf
# zqS13qTs3abxymy2Q/tO3hPKSJCk1+vCGUkN60Wm+9VoLWGoU43qMc7gnY/pCS7m
# 0rFKtvfwFHhokX1orK0lP/ppVzPv/5oFIeK8YDY9if+N+dU2LCwVZHIuf2/VJPRq
# wmgH2vAn3JDoRKPxTGX9ly6AMxuZaeP92qBTOPap0gDhihYzIpaCq9ecEBoTakI7
# tdFhV0iRr08=
# =NiP4
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 12 Mar 2024 11:35:50 GMT
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2024-03-12' of https://gitlab.com/thuth/qemu: (55 commits)
  user: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/xtensa: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/tricore: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/sparc: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/sh4: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/rx: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/ppc: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/openrisc: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/nios2: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/mips: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/microblaze: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/m68k: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/loongarch: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/i386/hvf: Use CPUState typedef
  target/hexagon: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/cris: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/avr: Prefer fast cpu_env() over slower CPU QOM cast macro
  target/alpha: Prefer fast cpu_env() over slower CPU QOM cast macro
  target: Replace CPU_GET_CLASS(cpu -> obj) in cpu_reset_hold() handler
  bulk: Call in place single use cpu_env()
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


  Commit: 441e0eefabbb6283223237a26f2a48c6a61db40a
      
https://github.com/qemu/qemu/commit/441e0eefabbb6283223237a26f2a48c6a61db40a
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M target/arm/arm-qmp-cmds.c
    M target/i386/cpu-sysemu.c
    M target/loongarch/loongarch-qmp-cmds.c
    M target/riscv/riscv-qmp-cmds.c
    M target/s390x/cpu_models_sysemu.c
    M tests/qtest/arm-cpu-features.c

  Log Message:
  -----------
  Merge tag 'pull-error-2024-03-12' of https://repo.or.cz/qemu/armbru into 
staging

Error reporting patches for 2024-03-12

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmXwWOYSHGFybWJydUBy
# ZWRoYXQuY29tAAoJEDhwtADrkYZT+voP/jAEyPfbtwggKLHjSCkHchn/uUziLJ2o
# //i7+ZV9soCizAEkW+AkIR17PsMCaRsa8W4AULLn+ZaDJNy1Vlj2WYIkgeFm/rba
# AWfNXywIg7dLnj0Hd98nz13hPuP52hO9vpakPhcua9L6mmk1htdqbbGIFIIfbQhp
# e6FM+sBEW44uGcZx+N0wMEpKF0F7RId/jzH4mfP35WE7CLaAr2EfTXFaadAM636e
# QsrM8wuiNAPQeyXz14gxYTWAnnMGglM5WQ4hoxSGN0y8c007gvff5vMKc7vapn4/
# DdiYJqpq/DIWaiGL0Fl8Cpry3WrQ8UY0st745kCLF/f9nlL0GvnBGdLdUaap7lQZ
# A/C1sDKNubAGwzcw643AhV73QHc9f5kDBdWIj5wj3k5DQmBmgKACzGs1edDVVB+2
# OaStqZZ/V9Q5gljjh6PiHEptTjPhsaftX7GGjbhXTJUDFB9GONSCEVwAdZZxJ0Pm
# 6cQLtcIMtcjL4xXNz6niVZkxGT/zu4kqbZ01LudIqEQAnULwRiVpyjkCmReSAOPP
# eBtkCQtn7WPlz4N3ZiV2+a1p4/e88KH9wvxF+XvPEJjgsdeUmxX44f82ouLPJzvE
# fOXE11tRr41u9m+UmoinVo581CKYGlkRJlNQWQwFOmnXoKP2nPZzADxraihkCR5p
# wT0Hz9uwJs94
# =6FSf
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 12 Mar 2024 13:30:14 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-error-2024-03-12' of https://repo.or.cz/qemu/armbru:
  target/loongarch: Fix query-cpu-model-expansion to reject props
  target: Improve error reporting for CpuModelInfo member @props
  target/i386: Fix query-cpu-model-expansion to reject props
  target: Simplify type checks for CpuModelInfo member @props

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


  Commit: 0748129684be2773117b0b8fc3c60161abdb7bb8
      
https://github.com/qemu/qemu/commit/0748129684be2773117b0b8fc3c60161abdb7bb8
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M hw/display/virtio-gpu.c
    M include/hw/virtio/virtio-gpu.h
    M ui/dbus-listener.c
    M ui/trace-events
    M ui/vnc.c

  Log Message:
  -----------
  Merge tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu into 
staging

display/ui: pending fixes

- ui/vnc: Respect bound console
- ui/dbus: optimize a bit message queuing
- virtio-gpu: fix blob scanout post-load

# -----BEGIN PGP SIGNATURE-----
#
# iQJQBAABCAA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmXwYCYcHG1hcmNhbmRy
# ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5bv9D/9J1g76mYND+ad++d+G
# YiewXtHVwrHm9g+TxUdWXaBcDFy+uFtGpwIBtYN76YjSSL47li74V7sQTZ2FQVys
# Y8W61xBzDoAcCLV7/m48WW/mov2+TtyUFYIC3ZOBFS6Ol5aiJ8uurJa11h2WTacq
# tQKlK5g//Yv0H0cxn1cYMqRFdsko3H2hSmYz36QuPWfxivC2VeMnN/iTSGfiVSb+
# hTkOdRu+5qmt3mbbYo0Z6YpvjhLqSLob6n29+P7/QlwrQxP+A/JSS4FrAHryXzvm
# qZ/wRsPmThjwpnt3ZV9AapagQ7908FRmh1EhyAxrWq2G8QGK/XvJ/JPwBOgZGEiy
# W48N5FQhdQUkxkVpkmQVpGhJFAzclqJh/duZiBtixw+25Md6DG04OwHy9k7qCph7
# qj2BZuaSafVcSE0JEG78bt5YHAO3Joyfjf7Jhb0Tqvn2kbv94tCTGtUIH6ngYv4Z
# r0vTmlDr7pe1xaa9HeFpaopckvj4uQhlcMHnrETnUtcdWKE5SaBlgNsIwHlNlKZ6
# wmUIMKymXNRIiCZrf2xxJr7PeZ8FJgTlHCy9poSJRwpZDKHaZQMecklELx+jECuU
# DPhAmTPTZjCKiXGCI+KlL6nDy/H7zA6boCMO2QpKVk0ehviWOQZvu94srTJL5nz/
# RX+rwGbf3+8LfIFJmLcQCD5qag==
# =oY0A
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 12 Mar 2024 14:01:10 GMT
# gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
# gpg:                issuer "marcandre.lureau@redhat.com"
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" 
[full]
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" 
[full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu:
  virtio-gpu: fix scanout migration post-load
  virtio-gpu: remove needless condition
  ui/dbus: filter out pending messages when scanout
  ui/dbus: factor out sending a scanout
  ui/vnc: Respect bound console

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/35ac6831d98e...0748129684be

To unsubscribe from these emails, change your notification settings at 
https://github.com/qemu/qemu/settings/notifications



reply via email to

[Prev in Thread] Current Thread [Next in Thread]