Patchwork Re: [PATCH 2/3] QMP: Introduce commands documentation

login
register
mail settings
Submitter Jan Kiszka
Date June 1, 2010, 4:10 p.m.
Message ID <4C0530F2.9020809@siemens.com>
Download mbox | patch
Permalink /patch/54233/
State New
Headers show

Comments

Jan Kiszka - June 1, 2010, 4:10 p.m.
Luiz Capitulino wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> One of the most important missing feature in QMP today is its
> supported commands documentation.
> 
> The plan is to make it part of self-description support, however
> self-description is a big task we have been postponing for a
> long time now and still don't know when it's going to be done.
> 
> In order not to compromise QMP adoption and make users' life easier,
> this commit adds a simple text documentation which fully describes
> all QMP supported commands.
> 
> This is not ideal for a number of reasons (harder to maintain,
> text-only, etc) but does improve the current situation. To avoid at
> least divering from the user monitor help and texi snippets, QMP bits
> are also maintained inside qemu-monitor.hx, and hxtool is extended to
> generate a single text file from them.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
>  Makefile        |    5 +-
>  QMP/README      |    5 +-
>  configure       |    4 +
>  hxtool          |   44 ++-
>  qemu-monitor.hx | 1322 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 1376 insertions(+), 4 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 7986bf6..3a8a311 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -29,7 +29,7 @@ $(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
>  LIBS+=-lz $(LIBS_TOOLS)
> 
>  ifdef BUILD_DOCS
> -DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8
> +DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
>  else
>  DOCS=
>  endif
> @@ -259,6 +259,9 @@ qemu-options.texi: $(SRC_PATH)/qemu-options.hx
>  qemu-monitor.texi: $(SRC_PATH)/qemu-monitor.hx
>         $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@,"  GEN   $@")
> 
> +QMP/qmp-commands.txt: $(SRC_PATH)/qemu-monitor.hx
> +       $(call quiet-command,sh $(SRC_PATH)/hxtool -q < $< > $@,"  GEN   $@")
> +
>  qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
>         $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@,"  GEN   $@")
> 

This hunk seem to have "gained" tab-to-spaces conversion, unfortunately
in a makefile.

Applying the patch generated another hunk warning:

...
patching file qemu-monitor.hx
Hunk #15 succeeded at 983 with fuzz 2.

Haven't checked yet - harmless?

If you need to resent the patch, please already fold in this trivial
fix:


Thanks!
Jan
Luiz Capitulino - June 1, 2010, 5:27 p.m.
On Tue, 01 Jun 2010 18:10:26 +0200
Jan Kiszka <jan.kiszka@siemens.com> wrote:

> Luiz Capitulino wrote:
> > From: Jan Kiszka <jan.kiszka@siemens.com>
> > 
> > One of the most important missing feature in QMP today is its
> > supported commands documentation.
> > 
> > The plan is to make it part of self-description support, however
> > self-description is a big task we have been postponing for a
> > long time now and still don't know when it's going to be done.
> > 
> > In order not to compromise QMP adoption and make users' life easier,
> > this commit adds a simple text documentation which fully describes
> > all QMP supported commands.
> > 
> > This is not ideal for a number of reasons (harder to maintain,
> > text-only, etc) but does improve the current situation. To avoid at
> > least divering from the user monitor help and texi snippets, QMP bits
> > are also maintained inside qemu-monitor.hx, and hxtool is extended to
> > generate a single text file from them.
> > 
> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> > Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> > ---
> >  Makefile        |    5 +-
> >  QMP/README      |    5 +-
> >  configure       |    4 +
> >  hxtool          |   44 ++-
> >  qemu-monitor.hx | 1322 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  5 files changed, 1376 insertions(+), 4 deletions(-)
> > 
> > diff --git a/Makefile b/Makefile
> > index 7986bf6..3a8a311 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -29,7 +29,7 @@ $(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
> >  LIBS+=-lz $(LIBS_TOOLS)
> > 
> >  ifdef BUILD_DOCS
> > -DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8
> > +DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
> >  else
> >  DOCS=
> >  endif
> > @@ -259,6 +259,9 @@ qemu-options.texi: $(SRC_PATH)/qemu-options.hx
> >  qemu-monitor.texi: $(SRC_PATH)/qemu-monitor.hx
> >         $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@,"  GEN   $@")
> > 
> > +QMP/qmp-commands.txt: $(SRC_PATH)/qemu-monitor.hx
> > +       $(call quiet-command,sh $(SRC_PATH)/hxtool -q < $< > $@,"  GEN   $@")
> > +
> >  qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
> >         $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@,"  GEN   $@")
> > 
> 
> This hunk seem to have "gained" tab-to-spaces conversion, unfortunately
> in a makefile.
> 
> Applying the patch generated another hunk warning:

 Are those problems worth a resping or can we fix then with
additional patches? It works ok here.
Jan Kiszka - June 1, 2010, 5:39 p.m.
Luiz Capitulino wrote:
> On Tue, 01 Jun 2010 18:10:26 +0200
> Jan Kiszka <jan.kiszka@siemens.com> wrote:
> 
>> Luiz Capitulino wrote:
>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>
>>> One of the most important missing feature in QMP today is its
>>> supported commands documentation.
>>>
>>> The plan is to make it part of self-description support, however
>>> self-description is a big task we have been postponing for a
>>> long time now and still don't know when it's going to be done.
>>>
>>> In order not to compromise QMP adoption and make users' life easier,
>>> this commit adds a simple text documentation which fully describes
>>> all QMP supported commands.
>>>
>>> This is not ideal for a number of reasons (harder to maintain,
>>> text-only, etc) but does improve the current situation. To avoid at
>>> least divering from the user monitor help and texi snippets, QMP bits
>>> are also maintained inside qemu-monitor.hx, and hxtool is extended to
>>> generate a single text file from them.
>>>
>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
>>> ---
>>>  Makefile        |    5 +-
>>>  QMP/README      |    5 +-
>>>  configure       |    4 +
>>>  hxtool          |   44 ++-
>>>  qemu-monitor.hx | 1322 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>  5 files changed, 1376 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/Makefile b/Makefile
>>> index 7986bf6..3a8a311 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -29,7 +29,7 @@ $(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
>>>  LIBS+=-lz $(LIBS_TOOLS)
>>>
>>>  ifdef BUILD_DOCS
>>> -DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8
>>> +DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
>>>  else
>>>  DOCS=
>>>  endif
>>> @@ -259,6 +259,9 @@ qemu-options.texi: $(SRC_PATH)/qemu-options.hx
>>>  qemu-monitor.texi: $(SRC_PATH)/qemu-monitor.hx
>>>         $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@,"  GEN   $@")
>>>
>>> +QMP/qmp-commands.txt: $(SRC_PATH)/qemu-monitor.hx
>>> +       $(call quiet-command,sh $(SRC_PATH)/hxtool -q < $< > $@,"  GEN   $@")
>>> +
>>>  qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
>>>         $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@,"  GEN   $@")
>>>
>> This hunk seem to have "gained" tab-to-spaces conversion, unfortunately
>> in a makefile.
>>
>> Applying the patch generated another hunk warning:
> 
>  Are those problems worth a resping or can we fix then with
> additional patches? It works ok here.

Oh, it's indeed a local issue. Likely our corporate mail server. Nice...
Sorry for the noise!

Jan
Anthony Liguori - June 1, 2010, 6:07 p.m.
On 06/01/2010 12:39 PM, Jan Kiszka wrote:
>
> Oh, it's indeed a local issue. Likely our corporate mail server. Nice...
> Sorry for the noise!
>    

Jan, I believe you're okay with the current state of this series, yes?

I'd like to apply these ASAP so we can start formal spec review.

Regards,

Anthony Liguori

> Jan
>
>
Jan Kiszka - June 1, 2010, 6:08 p.m.
Anthony Liguori wrote:
> On 06/01/2010 12:39 PM, Jan Kiszka wrote:
>> Oh, it's indeed a local issue. Likely our corporate mail server. Nice...
>> Sorry for the noise!
>>    
> 
> Jan, I believe you're okay with the current state of this series, yes?

Yes, of course!

> 
> I'd like to apply these ASAP so we can start formal spec review.

Great.

Jan

Patch

diff --git a/hxtool b/hxtool
index d499dc0..7ca83ed 100644
--- a/hxtool
+++ b/hxtool
@@ -59,6 +59,7 @@  hxtoqmp()
 {
     IFS=
     flag=0
+    line=1
     while read -r str; do
         case "$str" in
             HXCOMM*)
@@ -87,6 +88,7 @@  hxtoqmp()
             test $flag -eq 1 && echo "$str"
             ;;
         esac
+        line=$((line+1))
     done
 }