Bug 1229199

Summary: Expose typed parameter names in libvirt-api.xml
Product: Red Hat Enterprise Linux 7 Reporter: Jiri Denemark <jdenemar>
Component: libvirtAssignee: Jiri Denemark <jdenemar>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: dyuan, honzhang, jdenemar, lhuang, michal.skrivanek, mzhan, rbalakri, virt-bugs, ykaplan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.2.17-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1222795 Environment:
Last Closed: 2015-11-19 06:40:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 974510, 1222795    
Attachments:
Description Flags
The script i used to test macro none

Description Jiri Denemark 2015-06-08 09:13:11 UTC
+++ This bug was initially created as a clone of Bug #1222795 +++

Description of problem:
Typed parameter names are defined as string macros in libvirt-domain.h. Let's expose their string values in libvirt-api.xml

Version-Release number of selected component (if applicable):
libvirt-1.2.16-1.el7

Comment 1 Jiri Denemark 2015-06-11 11:58:42 UTC
Fixed upstream by v1.2.16-128-gb6a2639:

commit b6a2639bd22671c44d6e3e0ca8c73b3b637d9e12
Author: Jiri Denemark <jdenemar>
Date:   Fri Jun 5 11:48:59 2015 +0200

    apibuild: Generate macro/@string attribute
    
    If a macro has a string value, the @string attribute will contain the
    value. Otherwise @string attribute will be missing.
    
    For example, the following macro definition from libvirt-domain.h:
    
     /**
      * VIR_MIGRATE_PARAM_URI:
      * ...
      */
     # define VIR_MIGRATE_PARAM_URI               "migrate_uri"
    
    will result in
    
     <macro name='VIR_MIGRATE_PARAM_URI' file='libvirt-domain' string='migrate_uri'>
       <info><![CDATA[...]]></info>
     </macro>
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1229199
    
    Signed-off-by: Jiri Denemark <jdenemar>

Comment 3 Luyao Huang 2015-07-23 06:00:46 UTC
Verify this bug in libvirt-1.2.17-2.el7.x86_64:

1. check the /usr/share/libvirt/api/libvirt-api.xml:
...
    <macro name='VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA' file='libvirt-domain' string='cputune.emulator_quota'>
      <info><![CDATA[Macro represents the maximum bandwidth to be used within a period for all emulator activity not tied to vcpus, when using the posix scheduler, as an VIR_TYPED_PARAM_LLONG.]]></info>
    </macro>
...

2. check the /usr/include/libvirt/libvirt-domain.h:

/**
 * VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA:
 *
 * Macro represents the maximum bandwidth to be used within a period for
 * all emulator activity not tied to vcpus, when using the posix scheduler,
 * as an VIR_TYPED_PARAM_LLONG.
 */
# define VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA "cputune.emulator_quota"


3. since it is hard to past all the result in this bug, i have wrote a script to check each macro:

# python test-macro.py
found 0 string marcos in /usr/include/libvirt/libvirt-domain-snapshot.h, and 0 string marcos in /usr/share/libvirt/api/libvirt-api.xml
found 80 string marcos in /usr/include/libvirt/libvirt-domain.h, and 80 string marcos in /usr/share/libvirt/api/libvirt-api.xml
found 0 string marcos in /usr/include/libvirt/libvirt-event.h, and 0 string marcos in /usr/share/libvirt/api/libvirt-api.xml
found 11 string marcos in /usr/include/libvirt/libvirt-host.h, and 11 string marcos in /usr/share/libvirt/api/libvirt-api.xml
found 0 string marcos in /usr/include/libvirt/libvirt-interface.h, and 0 string marcos in /usr/share/libvirt/api/libvirt-api.xml
found 0 string marcos in /usr/include/libvirt/libvirt-network.h, and 0 string marcos in /usr/share/libvirt/api/libvirt-api.xml
found 0 string marcos in /usr/include/libvirt/libvirt-nodedev.h, and 0 string marcos in /usr/share/libvirt/api/libvirt-api.xml
found 0 string marcos in /usr/include/libvirt/libvirt-nwfilter.h, and 0 string marcos in /usr/share/libvirt/api/libvirt-api.xml
found 0 string marcos in /usr/include/libvirt/libvirt-secret.h, and 0 string marcos in /usr/share/libvirt/api/libvirt-api.xml
found 0 string marcos in /usr/include/libvirt/libvirt-storage.h, and 0 string marcos in /usr/share/libvirt/api/libvirt-api.xml
found 0 string marcos in /usr/include/libvirt/libvirt-stream.h, and 0 string marcos in /usr/share/libvirt/api/libvirt-api.xml
found 0 string marcos in /usr/include/libvirt/virterror.h, and 0 string marcos in /usr/share/libvirt/api/libvirt-api.xml

Comment 4 Luyao Huang 2015-07-23 06:02:01 UTC
Created attachment 1055164 [details]
The script i used to test macro

Comment 5 Luyao Huang 2015-07-23 06:03:47 UTC
Hi Jiri,

Would you please help to check out is that okay to verify this bug via thus script ?

Thanks in advance for your reply.

Luyao

Comment 6 Jiri Denemark 2015-09-01 12:03:50 UTC
Yeah, this seems to be enough.

Comment 7 Jiri Denemark 2015-09-01 12:04:43 UTC
I mean good enough to verify the bz :-)

Comment 8 Luyao Huang 2015-09-02 01:26:22 UTC
(In reply to Jiri Denemark from comment #7)
> I mean good enough to verify the bz :-)

Thanks a lot for your reply, verify this bug with comment 5

Comment 10 errata-xmlrpc 2015-11-19 06:40:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2202.html