Re: [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice
Marc-Andre Lureauwrites: > Hi > > On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster wrote: >> Each generator carries a copyright notice for the generator itself, >> and another one for the files it generates. Only the former have been >> updated along the way, the latter have not, and are all out of date. >> >> Fix by copying the generator's copyright notice to the generated files >> instead. > > That makes sense, but we loose the Author lines in the generated > files. Not a big deal I guess, but worth to point out, no? We do. They've become just as outdated as the copyright notices. Giving them the same treatment doesn't seem to be worth the trouble. I'm happy to explain this in the commit message. >> >> Signed-off-by: Markus Armbruster > > Other than that, > Reviewed-by: Marc-André Lureau Thanks!
Re: [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice
On 02/05/2018 07:44 AM, Marc-Andre Lureau wrote: > Hi > > On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbrusterwrote: >> Each generator carries a copyright notice for the generator itself, >> and another one for the files it generates. Only the former have been >> updated along the way, the latter have not, and are all out of date. >> >> Fix by copying the generator's copyright notice to the generated files >> instead. > > That makes sense, but we loose the Author lines in the generated > files. Not a big deal I guess, but worth to point out, no? I don't see too much use for author lines as long as you have a 'this file is generated' line; you can use git history to learn the authors of the generator code. But yeah, a commit message blurb can't hurt. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org signature.asc Description: OpenPGP digital signature
Re: [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice
Hi On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbrusterwrote: > Each generator carries a copyright notice for the generator itself, > and another one for the files it generates. Only the former have been > updated along the way, the latter have not, and are all out of date. > > Fix by copying the generator's copyright notice to the generated files > instead. That makes sense, but we loose the Author lines in the generated files. Not a big deal I guess, but worth to point out, no? > > Signed-off-by: Markus Armbruster Other than that, Reviewed-by: Marc-André Lureau > --- > scripts/qapi-commands.py | 34 +++--- > scripts/qapi-event.py | 32 ++-- > scripts/qapi-introspect.py | 25 - > scripts/qapi-types.py | 32 ++-- > scripts/qapi-visit.py | 34 +++--- > scripts/qapi.py| 7 +-- > 6 files changed, 75 insertions(+), 89 deletions(-) > > diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py > index 25ac52503a..a861ac52e7 100644 > --- a/scripts/qapi-commands.py > +++ b/scripts/qapi-commands.py > @@ -1,16 +1,17 @@ > -# > -# QAPI command marshaller generator > -# > -# Copyright IBM, Corp. 2011 > -# Copyright (C) 2014-2016 Red Hat, Inc. > -# > -# Authors: > -# Anthony Liguori > -# Michael Roth > -# Markus Armbruster > -# > -# This work is licensed under the terms of the GNU GPL, version 2. > -# See the COPYING file in the top-level directory. > +""" > +QAPI command marshaller generator > + > +Copyright IBM, Corp. 2011 > +Copyright (C) 2014-2018 Red Hat, Inc. > + > +Authors: > + Anthony Liguori > + Michael Roth > + Markus Armbruster > + > +This work is licensed under the terms of the GNU GPL, version 2. > +See the COPYING file in the top-level directory. > +""" > > from qapi import * > > @@ -257,16 +258,11 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor): > > blurb = ''' > * Schema-defined QAPI/QMP commands > - * > - * Copyright IBM, Corp. 2011 > - * > - * Authors: > - * Anthony Liguori > ''' > > (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix, > 'qmp-marshal.c', 'qmp-commands.h', > -blurb) > +blurb, __doc__) > > fdef.write(mcgen(''' > > diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py > index 31faedc689..b1d611c5ea 100644 > --- a/scripts/qapi-event.py > +++ b/scripts/qapi-event.py > @@ -1,15 +1,16 @@ > -# > -# QAPI event generator > -# > -# Copyright (c) 2014 Wenchao Xia > -# Copyright (c) 2015-2016 Red Hat Inc. > -# > -# Authors: > -# Wenchao Xia > -# Markus Armbruster > -# > -# This work is licensed under the terms of the GNU GPL, version 2. > -# See the COPYING file in the top-level directory. > +""" > +QAPI event generator > + > +Copyright (c) 2014 Wenchao Xia > +Copyright (c) 2015-2018 Red Hat Inc. > + > +Authors: > + Wenchao Xia > + Markus Armbruster > + > +This work is licensed under the terms of the GNU GPL, version 2. > +See the COPYING file in the top-level directory. > +""" > > from qapi import * > > @@ -173,16 +174,11 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor): > > blurb = ''' > * Schema-defined QAPI/QMP events > - * > - * Copyright (c) 2014 Wenchao Xia > - * > - * Authors: > - * Wenchao Xia > ''' > > (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix, > 'qapi-event.c', 'qapi-event.h', > -blurb) > +blurb, __doc__) > > fdef.write(mcgen(''' > #include "qemu/osdep.h" > diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py > index 83da2bdb94..bd9253a172 100644 > --- a/scripts/qapi-introspect.py > +++ b/scripts/qapi-introspect.py > @@ -1,13 +1,14 @@ > -# > -# QAPI introspection generator > -# > -# Copyright (C) 2015-2016 Red Hat, Inc. > -# > -# Authors: > -# Markus Armbruster > -# > -# This work is licensed under the terms of the GNU GPL, version 2. > -# See the COPYING file in the top-level directory. > +""" > +QAPI introspection generator > + > +Copyright (C) 2015-2018 Red Hat, Inc. > + > +Authors: > + Markus Armbruster > + > +This work is licensed under the terms of the GNU GPL, version 2. > +See the COPYING file in the top-level directory. > +""" > > from qapi import * > > @@ -178,13 +179,11 @@ for o, a in opts: > > blurb = ''' > * QAPI/QMP schema introspection > - * > - * Copyright (C) 2015 Red Hat, Inc. > ''' > > (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix, >
Re: [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice
Eric Blakewrites: > On 02/02/2018 07:03 AM, Markus Armbruster wrote: >> Each generator carries a copyright notice for the generator itself, >> and another one for the files it generates. Only the former have been >> updated along the way, the latter have not, and are all out of date. >> >> Fix by copying the generator's copyright notice to the generated files >> instead. >> >> Signed-off-by: Markus Armbruster >> --- > >> +++ b/scripts/qapi-commands.py >> @@ -1,16 +1,17 @@ >> -# >> -# QAPI command marshaller generator >> -# >> -# Copyright IBM, Corp. 2011 >> -# Copyright (C) 2014-2016 Red Hat, Inc. >> -# >> -# Authors: >> -# Anthony Liguori >> -# Michael Roth >> -# Markus Armbruster >> -# >> -# This work is licensed under the terms of the GNU GPL, version 2. >> -# See the COPYING file in the top-level directory. >> +""" >> +QAPI command marshaller generator >> + >> +Copyright IBM, Corp. 2011 >> +Copyright (C) 2014-2018 Red Hat, Inc. >> + >> +Authors: >> + Anthony Liguori >> + Michael Roth >> + Markus Armbruster >> + >> +This work is licensed under the terms of the GNU GPL, version 2. >> +See the COPYING file in the top-level directory. >> +""" > > So python lets you start a file with a string constant that is not > associated with any variable name? It's the module's doc string, done the same way as function doc strings. https://www.python.org/dev/peps/pep-0257/#what-is-a-docstring >> (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix, >> 'qmp-marshal.c', 'qmp-commands.h', >> -blurb) >> +blurb, __doc__) > > Ah, and there's what I was missing - python auto-assigns such an initial > string to a magic automatic variable. Cool language feature I hadn't > seen before! > > Reviewed-by: Eric Blake Thanks!
Re: [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice
On 02/02/2018 07:03 AM, Markus Armbruster wrote: > Each generator carries a copyright notice for the generator itself, > and another one for the files it generates. Only the former have been > updated along the way, the latter have not, and are all out of date. > > Fix by copying the generator's copyright notice to the generated files > instead. > > Signed-off-by: Markus Armbruster> --- > +++ b/scripts/qapi-commands.py > @@ -1,16 +1,17 @@ > -# > -# QAPI command marshaller generator > -# > -# Copyright IBM, Corp. 2011 > -# Copyright (C) 2014-2016 Red Hat, Inc. > -# > -# Authors: > -# Anthony Liguori > -# Michael Roth > -# Markus Armbruster > -# > -# This work is licensed under the terms of the GNU GPL, version 2. > -# See the COPYING file in the top-level directory. > +""" > +QAPI command marshaller generator > + > +Copyright IBM, Corp. 2011 > +Copyright (C) 2014-2018 Red Hat, Inc. > + > +Authors: > + Anthony Liguori > + Michael Roth > + Markus Armbruster > + > +This work is licensed under the terms of the GNU GPL, version 2. > +See the COPYING file in the top-level directory. > +""" So python lets you start a file with a string constant that is not associated with any variable name? > > (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix, > 'qmp-marshal.c', 'qmp-commands.h', > -blurb) > +blurb, __doc__) Ah, and there's what I was missing - python auto-assigns such an initial string to a magic automatic variable. Cool language feature I hadn't seen before! Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org signature.asc Description: OpenPGP digital signature
[Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice
Each generator carries a copyright notice for the generator itself, and another one for the files it generates. Only the former have been updated along the way, the latter have not, and are all out of date. Fix by copying the generator's copyright notice to the generated files instead. Signed-off-by: Markus Armbruster--- scripts/qapi-commands.py | 34 +++--- scripts/qapi-event.py | 32 ++-- scripts/qapi-introspect.py | 25 - scripts/qapi-types.py | 32 ++-- scripts/qapi-visit.py | 34 +++--- scripts/qapi.py| 7 +-- 6 files changed, 75 insertions(+), 89 deletions(-) diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py index 25ac52503a..a861ac52e7 100644 --- a/scripts/qapi-commands.py +++ b/scripts/qapi-commands.py @@ -1,16 +1,17 @@ -# -# QAPI command marshaller generator -# -# Copyright IBM, Corp. 2011 -# Copyright (C) 2014-2016 Red Hat, Inc. -# -# Authors: -# Anthony Liguori -# Michael Roth -# Markus Armbruster -# -# This work is licensed under the terms of the GNU GPL, version 2. -# See the COPYING file in the top-level directory. +""" +QAPI command marshaller generator + +Copyright IBM, Corp. 2011 +Copyright (C) 2014-2018 Red Hat, Inc. + +Authors: + Anthony Liguori + Michael Roth + Markus Armbruster + +This work is licensed under the terms of the GNU GPL, version 2. +See the COPYING file in the top-level directory. +""" from qapi import * @@ -257,16 +258,11 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor): blurb = ''' * Schema-defined QAPI/QMP commands - * - * Copyright IBM, Corp. 2011 - * - * Authors: - * Anthony Liguori ''' (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix, 'qmp-marshal.c', 'qmp-commands.h', -blurb) +blurb, __doc__) fdef.write(mcgen(''' diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py index 31faedc689..b1d611c5ea 100644 --- a/scripts/qapi-event.py +++ b/scripts/qapi-event.py @@ -1,15 +1,16 @@ -# -# QAPI event generator -# -# Copyright (c) 2014 Wenchao Xia -# Copyright (c) 2015-2016 Red Hat Inc. -# -# Authors: -# Wenchao Xia -# Markus Armbruster -# -# This work is licensed under the terms of the GNU GPL, version 2. -# See the COPYING file in the top-level directory. +""" +QAPI event generator + +Copyright (c) 2014 Wenchao Xia +Copyright (c) 2015-2018 Red Hat Inc. + +Authors: + Wenchao Xia + Markus Armbruster + +This work is licensed under the terms of the GNU GPL, version 2. +See the COPYING file in the top-level directory. +""" from qapi import * @@ -173,16 +174,11 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor): blurb = ''' * Schema-defined QAPI/QMP events - * - * Copyright (c) 2014 Wenchao Xia - * - * Authors: - * Wenchao Xia ''' (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix, 'qapi-event.c', 'qapi-event.h', -blurb) +blurb, __doc__) fdef.write(mcgen(''' #include "qemu/osdep.h" diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py index 83da2bdb94..bd9253a172 100644 --- a/scripts/qapi-introspect.py +++ b/scripts/qapi-introspect.py @@ -1,13 +1,14 @@ -# -# QAPI introspection generator -# -# Copyright (C) 2015-2016 Red Hat, Inc. -# -# Authors: -# Markus Armbruster -# -# This work is licensed under the terms of the GNU GPL, version 2. -# See the COPYING file in the top-level directory. +""" +QAPI introspection generator + +Copyright (C) 2015-2018 Red Hat, Inc. + +Authors: + Markus Armbruster + +This work is licensed under the terms of the GNU GPL, version 2. +See the COPYING file in the top-level directory. +""" from qapi import * @@ -178,13 +179,11 @@ for o, a in opts: blurb = ''' * QAPI/QMP schema introspection - * - * Copyright (C) 2015 Red Hat, Inc. ''' (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix, 'qmp-introspect.c', 'qmp-introspect.h', -blurb) +blurb, __doc__) fdef.write(mcgen(''' #include "qemu/osdep.h" diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py index 86afc57f92..1103dbda2d 100644 --- a/scripts/qapi-types.py +++ b/scripts/qapi-types.py @@ -1,15 +1,17 @@ -# -# QAPI types generator -# -# Copyright IBM, Corp. 2011 -# Copyright (c) 2013-2016 Red Hat Inc. -# -# Authors: -# Anthony Liguori -# Markus Armbruster -# -# This work