qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v15 2/2] sPAPR: Implement sPAPRPHBClass::eeh_han


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH v15 2/2] sPAPR: Implement sPAPRPHBClass::eeh_handler
Date: Wed, 04 Feb 2015 14:42:00 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0


On 14.01.15 02:41, David Gibson wrote:
> On Mon, Jan 05, 2015 at 11:26:28AM +1100, Gavin Shan wrote:
>> The patch implements sPAPRPHBClass::eeh_handler so that the
>> EEH RTAS requests can be routed to VFIO for further handling.
>>
>> Signed-off-by: Gavin Shan <address@hidden>
>> ---
>>  hw/ppc/spapr_pci_vfio.c | 56 
>> +++++++++++++++++++++++++++++++++++++++++++++++++
>>  hw/vfio/common.c        |  1 +
>>  2 files changed, 57 insertions(+)
>>
>> diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c
>> index 144912b..73652a9 100644
>> --- a/hw/ppc/spapr_pci_vfio.c
>> +++ b/hw/ppc/spapr_pci_vfio.c
>> @@ -71,6 +71,61 @@ static void spapr_phb_vfio_finish_realize(sPAPRPHBState 
>> *sphb, Error **errp)
>>                                  spapr_tce_get_iommu(tcet));
>>  }
>>  
>> +static int spapr_phb_vfio_eeh_handler(sPAPRPHBState *sphb, int req, int opt)
>> +{
>> +    sPAPRPHBVFIOState *svphb = SPAPR_PCI_VFIO_HOST_BRIDGE(sphb);
>> +    struct vfio_eeh_pe_op op = { .argsz = sizeof(op) };
> 
> This is a local variable, which means it won't be initialized.  You
> never memset() it and it's not obvious that all fields get
> initialized, which makes it dangerous to pass to an ioctl().

As far as I understand C, in the construct above all unmentioned fields
actually do get initialized to 0.


Alex



reply via email to

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