mirror of https://gitee.com/openkylin/qemu.git
hw/intc/s390: Simplify error handling in kvm_s390_flic_realize()
Cc: Halil Pasic <pasic@linux.ibm.com> Cc: Cornelia Huck <cohuck@redhat.com> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Acked-by: Halil Pasic <pasic@linux.ibm.com> Message-Id: <20191204093625.14836-18-armbru@redhat.com>
This commit is contained in:
parent
8ca63ba8c2
commit
d402c98396
|
@ -586,16 +586,17 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
KVM_S390_FLIC_GET_CLASS(dev)->parent_realize(dev, &err);
|
||||
if (err) {
|
||||
goto fail;
|
||||
error_propagate(errp, err);
|
||||
return;
|
||||
}
|
||||
flic_state->fd = -1;
|
||||
|
||||
cd.type = KVM_DEV_TYPE_FLIC;
|
||||
ret = kvm_vm_ioctl(kvm_state, KVM_CREATE_DEVICE, &cd);
|
||||
if (ret < 0) {
|
||||
error_setg_errno(&err, errno, "Creating the KVM device failed");
|
||||
error_setg_errno(errp, errno, "Creating the KVM device failed");
|
||||
trace_flic_create_device(errno);
|
||||
goto fail;
|
||||
return;
|
||||
}
|
||||
flic_state->fd = cd.fd;
|
||||
|
||||
|
@ -603,9 +604,6 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp)
|
|||
test_attr.group = KVM_DEV_FLIC_CLEAR_IO_IRQ;
|
||||
flic_state->clear_io_supported = !ioctl(flic_state->fd,
|
||||
KVM_HAS_DEVICE_ATTR, test_attr);
|
||||
return;
|
||||
fail:
|
||||
error_propagate(errp, err);
|
||||
}
|
||||
|
||||
static void kvm_s390_flic_reset(DeviceState *dev)
|
||||
|
|
Loading…
Reference in New Issue