On Fri, Nov 15, 2024 at 12:54:10PM -0500, Peter Xu wrote:
> 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?

Yes, my bad. I was mixed up with the HPET case which did exit(), this
one must propagate the error.


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Reply via email to