mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
event-test: Get rid of useless and ambiguous VIR_DEBUG macro
The event test does not try to include libvirt internals. Using a macro named VIR_DEBUG might hint to such usage. Additionally it's useless since it's used only in the main() function. Modernize the message strings while touching them.
This commit is contained in:
parent
fda27347d5
commit
e1389f3983
@ -9,7 +9,6 @@
|
|||||||
#include <libvirt/libvirt.h>
|
#include <libvirt/libvirt.h>
|
||||||
#include <libvirt/virterror.h>
|
#include <libvirt/virterror.h>
|
||||||
|
|
||||||
#define VIR_DEBUG(fmt) printf("%s:%d: " fmt "\n", __func__, __LINE__)
|
|
||||||
#define STREQ(a, b) (strcmp(a, b) == 0)
|
#define STREQ(a, b) (strcmp(a, b) == 0)
|
||||||
|
|
||||||
#ifndef ATTRIBUTE_UNUSED
|
#ifndef ATTRIBUTE_UNUSED
|
||||||
@ -656,7 +655,7 @@ int main(int argc, char **argv)
|
|||||||
sigaction(SIGTERM, &action_stop, NULL);
|
sigaction(SIGTERM, &action_stop, NULL);
|
||||||
sigaction(SIGINT, &action_stop, NULL);
|
sigaction(SIGINT, &action_stop, NULL);
|
||||||
|
|
||||||
VIR_DEBUG("Registering event cbs");
|
printf("Registering event callbacks\n");
|
||||||
|
|
||||||
/* Add 2 callbacks to prove this works with more than just one */
|
/* Add 2 callbacks to prove this works with more than just one */
|
||||||
callback1ret = virConnectDomainEventRegister(dconn, myDomainEventCallback1,
|
callback1ret = virConnectDomainEventRegister(dconn, myDomainEventCallback1,
|
||||||
@ -787,7 +786,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG("Deregistering event handlers");
|
printf("Deregistering event callbacks\n");
|
||||||
virConnectDomainEventDeregister(dconn, myDomainEventCallback1);
|
virConnectDomainEventDeregister(dconn, myDomainEventCallback1);
|
||||||
virConnectDomainEventDeregisterAny(dconn, callback2ret);
|
virConnectDomainEventDeregisterAny(dconn, callback2ret);
|
||||||
virConnectDomainEventDeregisterAny(dconn, callback3ret);
|
virConnectDomainEventDeregisterAny(dconn, callback3ret);
|
||||||
@ -816,9 +815,9 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (dconn) {
|
if (dconn) {
|
||||||
VIR_DEBUG("Closing connection");
|
printf("Closing connection: ");
|
||||||
if (virConnectClose(dconn) < 0)
|
if (virConnectClose(dconn) < 0)
|
||||||
printf("error closing\n");
|
printf("failed\n");
|
||||||
printf("done\n");
|
printf("done\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user