[PATCH v2 00/29] Cleanup up to fix missing ERRP_GUARD() for error_prepend()

Zhao Liu posted 29 patches 1 month, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240311033822.3142585-1-zhao1.liu@linux.intel.com
Maintainers: Yi Liu <yi.l.liu@intel.com>, Eric Auger <eric.auger@redhat.com>, Zhenzhong Duan <zhenzhong.duan@intel.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, John Snow <jsnow@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, Eric Blake <eblake@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <fam@euphon.net>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Stefan Weil <sw@weilnetz.de>, "Michael S. Tsirkin" <mst@redhat.com>, Paul Burton <paulburton@kernel.org>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Tony Krowiak <akrowiak@linux.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Jason Herne <jjherne@linux.ibm.com>, Alex Williamson <alex.williamson@redhat.com>, "Cédric Le Goater" <clg@redhat.com>, Thomas Huth <thuth@redhat.com>, Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, Jason Wang <jasowang@redhat.com>, David Hildenbrand <david@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Ilya Leoshkevich <iii@linux.ibm.com>
backends/iommufd.c               | 1 +
block.c                          | 4 ++++
block/copy-before-write.c        | 1 +
block/nbd.c                      | 1 +
block/nvme.c                     | 3 +++
block/qcow2-bitmap.c             | 1 +
block/qcow2.c                    | 2 ++
block/qed.c                      | 1 +
block/snapshot.c                 | 2 ++
block/vdi.c                      | 1 +
block/vmdk.c                     | 1 +
hw/block/virtio-blk.c            | 1 +
hw/core/loader-fit.c             | 2 ++
hw/core/qdev-properties-system.c | 1 +
hw/misc/ivshmem.c                | 1 +
hw/scsi/vhost-scsi.c             | 1 +
hw/vfio/ap.c                     | 1 +
hw/vfio/container.c              | 1 +
hw/vfio/helpers.c                | 3 +++
hw/vfio/iommufd.c                | 1 +
hw/vfio/pci-quirks.c             | 2 ++
hw/vfio/pci.c                    | 2 ++
hw/vfio/platform.c               | 1 +
hw/virtio/vhost-vsock.c          | 1 +
hw/virtio/vhost.c                | 2 ++
include/qapi/error.h             | 2 +-
migration/options.c              | 2 ++
net/vhost-vdpa.c                 | 1 +
target/s390x/cpu_models.c        | 2 ++
29 files changed, 44 insertions(+), 1 deletion(-)
[PATCH v2 00/29] Cleanup up to fix missing ERRP_GUARD() for error_prepend()
Posted by Zhao Liu 1 month, 2 weeks ago
From: Zhao Liu <zhao1.liu@intel.com>

Hi,

This series is the v2 to add missing ERRP_GUARD() for error_prepend(),
which collects the previous v1 part 1 [1] and v1 part 2 (and excludes
the 4 patches that have already been merged).

The @errp's second restriction (in qapi/error) said:

* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.

With this series, all error_prepend() will follow the above usage rules.

In this series, 2 cases of error_prepend() with &error_fatal are
recognized (patch 30 & patch 31).

And there are some remaining TODOs:
* follow-up cleanup for related @err use cases. (Suggested by Thomas)
* continue to cleanup error_append_hint().


The cleanup looks very trivial and thanks for your review!

[1]: https://lore.kernel.org/qemu-devel/20240228163723.1775791-1-zhao1.liu@linux.intel.com/
[2]: https://lore.kernel.org/qemu-devel/20240229143914.1977550-1-zhao1.liu@linux.intel.com/

Thanks and Best Regards,
Zhao

---
Zhao Liu (29):
  error: Add error_vprepend() in comment of ERRP_GUARD() rules
  backends/iommufd: Fix missing ERRP_GUARD() for error_prepend()
  block: Fix missing ERRP_GUARD() for error_prepend()
  block/copy-before-write: Fix missing ERRP_GUARD() for error_prepend()
  block/nbd: Fix missing ERRP_GUARD() for error_prepend()
  block/nvme: Fix missing ERRP_GUARD() for error_prepend()
  block/qcow2-bitmap: Fix missing ERRP_GUARD() for error_prepend()
  block/qcow2: Fix missing ERRP_GUARD() for error_prepend()
  block/qed: Fix missing ERRP_GUARD() for error_prepend()
  block/snapshot: Fix missing ERRP_GUARD() for error_prepend()
  block/vdi: Fix missing ERRP_GUARD() for error_prepend()
  block/vmdk: Fix missing ERRP_GUARD() for error_prepend()
  block/virtio-blk: Fix missing ERRP_GUARD() for error_prepend()
  hw/core/loader-fit: Fix missing ERRP_GUARD() for error_prepend()
  hw/core/qdev-properties-system: Fix missing ERRP_GUARD() for
    error_prepend()
  hw/misc/ivshmem: Fix missing ERRP_GUARD() for error_prepend()
  hw/scsi/vhost-scsi: Fix missing ERRP_GUARD() for error_prepend()
  hw/vfio/ap: Fix missing ERRP_GUARD() for error_prepend()
  hw/vfio/container: Fix missing ERRP_GUARD() for error_prepend()
  hw/vfio/helpers: Fix missing ERRP_GUARD() for error_prepend()
  hw/vfio/iommufd: Fix missing ERRP_GUARD() for error_prepend()
  hw/vfio/pci-quirks: Fix missing ERRP_GUARD() for error_prepend()
  hw/vfio/pci: Fix missing ERRP_GUARD() for error_prepend()
  hw/vfio/platform: Fix missing ERRP_GUARD() for error_prepend()
  hw/virtio/vhost-vsock: Fix missing ERRP_GUARD() for error_prepend()
  hw/virtio/vhost: Fix missing ERRP_GUARD() for error_prepend()
  migration/option: Fix missing ERRP_GUARD() for error_prepend()
  net/vhost-vdpa: Fix missing ERRP_GUARD() for error_prepend()
  target/s390x/cpu_models: Fix missing ERRP_GUARD() for error_prepend()

 backends/iommufd.c               | 1 +
 block.c                          | 4 ++++
 block/copy-before-write.c        | 1 +
 block/nbd.c                      | 1 +
 block/nvme.c                     | 3 +++
 block/qcow2-bitmap.c             | 1 +
 block/qcow2.c                    | 2 ++
 block/qed.c                      | 1 +
 block/snapshot.c                 | 2 ++
 block/vdi.c                      | 1 +
 block/vmdk.c                     | 1 +
 hw/block/virtio-blk.c            | 1 +
 hw/core/loader-fit.c             | 2 ++
 hw/core/qdev-properties-system.c | 1 +
 hw/misc/ivshmem.c                | 1 +
 hw/scsi/vhost-scsi.c             | 1 +
 hw/vfio/ap.c                     | 1 +
 hw/vfio/container.c              | 1 +
 hw/vfio/helpers.c                | 3 +++
 hw/vfio/iommufd.c                | 1 +
 hw/vfio/pci-quirks.c             | 2 ++
 hw/vfio/pci.c                    | 2 ++
 hw/vfio/platform.c               | 1 +
 hw/virtio/vhost-vsock.c          | 1 +
 hw/virtio/vhost.c                | 2 ++
 include/qapi/error.h             | 2 +-
 migration/options.c              | 2 ++
 net/vhost-vdpa.c                 | 1 +
 target/s390x/cpu_models.c        | 2 ++
 29 files changed, 44 insertions(+), 1 deletion(-)

-- 
2.34.1
Re: [PATCH v2 00/29] Cleanup up to fix missing ERRP_GUARD() for error_prepend()
Posted by Philippe Mathieu-Daudé 1 month, 2 weeks ago
On 11/3/24 04:37, Zhao Liu wrote:

> ---
> Zhao Liu (29):

>    hw/core/loader-fit: Fix missing ERRP_GUARD() for error_prepend()
>    hw/core/qdev-properties-system: Fix missing ERRP_GUARD() for
>      error_prepend()
>    hw/misc/ivshmem: Fix missing ERRP_GUARD() for error_prepend()

I'm queuing these 3 patches, thanks!
Re: [PATCH v2 00/29] Cleanup up to fix missing ERRP_GUARD() for error_prepend()
Posted by Zhao Liu 1 month, 2 weeks ago
Hi Thomas/Markus/Michael,

For the remaing patches, could you please help me merge them next?

Many thanks!
Zhao

On Tue, Mar 12, 2024 at 09:17:30AM +0100, Philippe Mathieu-Daudé wrote:
> Date: Tue, 12 Mar 2024 09:17:30 +0100
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: Re: [PATCH v2 00/29] Cleanup up to fix missing ERRP_GUARD() for
>  error_prepend()
> 
> On 11/3/24 04:37, Zhao Liu wrote:
> 
> > ---
> > Zhao Liu (29):
> 
> >    hw/core/loader-fit: Fix missing ERRP_GUARD() for error_prepend()
> >    hw/core/qdev-properties-system: Fix missing ERRP_GUARD() for
> >      error_prepend()
> >    hw/misc/ivshmem: Fix missing ERRP_GUARD() for error_prepend()
> 
> I'm queuing these 3 patches, thanks!
Re: [PATCH v2 00/29] Cleanup up to fix missing ERRP_GUARD() for error_prepend()
Posted by Thomas Huth 1 month, 2 weeks ago
On 12/03/2024 09.43, Zhao Liu wrote:
> Hi Thomas/Markus/Michael,
> 
> For the remaing patches, could you please help me merge them next?
> 
> Many thanks!

Yes, I'm currently reviewing the ones that don't have a Reviewed-by yet. I 
can pick up the remaining patches if the other maintainers won't pick them 
up for the softfreeze today.

  Thomas


> On Tue, Mar 12, 2024 at 09:17:30AM +0100, Philippe Mathieu-Daudé wrote:
>> Date: Tue, 12 Mar 2024 09:17:30 +0100
>> From: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Subject: Re: [PATCH v2 00/29] Cleanup up to fix missing ERRP_GUARD() for
>>   error_prepend()
>>
>> On 11/3/24 04:37, Zhao Liu wrote:
>>
>>> ---
>>> Zhao Liu (29):
>>
>>>     hw/core/loader-fit: Fix missing ERRP_GUARD() for error_prepend()
>>>     hw/core/qdev-properties-system: Fix missing ERRP_GUARD() for
>>>       error_prepend()
>>>     hw/misc/ivshmem: Fix missing ERRP_GUARD() for error_prepend()
>>
>> I'm queuing these 3 patches, thanks!
> 
> 
> 


Re: [PATCH v2 00/29] Cleanup up to fix missing ERRP_GUARD() for error_prepend()
Posted by Zhao Liu 1 month, 2 weeks ago
On Tue, Mar 12, 2024 at 09:50:25AM +0100, Thomas Huth wrote:
> Date: Tue, 12 Mar 2024 09:50:25 +0100
> From: Thomas Huth <thuth@redhat.com>
> Subject: Re: [PATCH v2 00/29] Cleanup up to fix missing ERRP_GUARD() for
>  error_prepend()
> 
> On 12/03/2024 09.43, Zhao Liu wrote:
> > Hi Thomas/Markus/Michael,
> > 
> > For the remaing patches, could you please help me merge them next?
> > 
> > Many thanks!
> 
> Yes, I'm currently reviewing the ones that don't have a Reviewed-by yet. I
> can pick up the remaining patches if the other maintainers won't pick them
> up for the softfreeze today.
> 

Appreciate that you can help me get on the last train of releases.

If possible, could you please also help me pick up two other ERRP_GUARD()
related cleanups (total 8 patches, both got r/b)? ;-)

My cleanup is too fragmented, I'll try to centralize my work to make it easier
for maintainer to review and merge in the future!

[1]: https://lore.kernel.org/qemu-devel/20240223085653.1255438-1-zhao1.liu@linux.intel.com/
[2]: https://lore.kernel.org/qemu-devel/20240312060337.3240965-1-zhao1.liu@linux.intel.com/

Many thanks,
Zhao
Re: [PATCH v2 00/29] Cleanup up to fix missing ERRP_GUARD() for error_prepend()
Posted by Thomas Huth 1 month, 2 weeks ago
On 12/03/2024 11.26, Zhao Liu wrote:
> On Tue, Mar 12, 2024 at 09:50:25AM +0100, Thomas Huth wrote:
>> Date: Tue, 12 Mar 2024 09:50:25 +0100
>> From: Thomas Huth <thuth@redhat.com>
>> Subject: Re: [PATCH v2 00/29] Cleanup up to fix missing ERRP_GUARD() for
>>   error_prepend()
>>
>> On 12/03/2024 09.43, Zhao Liu wrote:
>>> Hi Thomas/Markus/Michael,
>>>
>>> For the remaing patches, could you please help me merge them next?
>>>
>>> Many thanks!
>>
>> Yes, I'm currently reviewing the ones that don't have a Reviewed-by yet. I
>> can pick up the remaining patches if the other maintainers won't pick them
>> up for the softfreeze today.
>>
> 
> Appreciate that you can help me get on the last train of releases.
> 
> If possible, could you please also help me pick up two other ERRP_GUARD()
> related cleanups (total 8 patches, both got r/b)? ;-)
> 
> My cleanup is too fragmented, I'll try to centralize my work to make it easier
> for maintainer to review and merge in the future!
> 
> [1]: https://lore.kernel.org/qemu-devel/20240223085653.1255438-1-zhao1.liu@linux.intel.com/
> [2]: https://lore.kernel.org/qemu-devel/20240312060337.3240965-1-zhao1.liu@linux.intel.com/

I'll try to include them!

  Thomas