[libvirt] [PATCH 12/13] qemu_driver: check whether iothread is used by controller
Peter Krempa
pkrempa at redhat.com
Mon Feb 20 16:25:39 UTC 2017
On Fri, Feb 17, 2017 at 15:49:16 +0100, Pavel Hrdina wrote:
> This follows the same check for disk, because we cannot remove iothread
> if it's used by disk or by controller. It could lead to crashing QEMU.
>
> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> ---
> src/qemu/qemu_driver.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 03fea2713d..1c3db4e13f 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -5747,6 +5747,17 @@ qemuDomainDelIOThreadCheck(virDomainDefPtr def,
> }
> }
>
> + for (i = 0; i < def->ncontrollers; i++) {
> + if (def->controllers[i]->iothread == iothread_id) {
> + const char *model = virDomainControllerModelSCSITypeToString(def->controllers[i]->model);
> + virReportError(VIR_ERR_INVALID_ARG,
> + _("cannot remove IOThread '%u' since it "
> + "is being used by controller '%s'"),
> + iothread_id, model);
I'd drop the 'model' variable and appropriate part from the commit
message. Otherwise it may become obsolete once non-SCSI controllers
start to support iothreads.
ACK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170220/1c3ef5c6/attachment-0001.sig>
More information about the libvir-list
mailing list