From nobody Wed May 14 10:24:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1525343713672665.5039924400645; Thu, 3 May 2018 03:35:13 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7B1653113C8C; Thu, 3 May 2018 10:35:12 +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 45DD09C0D8; Thu, 3 May 2018 10:35:12 +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 DA669180BAD5; Thu, 3 May 2018 10:35:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w43AZ8Nw016147 for ; Thu, 3 May 2018 06:35:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8F7282024CA2; Thu, 3 May 2018 10:35:08 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3334B2024CA1 for ; Thu, 3 May 2018 10:35:08 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 3 May 2018 12:35:02 +0200 Message-Id: <247b4729c2138e0a895d189d940e838f10953454.1525343629.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/5] qemu: remove qemuBuildObsoleteAccelArg 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 03 May 2018 10:35:13 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Since we started assuming QEMU_CAPS_MACHINE_OPT in commit <69420756>, this function can only be reached for unsupported virt types. Replace the call with a virReportError. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 61 +++++++--------------------------------------= ---- 1 file changed, 8 insertions(+), 53 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 418729b988..80135ee498 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6894,50 +6894,6 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, } =20 =20 -static int -qemuBuildObsoleteAccelArg(virCommandPtr cmd, - const virDomainDef *def, - virQEMUCapsPtr qemuCaps) -{ - bool disableKVM =3D false; - bool enableKVM =3D false; - - switch ((int)def->virtType) { - case VIR_DOMAIN_VIRT_QEMU: - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) - disableKVM =3D true; - break; - - case VIR_DOMAIN_VIRT_KQEMU: - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("the QEMU binary does not support kqemu")); - break; - - case VIR_DOMAIN_VIRT_KVM: - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ENABLE_KVM)) { - enableKVM =3D true; - } else if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("the QEMU binary does not support kvm")); - return -1; - } - break; - - default: - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("the QEMU binary does not support %s"), - virDomainVirtTypeToString(def->virtType)); - return -1; - } - - if (disableKVM) - virCommandAddArg(cmd, "-no-kvm"); - if (enableKVM) - virCommandAddArg(cmd, "-enable-kvm"); - - return 0; -} - static bool qemuAppendKeyWrapMachineParm(virBuffer *buf, virQEMUCapsPtr qemuCaps, int flag, const char *pname, int pstate) @@ -7036,7 +6992,6 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, virTristateSwitch smm =3D def->features[VIR_DOMAIN_FEATURE_SMM]; virCPUDefPtr cpu =3D def->cpu; virBuffer buf =3D VIR_BUFFER_INITIALIZER; - bool obsoleteAccel =3D false; size_t i; int ret =3D -1; =20 @@ -7050,12 +7005,16 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, virCommandAddArg(cmd, "-machine"); virBufferAdd(&buf, def->os.machine, -1); =20 - if (def->virtType =3D=3D VIR_DOMAIN_VIRT_QEMU) + if (def->virtType =3D=3D VIR_DOMAIN_VIRT_QEMU) { virBufferAddLit(&buf, ",accel=3Dtcg"); - else if (def->virtType =3D=3D VIR_DOMAIN_VIRT_KVM) + } else if (def->virtType =3D=3D VIR_DOMAIN_VIRT_KVM) { virBufferAddLit(&buf, ",accel=3Dkvm"); - else - obsoleteAccel =3D true; + } else { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("the QEMU binary does not support %s"), + virDomainVirtTypeToString(def->virtType)); + return -1; + } =20 /* To avoid the collision of creating USB controllers when calling * machine->init in QEMU, it needs to set usb=3Doff @@ -7235,10 +7194,6 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, =20 virCommandAddArgBuffer(cmd, &buf); =20 - if (obsoleteAccel && - qemuBuildObsoleteAccelArg(cmd, def, qemuCaps) < 0) - goto cleanup; - ret =3D 0; cleanup: virBufferFreeAndReset(&buf); --=20 2.16.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list