Re: [PATCH kvmtool 14/18] virtio: Don't ignore initialization failures

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

 



On 14/04/2020 15:39, Alexandru Elisei wrote:
> Don't ignore an error in the bus specific initialization function in
> virtio_init; don't ignore the result of virtio_init; and don't return 0
> in virtio_blk__init and virtio_scsi__init when we encounter an error.
> Hopefully this will save some developer's time debugging faulty virtio
> devices in a guest.
> 
> To take advantage of the cleanup function virtio_blk__exit, move appending
> the new device to the list before the call to virtio_init. Change
> virtio_net__exit to free all allocated net_dev devices on exit, and
> matching what virtio_blk__exit does.
> 
> To safeguard against this in the future, virtio_init has been annoted
> with the compiler attribute warn_unused_result.

Many thanks for doing those changes!

> Signed-off-by: Alexandru Elisei <alexandru.elisei@xxxxxxx>

Reviewed-by: Andre Przywara <andre.przywara@xxxxxxx>

Cheers,
Andre

> ---
>  hw/vesa.c                |  2 +-
>  include/kvm/kvm.h        |  1 +
>  include/kvm/virtio.h     |  7 ++++---
>  include/linux/compiler.h |  2 +-
>  virtio/9p.c              |  9 +++++---
>  virtio/balloon.c         | 10 ++++++---
>  virtio/blk.c             | 14 ++++++++-----
>  virtio/console.c         | 11 +++++++---
>  virtio/core.c            |  9 ++++----
>  virtio/net.c             | 45 ++++++++++++++++++++++++----------------
>  virtio/scsi.c            | 14 ++++++++-----
>  11 files changed, 78 insertions(+), 46 deletions(-)
> 



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux