From nobody Wed May 14 17:07:47 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152228465795264.6359821229047; Wed, 28 Mar 2018 17:50:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4AD8E8124D; Thu, 29 Mar 2018 00:50:56 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1C39960240; Thu, 29 Mar 2018 00:50:56 +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 DCDDB4CA9F; Thu, 29 Mar 2018 00:50:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2T0oVp9012607 for ; Wed, 28 Mar 2018 20:50:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2208684438; Thu, 29 Mar 2018 00:50:31 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD4B28442E for ; Thu, 29 Mar 2018 00:50:30 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 29 Mar 2018 02:50:18 +0200 Message-Id: <7100dc13278c355a2475a93753e859d6459720b7.1522284415.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/8] virQEMUCapsParseHelpStr: remove unused check_yajl parameter 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 29 Mar 2018 00:50:56 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Commit 6e769eba in Jan 2012 added an error message when using qemu 0.15 and newer with libvirt without JSON support. However commit 3399875 (July 2012) added the 'check_yajl' parameter to perform this check only on domain startup and commit 15ee6614 in Sep 2012 removed this last caller passing 'true' to this function. Remove the dead code. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 24 ++++-------------------- src/qemu/qemu_capspriv.h | 1 - tests/qemuhelptest.c | 2 +- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e54dde69a..73527820a 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1257,8 +1257,7 @@ virQEMUCapsInit(virFileCachePtr cache) static int virQEMUCapsComputeCmdFlags(const char *help, unsigned int version, - virQEMUCapsPtr qemuCaps, - bool check_yajl ATTRIBUTE_UNUSED) + virQEMUCapsPtr qemuCaps) { const char *p; const char *fsdev, *netdev; @@ -1391,21 +1390,9 @@ virQEMUCapsComputeCmdFlags(const char *help, #else /* Starting with qemu 0.15 and newer, upstream qemu no longer * promises to keep the human interface stable, but requests that - * we use QMP (the JSON interface) for everything. If the user - * forgot to include YAJL libraries when building their own - * libvirt but is targeting a newer qemu, we are better off - * telling them to recompile (the spec file includes the - * dependency, so distros won't hit this). This check is - * also in m4/virt-yajl.m4 (see $with_yajl). */ - if (version >=3D 15000) { - if (check_yajl) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("this qemu binary requires libvirt to be " - "compiled with yajl")); - return -1; - } + * we use QMP (the JSON interface) for everything. */ + if (version >=3D 15000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_NETDEV); - } #endif =20 if (version >=3D 13000) @@ -1449,7 +1436,6 @@ int virQEMUCapsParseHelpStr(const char *qemu, unsigned int *version, bool *is_kvm, unsigned int *kvm_version, - bool check_yajl, const char *qmperr) { unsigned major, minor, micro; @@ -1530,8 +1516,7 @@ int virQEMUCapsParseHelpStr(const char *qemu, goto cleanup; } =20 - if (virQEMUCapsComputeCmdFlags(help, *version, - qemuCaps, check_yajl) < 0) + if (virQEMUCapsComputeCmdFlags(help, *version, qemuCaps) < 0) goto cleanup; =20 strflags =3D virBitmapToString(qemuCaps->flags, true, false); @@ -4432,7 +4417,6 @@ virQEMUCapsInitHelp(virQEMUCapsPtr qemuCaps, uid_t ru= nUid, gid_t runGid, const c &qemuCaps->version, &is_kvm, &qemuCaps->kvmVersion, - false, qmperr) < 0) goto cleanup; =20 diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h index 222f3368e..979816240 100644 --- a/src/qemu/qemu_capspriv.h +++ b/src/qemu/qemu_capspriv.h @@ -93,7 +93,6 @@ virQEMUCapsParseHelpStr(const char *qemu, unsigned int *version, bool *is_kvm, unsigned int *kvm_version, - bool check_yajl, const char *qmperr); =20 int diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index 1336eeef5..84f18c039 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -59,7 +59,7 @@ static int testHelpStrParsing(const void *data) goto cleanup; =20 if (virQEMUCapsParseHelpStr("QEMU", help, flags, - &version, &is_kvm, &kvm_version, false, NU= LL) =3D=3D -1) { + &version, &is_kvm, &kvm_version, NULL) =3D= =3D -1) { virErrorPtr err =3D virGetLastError(); =20 if (info->error && err && err->code =3D=3D info->error) --=20 2.16.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list