qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "Lukáš Doktor" <ldoktor@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Peter Krempa" <pkrempa@redhat.com>,
	"Daniel P . Berrange" <berrange@redhat.com>,
	libvir-list@redhat.com, qemu-devel@nongnu.org,
	mdroth@linux.vnet.ibm.com, marcandre.lureau@gmail.com,
	libguestfs@redhat.com
Subject: Re: [PATCH v5 0/8] Configurable policy for handling deprecated interfaces
Date: Mon, 21 Sep 2020 13:45:14 +0100	[thread overview]
Message-ID: <20200921124514.GB27434@redhat.com> (raw)
In-Reply-To: <20200914084802.4185028-1-armbru@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

Some general comments on using the patch:

* For libguestfs I chose to add

  -compat deprecated-input=reject,deprecated-output=hide

  This is only enabled in developer builds of libguestfs when we
  are running qemu directly (not via libvirt).  The patch for
  this is attached.

* What's the point/difference in having reject vs crash?

* I hope that by hiding deprecated QAPI fields we may detect
  errors in libguestfs, but I suspect what'll happen is it'll
  cause fall-back behaviour which might be harder to detect.

* Be *really* good to have this for command line parameters!

Notes on the attached patch:

* https://libguestfs.org/guestfs-building.1.html

* Simple test:

LIBGUESTFS_BACKEND=direct \
LIBGUESTFS_HV=~/d/qemu/build/x86_64-softmmu/qemu-system-x86_64 \
./run libguestfs-test-tool

* Run the full test suite:

LIBGUESTFS_HV=~/d/qemu/build/x86_64-softmmu/qemu-system-x86_64 \
make -k check-direct

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW

[-- Attachment #2: 0001-lib-direct-Pass-qemu-compat-to-detect-deprecated-fea.patch --]
[-- Type: text/plain, Size: 2018 bytes --]

From 90df6dc8a3278800f9f9dc23f626df5fa00b5950 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 21 Sep 2020 13:18:05 +0100
Subject: [PATCH] lib: direct: Pass qemu -compat to detect deprecated features.

In developer versions of libguestfs only, pass the qemu -compat option
which will reject deprecated qemu features, giving us early warning if
we are using something that may be removed in future.  This does not
affect stable branch builds or old versions of qemu which did not have
this flag.
---
 lib/guestfs-internal.h |  3 +++
 lib/launch-direct.c    | 11 +++++++++++
 2 files changed, 14 insertions(+)

diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h
index d7ec7215d..4ad1cd125 100644
--- a/lib/guestfs-internal.h
+++ b/lib/guestfs-internal.h
@@ -33,6 +33,9 @@
 
 #include <pcre.h>
 
+/* Is this a developer version of libguestfs? */
+#define IS_DEVELOPER_VERSION ((PACKAGE_VERSION_MINOR & 1) == 1)
+
 /* Minimum required version of libvirt for the libvirt backend.
  *
  * This is also checked at runtime because you can dynamically link
diff --git a/lib/launch-direct.c b/lib/launch-direct.c
index b6ed9766f..3e42609ff 100644
--- a/lib/launch-direct.c
+++ b/lib/launch-direct.c
@@ -501,6 +501,17 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
   if (guestfs_int_qemu_supports (g, data->qemu_data, "-enable-fips"))
     flag ("-enable-fips");
 
+  /* In non-stable versions of libguestfs, pass the -compat option to
+   * qemu so we can look for potentially deprecated features.
+   */
+  if (IS_DEVELOPER_VERSION &&
+      guestfs_int_qemu_supports (g, data->qemu_data, "-compat")) {
+    start_list ("-compat") {
+      append_list ("deprecated-input=reject");
+      append_list ("deprecated-output=hide");
+    } end_list ();
+  }
+
   /* Newer versions of qemu (from around 2009/12) changed the
    * behaviour of monitors so that an implicit '-monitor stdio' is
    * assumed if we are in -nographic mode and there is no other
-- 
2.28.0.rc2


  parent reply	other threads:[~2020-09-21 12:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14  8:47 [PATCH v5 0/8] Configurable policy for handling deprecated interfaces Markus Armbruster
2020-09-14  8:47 ` [PATCH v5 1/8] qemu-options: New -compat to set policy for " Markus Armbruster
2020-09-14 11:50   ` Peter Krempa
2020-09-21 14:35     ` Markus Armbruster
2020-09-14 15:08   ` Eric Blake
2020-09-21 12:01     ` Richard W.M. Jones
2020-09-14  8:47 ` [PATCH v5 2/8] qapi: Implement deprecated-output=hide for QMP command results Markus Armbruster
2020-09-14  8:47 ` [PATCH v5 3/8] qapi: Implement deprecated-output=hide for QMP events Markus Armbruster
2020-09-14 15:19   ` Eric Blake
2020-09-14  8:47 ` [PATCH v5 4/8] qapi: Implement deprecated-output=hide for QMP event data Markus Armbruster
2020-09-14 15:35   ` Eric Blake
2020-09-14  8:47 ` [PATCH v5 5/8] qapi: Implement deprecated-output=hide for QMP introspection Markus Armbruster
2020-09-14 15:43   ` Eric Blake
2020-09-21 14:41     ` Markus Armbruster
2020-09-14  8:48 ` [PATCH v5 6/8] qapi: Implement deprecated-input=reject for QMP commands Markus Armbruster
2020-09-14 15:45   ` Eric Blake
2020-09-14  8:48 ` [PATCH v5 7/8] qapi: Implement deprecated-input=reject for QMP command arguments Markus Armbruster
2020-09-14 15:57   ` Eric Blake
2020-09-14  8:48 ` [PATCH v5 8/8] qapi: New -compat deprecated-input=crash Markus Armbruster
2020-09-14 15:58   ` Eric Blake
2020-09-21 14:42     ` Markus Armbruster
2020-09-21 12:45 ` Richard W.M. Jones [this message]
2020-09-21 12:54   ` [PATCH v5 0/8] Configurable policy for handling deprecated interfaces Peter Krempa
2020-09-21 12:58     ` Richard W.M. Jones
2020-09-21 12:56 ` Peter Maydell
2020-09-21 14:58   ` Markus Armbruster
2020-09-21 16:28     ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200921124514.GB27434@redhat.com \
    --to=rjones@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=ldoktor@redhat.com \
    --cc=libguestfs@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).