qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1 2/2] virtio-gpu-ccw: Create a virtio gpu devi


From: Thomas Huth
Subject: Re: [Qemu-devel] [PATCH v1 2/2] virtio-gpu-ccw: Create a virtio gpu device for the ccw bus
Date: Wed, 13 Sep 2017 20:22:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 13.09.2017 14:09, David Hildenbrand wrote:
> On 12.09.2017 16:26, Farhan Ali wrote:
>> Wire up the virtio-gpu device for the CCW bus. The virtio-gpu
>> is a virtio-1 device, so disable revision 0.
>>
>> Signed-off-by: Farhan Ali <address@hidden>
>> Acked-by: Christian Borntraeger <address@hidden>
>> ---
>>  hw/s390x/virtio-ccw.c | 54 
>> +++++++++++++++++++++++++++++++++++++++++++++++++++
>>  hw/s390x/virtio-ccw.h | 10 ++++++++++
>>  2 files changed, 64 insertions(+)
>>
>> diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
>> index b1976fd..3078bf0 100644
>> --- a/hw/s390x/virtio-ccw.c
>> +++ b/hw/s390x/virtio-ccw.c
>> @@ -1007,6 +1007,20 @@ static void virtio_ccw_crypto_realize(VirtioCcwDevice 
>> *ccw_dev, Error **errp)
>>                               NULL);
>>  }
>>  
>> +static void virtio_ccw_gpu_realize(VirtioCcwDevice *ccw_dev, Error **errp)
>> +{
>> +    VirtIOGPUCcw *dev = VIRTIO_GPU_CCW(ccw_dev);
>> +    DeviceState *vdev = DEVICE(&dev->vdev);
>> +    Error *err = NULL;
>> +
>> +    qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus));
>> +    object_property_set_bool(OBJECT(vdev), true, "realized", &err);
>> +    if (err) {
>> +        error_propagate(errp, err);
>> +        return;
>> +    }
> 
> You can call error_propagate() unconditionally, it can deal with !err.

I think you even do not need error_propagate here - just pass errp
directly to object_property_set_bool. You exit the function afterwards
anyway.

 Thomas



reply via email to

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