GY> There are four parameters in define xml of filter, handler and
GY> subscription, but only there are passes to them, that *sysname* is
GY> missed.
The sysname parameter is not missed. It's taken from the URI, which
is "localhost:5988" by default. For Pegasus, the URI and the sysname
in the XML must be the FQDN of the host system, so you need to specify
an appropriate URI with the -u parameter.
GY> On the former version of libcmpiutil, only three parameters in
GY> their define method. So I don't know what's the original idea of
GY> it, three or four arguments? Or it's just a minor mistake.
No, it's not a mistake, it's a change required to use the tester
against Pegasus :)
GY> Below are some parts of code.
GY> ...
GY> def filter_xml(name, type, ns, sysname):
GY> ...
GY> def handler_xml(name, port, sysname):
GY> ...
GY> def subscription_xml(name, sysname):
GY> ...
GY> def dump_xml(name, typ, ns):
GY> filter_str = filter_xml(name, typ, ns)
GY> handler_str = handler_xml(name, 8000)
GY> subscript_str = subscription_xml(name)
GY> ...
You should be able to look at the CIMIndicationSubscription, which has
"subscribe" and "unsubscribe" methods. Those show the proper way to
do the operations.
In order to use the code as a module, the CIMIndicationSubscription
interface should be all you need and will handle everything for you.
GY> Also, I'm not sure of instances deletion order, which including
GY> filter, handler and subscription instance. They are created by
GY> filter, handler and subscription order, and then deletion order it
GY> the same as created in coding. I'm not sure whether the
GY> subscription instance have to be deleted firstly.
The subscription must be deleted first, followed by the filter and
handler (in either order). The code does this correctly.
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com