From nobody Thu May 2 20:34:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1588256111; cv=none; d=zohomail.com; s=zohoarc; b=SlyLyH2TiK/IVYQCRkQF+gDUyf9LEYyFDkH54zPWA52dx+ksXn085K2dwyZS92c/WXnMAl33EcylbKTrzOzdcPRw9wkoTNgAnLbl5tHFy+Ahof49hNAdNHrD5TywYROz22FAdOWELDvvTcfYarsZUJXMKZIIfiQWh6g9WCi9YOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588256111; 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=FLh7ca+ALer394rCFPdJUOyUY182YFE5Qlsz8U1mtXk=; b=lbiC50fWSvUFm9djeYfI7bm+VMj0WcdXmniJqUh/TGRhsMFZTcMjG/IAiOjpCdzxkdcQNtxBUO0sPzoptpC2PGO5DG208WaicmgzBkGbUuYvXeZi0Lezh35jruwPa5QwlP437IKOB9HrEpgG7UGxH186TICirQngpS0neLUPhCg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1588256111454861.2857709130511; Thu, 30 Apr 2020 07:15:11 -0700 (PDT) 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-334-YLxVt81JPHawiN2XR-ABFw-1; Thu, 30 Apr 2020 10:15:06 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C137E1B18BC0; Thu, 30 Apr 2020 14:15:00 +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 934FB10002BC; Thu, 30 Apr 2020 14:15:00 +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 4F020180954D; Thu, 30 Apr 2020 14:14:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03UEDnhf023924 for ; Thu, 30 Apr 2020 10:13:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id ADC1E5D9F1; Thu, 30 Apr 2020 14:13:49 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id E7B345D9C5; Thu, 30 Apr 2020 14:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588256108; 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=FLh7ca+ALer394rCFPdJUOyUY182YFE5Qlsz8U1mtXk=; b=IEVutALOsVxs5O8Hy3VGqcZ/vgGklIyWYCL6koKthni5dqjoxz1qWdyCFfD5IZc7b5S3qp clNo0hvD81EfIBhQasxptLMqOT62/MVn1cEscoFbR5lC4TmW+Vk89c5IvJrGy0inKLNa1q qO3Uw0IRN+e+IHKdoOHqziW/M9rO/RY= X-MC-Unique: YLxVt81JPHawiN2XR-ABFw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [RFC PATCH 1/3] qemu: capabilities: Introduce QEMU_CAPS_COMPAT_DEPRECATED Date: Thu, 30 Apr 2020 16:13:42 +0200 Message-Id: <8986dad1d6eaaf77389100c07c925cd4dc517e1e.1588255364.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com 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.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The capability is asserted if qemu supports the -compat deprecated-input=3D and deprecated-output=3D settings to control what should happen if deprecated fields are used in QMP. This will be used for a developer-oriented setting which will aid us in catching use of deprecated settings sooner. --- src/qemu/qemu_capabilities.c | 4 ++++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml | 1 + 3 files changed, 6 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 47f88481c8..cad65cca65 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -580,6 +580,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "machine.pseries.cap-sbbc", "machine.pseries.cap-ibs", "tcg", + "compat-deprecated" ); @@ -4879,6 +4880,9 @@ virQEMUCapsInitQMPVersionCaps(virQEMUCapsPtr qemuCaps) /* TCG couldn't be disabled nor queried until QEMU 2.10 */ if (qemuCaps->version < 2010000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_TCG); + + if (qemuCaps->version >=3D 5000050) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_COMPAT_DEPRECATED); } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index cdeaf09cce..c3e112e940 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -561,6 +561,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, /* -machine pseries.cap-sbbc */ QEMU_CAPS_MACHINE_PSERIES_CAP_IBS, /* -machine pseries.cap-ibs */ QEMU_CAPS_TCG, /* QEMU does support TCG */ + QEMU_CAPS_COMPAT_DEPRECATED, /* -compat deprecated-(input|output) is s= upported */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_5.1.0.x86_64.xml index 9611549bd7..8eafb036ea 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml @@ -232,6 +232,7 @@ + 5000050 0 43100242 --=20 2.26.2 From nobody Thu May 2 20:34:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1588256115; cv=none; d=zohomail.com; s=zohoarc; b=kSNYrAKEYwUhjt5jtO2CiZhgVbJTBBE8r17PBAibz7+tC9yL4KKOm4Y30kF4o8WrOKpr9Oxi0x/Nd355J9G7XLCfyiNEyWpe81xs4fMG4zLcknWjcLjhjmKst5McxLA/ZH8dRl+YpGlrEpJbH4v5M8/s29uplZhKkG14kiHBOh4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588256115; 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=r8PA6RDTOQJ7tXR50iVvxysJ6is1ABzsUG0hvDUvins=; b=mfeEZNz5V5F2EzLBM4f/vtXvrSIx1q/YKh3TSfZ0NNjm+OAxxb2Ln0vinYX6Rfxkb8azZ9dBrkZTRhRg0OezAYg4yy4CUeQimJysYSgmN674FkhOCayKzO11X2w+cuQ5XRmc/l+Jv5s2oy4DeQR8aGAjJCyxHD0kB2JjVLpKsXk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1588256115958679.4497046990983; Thu, 30 Apr 2020 07:15:15 -0700 (PDT) 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-452-R9R7fjxWMVCobCdWSH0gBQ-1; Thu, 30 Apr 2020 10:15:10 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4A99F801503; Thu, 30 Apr 2020 14:15:04 +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 12EC610002BC; Thu, 30 Apr 2020 14:15:04 +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 970874CAA7; Thu, 30 Apr 2020 14:15:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03UEDo8v023933 for ; Thu, 30 Apr 2020 10:13:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id CA8BB5D9F1; Thu, 30 Apr 2020 14:13:50 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10B555D9C5; Thu, 30 Apr 2020 14:13:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588256114; 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=r8PA6RDTOQJ7tXR50iVvxysJ6is1ABzsUG0hvDUvins=; b=bpalKxgfqJ4SfG653F2qDv9mIIYJ0H2FmQPC9tXJtvithvTSGkJ1QM73wViWy3SNwcgFLu vV82RB3LoQ1+QnXYFfbg8o5m1Zy7aA1IMfo8PuvyyiER9Qg0SNTbYmPjSo463O+ismanY2 s2fI4WapSv0zI4BrPAJMK02i3OM/B18= X-MC-Unique: R9R7fjxWMVCobCdWSH0gBQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [RFC PATCH 2/3] qemu: conf: Add 'deprecated_debug' setting to qemu.conf Date: Thu, 30 Apr 2020 16:13:43 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com 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.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" New QEMU supports an harsh, but hard to ignore way to notify that the QMP user used an deprecated command. This is useful e.g. for developers to see that something needs to be fixed. This patch introduces a qemu.conf option to enable the setting in cases when qemu supports it so that developers and continiuous integration efforts are notified about use of deprecated fields while it's not late. --- src/qemu/libvirtd_qemu.aug | 1 + src/qemu/qemu.conf | 11 +++++++++++ src/qemu/qemu_conf.c | 2 ++ src/qemu/qemu_conf.h | 2 ++ src/qemu/test_libvirtd_qemu.aug.in | 1 + 5 files changed, 17 insertions(+) diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug index 404498b611..4cf700346f 100644 --- a/src/qemu/libvirtd_qemu.aug +++ b/src/qemu/libvirtd_qemu.aug @@ -118,6 +118,7 @@ module Libvirtd_qemu =3D let debug_level_entry =3D int_entry "gluster_debug_level" | bool_entry "virtiofsd_debug" + | bool_entry "deprecated_debug" let memory_entry =3D str_entry "memory_backing_dir" diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf index abdbf07fec..558731da0f 100644 --- a/src/qemu/qemu.conf +++ b/src/qemu/qemu.conf @@ -852,3 +852,14 @@ # may change across versions. # #capability_filters =3D [ "capname" ] + +# 'deprecated_debug' setting controls whether qemu should be instructed to= crash +# when libvirt uses deprecated commands or arguments and at the same time = to +# stop including deprecated fields in replies. This setting is meant for +# developers and continious-integration efforts to make it obvious when +# we rely on features which may go away. In cases when qemu doesn't support +# dealing with deprecated fields the setting is ignored. +# +# DO NOT use in production. +# +#deprecated_debug =3D 1 diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index c59824006c..34286bf388 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -846,6 +846,8 @@ virQEMUDriverConfigLoadDebugEntry(virQEMUDriverConfigPt= r cfg, return -1; if (virConfGetValueBool(conf, "virtiofsd_debug", &cfg->virtiofsdDebug)= < 0) return -1; + if (virConfGetValueBool(conf, "deprecated_debug", &cfg->deprecatedDebu= g) < 0) + return -1; return 0; } diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index b9ef4551a3..830e7f320d 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -218,6 +218,8 @@ struct _virQEMUDriverConfig { gid_t swtpm_group; char **capabilityfilters; + + bool deprecatedDebug; }; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virQEMUDriverConfig, virObjectUnref); diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qe= mu.aug.in index 19da591aae..a45003633f 100644 --- a/src/qemu/test_libvirtd_qemu.aug.in +++ b/src/qemu/test_libvirtd_qemu.aug.in @@ -111,3 +111,4 @@ module Test_libvirtd_qemu =3D { "capability_filters" { "1" =3D "capname" } } +{ "deprecated_debug" =3D "1" } --=20 2.26.2 From nobody Thu May 2 20:34:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1588256122; cv=none; d=zohomail.com; s=zohoarc; b=PppHh/Ip6Cva17A7fHflT3FDLF/VXUlDnqm1HJ6KKHZtf2rwIQOlsM6hgOFThcU7mShMkiAcxGfZpftMGDr1wbFLAAGN3FzlDkx4mcbBL1XRTdJEBtRpSTNbHPEvhSUE4B2Ad+NW08D46nT+Bxg3GSdTIUmNMEnnKthC40j83Os= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588256122; 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=7lwAsUKW7Ivom+uV9vTtAQFxG6glY8K5GRO3WJDvS48=; b=Q0/4eIbBvAcxmtG4Ava07KOtxeVAL1jI+bN5RcLgdQsJXuWina9+UTGdCvf3CGyMl/UfJue6opW+DYjKTtslc3j/8+ipi2an+KZm/lKTv15TPsM9uOP66ygxF1c69oxqPit+BvIfJCqCWTrNHCpm2FizLGi9N7uyTQ7CG7nMAQM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1588256122393484.7840149949808; Thu, 30 Apr 2020 07:15:22 -0700 (PDT) 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-372-FBVd6_ftMUa4DUXCIJF5sQ-1; Thu, 30 Apr 2020 10:15:15 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BF81380404B; Thu, 30 Apr 2020 14:15: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 8B24F5EE02; Thu, 30 Apr 2020 14:15:09 +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 032571809557; Thu, 30 Apr 2020 14:15:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03UEDpdx023938 for ; Thu, 30 Apr 2020 10:13:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id E3CD95D9F1; Thu, 30 Apr 2020 14:13:51 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C1FC5D9C5; Thu, 30 Apr 2020 14:13:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588256120; 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=7lwAsUKW7Ivom+uV9vTtAQFxG6glY8K5GRO3WJDvS48=; b=gQvXkkM+uegs2OpvmDQbPx+oUeBO138qyZA1nIoxxvJ2KPOMXurSsOsbyJ79RNUXzih1NC Cltkcdi/wHlxz6YYEUFgtf29Q4dgweNhg8Vd4cken5MazDAqE/rUdzeqyWQWUd6J+R0efJ icYG8BljMT9sJOeH3UYP7fuGuMFJ8LY= X-MC-Unique: FBVd6_ftMUa4DUXCIJF5sQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [RFC PATCH 3/3] qemu: command: Handle formatting of '-compat' options Date: Thu, 30 Apr 2020 16:13:44 +0200 Message-Id: <2a2bb9a9fcbad811abbc52236ac1340e79ed9df5.1588255364.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com 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.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Enable '-compat' if requested in qemu.conf and supported by qemu to instruct qemu to crash when a deprecated command is used and stop returning deprecated fields. This setting is meant for libvirt developers and such. --- src/qemu/qemu_command.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6acfc0b19d..5a4769e969 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9801,6 +9801,20 @@ qemuBuildVsockCommandLine(virCommandPtr cmd, } +static void +qemuBuildCompatDeprecatedCommandLine(virCommandPtr cmd, + virQEMUDriverConfigPtr cfg, + virQEMUCapsPtr qemuCaps) +{ + if (!cfg->deprecatedDebug || + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_COMPAT_DEPRECATED)) + return; + + virCommandAddArgList(cmd, "-compat", + "deprecated-input=3Dcrash,deprecated-output=3Dhid= e", NULL); +} + + /* * Constructs a argv suitable for launching qemu with config defined * for a given virtual machine. @@ -9860,6 +9874,8 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, if (qemuBuildNameCommandLine(cmd, cfg, def, qemuCaps) < 0) return NULL; + qemuBuildCompatDeprecatedCommandLine(cmd, cfg, qemuCaps); + if (!standalone) virCommandAddArg(cmd, "-S"); /* freeze CPU */ --=20 2.26.2