From patchwork Mon Dec 9 18:14:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 181084 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4695211ile; Mon, 9 Dec 2019 10:13:18 -0800 (PST) X-Google-Smtp-Source: APXvYqwpy//6Pedjl7pdHxcRbQGyfbwPz1li131WtceOfpmkThpTxQCSlBi60gU0ZvnW6msIIFWs X-Received: by 2002:a37:8e44:: with SMTP id q65mr19027946qkd.70.1575915198717; Mon, 09 Dec 2019 10:13:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575915198; cv=none; d=google.com; s=arc-20160816; b=O7P5XJADvpE/Rl/c4yRFp67qwUUnlPU+0WvEXRMYOzXxPMhD+reIvK+akbEqCxATpG WGGFbIPRj4BDSA0gs0uc8Irw1aH3skMI6cWcu50PWEv+0k//SUEivakUxnetmEQcUMVn szR1ANKSCfuDcb8irnrK3jJYvVOK7e0ldeO9b+8jKKZG8kWswU8vUgIZAfwjsYLeR+kg k3S/WFtfHdZV13imOEiZU1qbMIuIcVCQSKkSak946rbTrSom2P329YJ9UHUR6UOhy6/f PMsJ+TzX/Nb60+GSyJssZXht4xnQO5O7MaWD4aYSawBx/utJSJBjmWPgjbvBsFON5YuE 2bsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:errors-to:sender:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:delivered-to:dkim-signature; bh=PRr/WPBfRfH9VHauFr4gK/f1iVsZhviQU5Rn1QgDquY=; b=pumbI/U4uZr17JaXWiKEDxDtB7O4bTpXEWyUvZ0zydQLw37jMWtI7q2QPK5gSQKgSj gE+kRqcmyz0lqxl5VJlvoqQYkxy+CnNFSDbeRkfM3KlNojXtOqD7Cp9EwLpNIbNK2m85 0iSU5FftZSkBub0YzvgGkvq6hzC1jJnFX+Y937pjYQjWwoaYUmLtNsF7DmSP9loyoQqM /Zc4P0ookUxoiyREKYgVeH8YoVTazLYafAZup0sc0yejM+HN6t2KTYka0LgBByZHAZlO XrL0ISlZ87rCqIjBqAXDHpzkOmXqvVQDiUoSnWaQ08jIgEilPWGAXciEPoiYHTnuiG2k GzSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=izKbXosW; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com. [207.211.31.120]) by mx.google.com with ESMTPS id j4si365449qtq.307.2019.12.09.10.13.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Dec 2019 10:13:18 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=izKbXosW; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575915198; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=PRr/WPBfRfH9VHauFr4gK/f1iVsZhviQU5Rn1QgDquY=; b=izKbXosWEFcyNl7ZtIVuUjWMlwDR7XIErxmxRuNthIzv90dN2alhZD1a2i89mt+YuJ3P8I VDJYu9+ZacOAAGfif1uVVGjl1VinfBFga1PelTKMc3C6jYhcHNqemL1VJO4SD5z32VquTy Lsu5IEe/fGcAJc76Drg8PwAUvlM7zms= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-331-SlXiYYqJOPe1ajFx2cSNkw-1; Mon, 09 Dec 2019 13:13:16 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 12CC9DBE6; Mon, 9 Dec 2019 18:13:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF3BD6E3F3; Mon, 9 Dec 2019 18:13:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0BFC918033C2; Mon, 9 Dec 2019 18:13:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB9ID6eG020017 for ; Mon, 9 Dec 2019 13:13:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id C31736E3FF; Mon, 9 Dec 2019 18:13:06 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-123-82.rdu2.redhat.com [10.10.123.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65CC06E3F3; Mon, 9 Dec 2019 18:13:03 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Mon, 9 Dec 2019 13:14:26 -0500 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Cole Robinson Subject: [libvirt] [PATCH] qemu: domain: raise an error when no emulator is found X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: SlXiYYqJOPe1ajFx2cSNkw-1 X-Mimecast-Spam-Score: 0 $ cat f | grep -e arch -e emulator hvm $ sudo virsh define f error: Failed to define domain from f error: An error occurred, but the cause is unknown After: $ sudo virsh define f error: Failed to define domain from f error: unsupported configuration: No emulator found for arch 'mipsel' Signed-off-by: Cole Robinson --- src/qemu/qemu_domain.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Daniel P. Berrangé diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index a15364a71e..6f53e17b6a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4687,8 +4687,12 @@ qemuDomainDefPostParseBasic(virDomainDefPtr def, /* check for emulator and create a default one if needed */ if (!def->emulator) { if (!(def->emulator = virQEMUCapsGetDefaultEmulator( - driver->hostarch, def->os.arch))) + driver->hostarch, def->os.arch))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("No emulator found for arch '%s'"), + virArchToString(def->os.arch)); return 1; + } } return 0;