qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [PATCH v3 1/9] hw: eliminate qdev_try_new, isa_try_new & usb_try_new
Date: Fri, 15 Nov 2024 12:54:10 -0500	[thread overview]
Message-ID: <ZzeKwvuYPRfjaP-X@x1n> (raw)
In-Reply-To: <20241115172521.504102-2-berrange@redhat.com>

On Fri, Nov 15, 2024 at 05:25:13PM +0000, Daniel P. Berrangé wrote:
> diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
> index 40b2567aa7..558f17d3ba 100644
> --- a/hw/s390x/s390-pci-bus.c
> +++ b/hw/s390x/s390-pci-bus.c
> @@ -922,11 +922,7 @@ static S390PCIBusDevice *s390_pci_device_new(S390pciState *s,
>      Error *local_err = NULL;
>      DeviceState *dev;
>  
> -    dev = qdev_try_new(TYPE_S390_PCI_DEVICE);
> -    if (!dev) {
> -        error_setg(errp, "zPCI device could not be created");
> -        return NULL;
> -    }
> +    dev = qdev_new(TYPE_S390_PCI_DEVICE);

This one used to allow failures, but now it asserts.  Especially, see:

b6e67ecc7b ("s390x/pci: properly fail if the zPCI device cannot be created")

Would it be safer to use module_object_class_by_name() too here?

All the rest changes look sane.

>  
>      if (!object_property_set_str(OBJECT(dev), "target", target, &local_err)) {
>          object_unparent(OBJECT(dev));

-- 
Peter Xu



  reply	other threads:[~2024-11-15 17:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-15 17:25 [PATCH v3 0/9] Require error handling for dynamically created objects Daniel P. Berrangé
2024-11-15 17:25 ` [PATCH v3 1/9] hw: eliminate qdev_try_new, isa_try_new & usb_try_new Daniel P. Berrangé
2024-11-15 17:54   ` Peter Xu [this message]
2024-11-15 18:34     ` Daniel P. Berrangé
2024-12-03 15:30   ` Markus Armbruster
2024-12-05 16:21     ` Daniel P. Berrangé
2024-11-15 17:25 ` [PATCH v3 2/9] qom: refactor checking abstract property when creating instances Daniel P. Berrangé
2024-11-15 17:54   ` Peter Xu
2024-11-15 17:25 ` [PATCH v3 3/9] qom: allow failure of object_new_with_class Daniel P. Berrangé
2024-11-15 17:25 ` [PATCH v3 4/9] qom: introduce object_new_dynamic() Daniel P. Berrangé
2024-11-15 17:25 ` [PATCH v3 5/9] convert code to object_new_dynamic() where appropriate Daniel P. Berrangé
2024-11-15 17:25 ` [PATCH v3 6/9] qom: enforce use of static, const string with object_new() Daniel P. Berrangé
2024-11-15 17:25 ` [PATCH v3 7/9] qom: introduce qdev_new_dynamic() Daniel P. Berrangé
2024-11-15 17:55   ` Peter Xu
2024-11-15 17:25 ` [PATCH v3 8/9] convert code to qdev_new_dynamic() where appropriate Daniel P. Berrangé
2024-11-15 17:25 ` [PATCH v3 9/9] hw: enforce use of static, const string with qdev_new() Daniel P. Berrangé
2024-11-15 17:55   ` Peter Xu
2024-12-04 11:07 ` [PATCH v3 0/9] Require error handling for dynamically created objects Markus Armbruster
2024-12-05 16:04   ` Daniel P. Berrangé
2024-12-06  8:25     ` Markus Armbruster
2024-12-06 10:57       ` Daniel P. Berrangé
2024-12-07  7:37         ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZzeKwvuYPRfjaP-X@x1n \
    --to=peterx@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).