[RFC PATCH 2/3] qemu: conf: Add 'deprecated_debug' setting to qemu.conf

Peter Krempa pkrempa at redhat.com
Thu Apr 30 14:36:02 UTC 2020


On Thu, Apr 30, 2020 at 15:27:58 +0100, Daniel Berrange wrote:
> On Thu, Apr 30, 2020 at 04:13:43PM +0200, Peter Krempa wrote:
> > 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 =
> > 
> >     let debug_level_entry = int_entry "gluster_debug_level"
> >                   | bool_entry "virtiofsd_debug"
> > +                 | bool_entry "deprecated_debug"
> > 
> >     let memory_entry = 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 = [ "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 = 1
> 
> Calling it "debug" when the result is to "crash" is a bit misleading !
> I think this behaviour is a bit too harsh. As a developer I would be
> happy to enable an option in my qemu.conf to causes log messages to
> printed to stderr for all my dev servers & VMs, or gracefully rejects
> a QMP command with an error. I'm very unlikely to ever enable an
> option that is going to hard crash my VMs, because that risks data
> loss to me.

Fair enough, qemu supports these options. It comes mostly from how we
use VMs though. I mostly have VMs which boot from a CD or without any
OS, because I simply don't need it for most cases so for me, crashing is
something which I notice and don't risk anything.

Reporting errors to logs though is similarly has it's drawbacks. You
enable it, but if you don't chekc the log file you will not notice it.

I'll probably ask for a possibility to return error and ignore the QMP
command.




More information about the libvir-list mailing list