[Top][All Lists]

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

Re: [Qemu-devel] [PATCH 1/4] qdev: add return value to init() callbacks.

From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 1/4] qdev: add return value to init() callbacks.
Date: Fri, 21 Aug 2009 18:16:40 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

Gerd Hoffmann <address@hidden> writes:

> Sorry folks, but it has to be.  One more of these invasive qdev patches.
> We have a serious design bug in the qdev interface:  device init
> callbacks can't signal failure because the init() callback has no
> return value.  This patch fixes it.
> We have already one case in-tree where this is needed:
> Try -device virtio-blk-pci (without drive= specified) and watch qemu
> segfault.  This patch fixes it.
> With usb+scsi being converted to qdev we'll get more devices where the
> init callback can fail for various reasons.
> Signed-off-by: Gerd Hoffmann <address@hidden>

Trivial rediff of the previous patch, for which I verified that we

* change a function returning void to return int instead, or

* insert return 0 at the end of a function, or

* change F() to return F(), for some F() that now returns int, or

* insert return -1 instead of continuing to a crash, in
  virtio_blk_init_pci(), or

* handle a failed device init(), in qdev_device_add().

Acked-by: Markus Armbruster <address@hidden>

reply via email to

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