From nobody Wed May 15 14:11:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1648718702; cv=none; d=zohomail.com; s=zohoarc; b=NmFDVB6o2p+DgYK7p4IQLuq5JXAxLOw5/7G1GFBcW2YRV4qdZOlUNqcc6BI8jy4QI1qYewUxnwUYasZpRfjd8q6x7V0tqQhRMZ2XoHyPd7trPky/9W6KV089Ws2zDN5aKcPOWJIbuh7bpKuTYuxf+gPz5EwHeGwctnZ6gWDMOpw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648718702; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HbqAkQSC59we0/sVWr2AjQiL0AbE1R+z14igGB2Q8hU=; b=gEh/LP+qimLEEgJKRxam0OElARXGxE/ezrfV8/uL3o6/+EXQ4SE/gXIZneZcre2jE8li/Ir52Krw4SCGAsgdSnFL6XFYx3KSGnhPFJM6i1fR43z2Qs3aXhZG3k23H+/lOQzQQ252tnAiDFkgpA+V4XgCMYamsAhrr6GQ9YROTkw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1648718702762786.5812766175436; Thu, 31 Mar 2022 02:25:02 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-634-RnVPT4OqPHypCxAJaSX99A-1; Thu, 31 Mar 2022 05:24:15 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7509A1C01509; Thu, 31 Mar 2022 09:24:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61F301454548; Thu, 31 Mar 2022 09:24:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1C09D1940347; Thu, 31 Mar 2022 09:24:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6CA2D19451F3 for ; Thu, 31 Mar 2022 09:24:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 48311432496; Thu, 31 Mar 2022 09:24:10 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.194.137]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9C269432729; Thu, 31 Mar 2022 09:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648718701; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=HbqAkQSC59we0/sVWr2AjQiL0AbE1R+z14igGB2Q8hU=; b=OuFQxzZlLVWtMlg2P6Rxh0QgqSJh5z7gvVIlnQ6JCeRsPaLf9j2wVp6NrhdUMe83T7KfV9 iUv49bjM/gp5E5DqvTO6Pf/BL5B5oUffQGVNEfWiie5I8CrB8n18y/cx9YiMjwvsqT26R0 hR1+JgQq8Eu133+wCfxKmw1OfLlY3H4= X-MC-Unique: RnVPT4OqPHypCxAJaSX99A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 1/3] qemu: Clean up virQEMUCapsFindBinaryForArch() Date: Thu, 31 Mar 2022 11:24:04 +0200 Message-Id: <20220331092406.57540-2-abologna@redhat.com> In-Reply-To: <20220331092406.57540-1-abologna@redhat.com> References: <20220331092406.57540-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1648718703820100002 Content-Type: text/plain; charset="utf-8"; x-default="true" If we get to the bottom of the function we know that none of the attempts to locate a QEMU binary has been successful, so we can simply return NULL directly. This makes it unnecessary variable used to store the path, for which we can use a more descriptive name. Lastly, comparing with NULL explicitly is somewhat uncommon in libvirt and more verbose than the equivalent implicit comparison, so get rid of it. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 6b4ed08499..68edf94ba5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -919,7 +919,7 @@ static char * virQEMUCapsFindBinaryForArch(virArch hostarch, virArch guestarch) { - char *ret =3D NULL; + char *binary; const char *archstr; virArch target; =20 @@ -928,24 +928,24 @@ virQEMUCapsFindBinaryForArch(virArch hostarch, * to avoid using qemu-system-arm (and thus TCG) instead */ if (hostarch =3D=3D VIR_ARCH_AARCH64 && guestarch =3D=3D VIR_ARCH_ARMV= 7L) { archstr =3D virQEMUCapsArchToString(hostarch); - if ((ret =3D virQEMUCapsFindBinary("qemu-system-%s", archstr)) != =3D NULL) - return ret; + if ((binary =3D virQEMUCapsFindBinary("qemu-system-%s", archstr))) + return binary; } =20 /* First attempt: try the guest architecture as it is */ archstr =3D virQEMUCapsArchToString(guestarch); - if ((ret =3D virQEMUCapsFindBinary("qemu-system-%s", archstr)) !=3D NU= LL) - return ret; + if ((binary =3D virQEMUCapsFindBinary("qemu-system-%s", archstr))) + return binary; =20 /* Second attempt: try looking up by target instead */ target =3D virQEMUCapsFindTarget(hostarch, guestarch); if (target !=3D guestarch) { archstr =3D virQEMUCapsArchToString(target); - if ((ret =3D virQEMUCapsFindBinary("qemu-system-%s", archstr)) != =3D NULL) - return ret; + if ((binary =3D virQEMUCapsFindBinary("qemu-system-%s", archstr))) + return binary; } =20 - return ret; + return NULL; } =20 =20 --=20 2.35.1 From nobody Wed May 15 14:11:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1648718703; cv=none; d=zohomail.com; s=zohoarc; b=HtOGfm8BpNPgboXFTz+7oB2FO5VgA7cNLTWnzfEKf1rOsC8/ywcm0nqJ3qBPxxGSEua8cPRXAuuQunGD30tkizVqlW/kcU6hi9J3IOHLCklwXmSnD9VPcUCQB2seiKaRVEh3Er3l1VmnFXMFrf3ncr82jiNTZUxzk4o/hkLlh5k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648718703; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=i2+1acnP2NO1/UjMfPI4yyqRLcCedzlRwHNNeX0JDY4=; b=ADZbWJBzL5Z+WgFsGqCMtBwxc+0XpEyFiDch7+iBPlEgqObIGIxMujuWAdNfhh6EMJTtZUeqNQ80Yyy3Pgd/1ngwb8iq2M0R5Z4y4YyYc11Yt2xPZtROPjefwel9+EtPH43iLp++IdB5OzAlOnN/PDscCJrNRXtgwXOVNc0QH68= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1648718703403972.7013885749824; Thu, 31 Mar 2022 02:25:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-310-ghdNcUciPLiI6iwTquXodg-1; Thu, 31 Mar 2022 05:24:15 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 74EB180B71C; Thu, 31 Mar 2022 09:24:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 615C353D0; Thu, 31 Mar 2022 09:24:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 42908194034E; Thu, 31 Mar 2022 09:24:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 566841940345 for ; Thu, 31 Mar 2022 09:24:11 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 42A6D464DF8; Thu, 31 Mar 2022 09:24:11 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.194.137]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 96874432496; Thu, 31 Mar 2022 09:24:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648718702; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=i2+1acnP2NO1/UjMfPI4yyqRLcCedzlRwHNNeX0JDY4=; b=YfMErqViUOOOznK5dFV2MDP8DUfTfDFpM1Q8tFUKTqKfYex1R6YxkptiM4GoAMM5rSnmdj /WLY0eB3c3I1wu9awcfTZ6cg4K/J7agqABNTn0H9qQpiCeq8jZaoF3JrA7WHoLkyR3T6GT O3+sKdYZ2Wj+fTkUGgxo9GBnWkl7ezM= X-MC-Unique: ghdNcUciPLiI6iwTquXodg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 2/3] qemu: Don't assume that /usr/libexec/qemu-kvm exists Date: Thu, 31 Mar 2022 11:24:05 +0200 Message-Id: <20220331092406.57540-3-abologna@redhat.com> In-Reply-To: <20220331092406.57540-1-abologna@redhat.com> References: <20220331092406.57540-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1648718703819100001 Content-Type: text/plain; charset="utf-8"; x-default="true" On a machine where no QEMU binary is installed, we end up logging libvirtd: Cannot check QEMU binary /usr/libexec/qemu-kvm: No such file or directory which is not very useful in general, and downright misleading in the case of operating systems that are not derived from RHEL. This is a consequence of treating that specific path in a different way from all other possible QEMU binary paths, and specifically of not checking whether the file actually exists but sort of assuming that it must do if we haven't found another QEMU binary earlier. Address the issue by trying this path out in virQEMUCapsFindBinaryForArch(), along with all the other possible ones, and making sure it exists before returning it. Reported-by: Jim Fehlig Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 68edf94ba5..41e9a3a3f5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -945,6 +945,13 @@ virQEMUCapsFindBinaryForArch(virArch hostarch, return binary; } =20 + /* RHEL doesn't follow the usual naming for QEMU binaries and ships + * a single binary named qemu-kvm outside of $PATH instead */ + if (virQEMUCapsGuestIsNative(hostarch, guestarch)) { + if ((binary =3D virFindFileInPath("/usr/libexec/qemu-kvm"))) + return binary; + } + return NULL; } =20 @@ -953,18 +960,7 @@ char * virQEMUCapsGetDefaultEmulator(virArch hostarch, virArch guestarch) { - char *binary =3D NULL; - /* Check for existence of base emulator, or alternate base - * which can be used with magic cpu choice - */ - binary =3D virQEMUCapsFindBinaryForArch(hostarch, guestarch); - - /* RHEL doesn't follow the usual naming for QEMU binaries and ships - * a single binary named qemu-kvm outside of $PATH instead */ - if (virQEMUCapsGuestIsNative(hostarch, guestarch) && !binary) - binary =3D g_strdup("/usr/libexec/qemu-kvm"); - - return binary; + return virQEMUCapsFindBinaryForArch(hostarch, guestarch); } =20 =20 --=20 2.35.1 From nobody Wed May 15 14:11:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1648718661; cv=none; d=zohomail.com; s=zohoarc; b=Z92cTd8a5zXDlewKtk+LkiBIm1QBwGk1GAmswL74x5/WGdwo5QsR+raR5xSwyFfKlFzNF+oWpvYUEQske5Ztiak9YShdgQeaGAHsmTm7HV1xtIwsVGEHl3A9ZiGbIhchP21jUwGjKuF5BPWru97yMEgyvCv1J4+VfmCvxpD2yM4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648718661; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QJWAWV/pf+FU7Mb4LUlTCo54/DRxV9zPLhZusSbFU4Y=; b=SRXsTE80rbMNQbsmyY0IBa+Q2OyNPlhXoWJKlqyxc/zSZkJg8pJr3G4jx7FzGpZg+D29uAMJi5aDYZoOTgQDrf/qmWYtr/O/qMaNbx+O5VeeldxKCGNVX2lJjhdI/PhVTbJd5Qg0CFty31dXYydfQo0u825QDvD+53fOVFEcuy8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1648718661553234.24740738174899; Thu, 31 Mar 2022 02:24:21 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-282-VmjbuqTJM0SFtH6Hp4KViw-1; Thu, 31 Mar 2022 05:24:19 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EC0A6805F6C; Thu, 31 Mar 2022 09:24:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B5EA40CFD02; Thu, 31 Mar 2022 09:24:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B4E891940341; Thu, 31 Mar 2022 09:24:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4E0481940351 for ; Thu, 31 Mar 2022 09:24:12 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3E424441961; Thu, 31 Mar 2022 09:24:12 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.194.137]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9210F42B93B; Thu, 31 Mar 2022 09:24:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648718660; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=QJWAWV/pf+FU7Mb4LUlTCo54/DRxV9zPLhZusSbFU4Y=; b=hmWaWNjlUm0DaXT/Odpfp/zprMbi4KAlIcyecrbLsiA0ppVrWnCFsZF8mF859RNBWV8BfK jgcUwjISt4Vb5m3xjygmE6EDLgKSK3V+Q/BuJS/TELBo1kjBucBogdNg1GFJ8YqrHoa6b6 reE7XUMb7eO8+77W4FcbfvQRVqIj3ng= X-MC-Unique: VmjbuqTJM0SFtH6Hp4KViw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 3/3] qemu: Dissolve virQEMUCapsFindBinaryForArch() Date: Thu, 31 Mar 2022 11:24:06 +0200 Message-Id: <20220331092406.57540-4-abologna@redhat.com> In-Reply-To: <20220331092406.57540-1-abologna@redhat.com> References: <20220331092406.57540-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1648718663173100001 Content-Type: text/plain; charset="utf-8"; x-default="true" With the recent changes, virQEMUCapsGetDefaultEmulator() has become a trivial wrapper around this function, as well as its only caller. Clean up the situation by merging the two. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 41e9a3a3f5..25d029d0cc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -915,9 +915,9 @@ virQEMUCapsFindBinary(const char *format, return ret; } =20 -static char * -virQEMUCapsFindBinaryForArch(virArch hostarch, - virArch guestarch) +char * +virQEMUCapsGetDefaultEmulator(virArch hostarch, + virArch guestarch) { char *binary; const char *archstr; @@ -956,14 +956,6 @@ virQEMUCapsFindBinaryForArch(virArch hostarch, } =20 =20 -char * -virQEMUCapsGetDefaultEmulator(virArch hostarch, - virArch guestarch) -{ - return virQEMUCapsFindBinaryForArch(hostarch, guestarch); -} - - static int virQEMUCapsInitGuest(virCaps *caps, virFileCache *cache, --=20 2.35.1