qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] pci: fixed mismatch of error-handling between p


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH] pci: fixed mismatch of error-handling between pci_qdev_init() and qdev
Date: Wed, 5 Nov 2014 15:28:15 +0200

On Wed, Nov 05, 2014 at 02:18:31PM +0100, Paolo Bonzini wrote:
> 
> 
> On 05/11/2014 14:16, Markus Armbruster wrote:
> > "Michael S. Tsirkin" <address@hidden> writes:
> > 
> >> On Wed, Nov 05, 2014 at 07:11:51PM +0900, SeokYeon Hwang wrote:
> >>> pci_qdev_init() checks whether return value is 0 or not to figure
> >>> out pci device is initialized successfully. Otherwise,
> >>> device_realize() in qdev checks that return value is negative value
> >>> to figure out the device is realized successfully.
> >>> When pci device returns positive number, pci_qdev_init() thinks that
> >>> error is occured and makes the device unregistered. Nevertheless,
> >>> qdev thinks that device is realized.
> >>> Finally, crash is occured by commands like 'qtree' that traverse qdev 
> >>> list.
> >>>
> >>> So, pci_qdev_init() returns -1 when init function returns not 0.
> >>>
> >>> Signed-off-by: SeokYeon Hwang <address@hidden>
> >>
> >> Question: is there a simple way to trigger this error?
> > 
> > Next question: what's the contract of PCIDeviceClass method init()?
> > Positive return value feels like bug to me...
> 
> I think bypassing the question by converting to realize makes the most
> sense...
> 
> Paolo

I'm fine with doing that but Markus's patches wouldn't
yet have solved the problem by themselves since init
is still around, right?

This probably means fixing this bug can't justify
merging the realize patchset after freeze.

-- 
MST



reply via email to

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