|
|
9119d9 |
From 3e96914925112a76ee1071696d70ae4be8281682 Mon Sep 17 00:00:00 2001
|
|
|
9119d9 |
Message-Id: <3e96914925112a76ee1071696d70ae4be8281682@dist-git>
|
|
|
9119d9 |
From: Pavel Hrdina <phrdina@redhat.com>
|
|
|
9119d9 |
Date: Fri, 26 Sep 2014 12:43:59 +0200
|
|
|
9119d9 |
Subject: [PATCH] event_example: cleanup example code for tunable event
|
|
|
9119d9 |
|
|
|
9119d9 |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
9119d9 |
(cherry picked from commit f06a6257d5c2c29aff5140c38583a7fcd07d2b93)
|
|
|
9119d9 |
|
|
|
9119d9 |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1115898
|
|
|
9119d9 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
9119d9 |
---
|
|
|
9119d9 |
examples/object-events/event-test.c | 15 ++++-----------
|
|
|
9119d9 |
1 file changed, 4 insertions(+), 11 deletions(-)
|
|
|
9119d9 |
|
|
|
9119d9 |
diff --git a/examples/object-events/event-test.c b/examples/object-events/event-test.c
|
|
|
9119d9 |
index faf0cf2..0c6faf4 100644
|
|
|
9119d9 |
--- a/examples/object-events/event-test.c
|
|
|
9119d9 |
+++ b/examples/object-events/event-test.c
|
|
|
9119d9 |
@@ -476,15 +476,6 @@ myDomainEventTunableCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
9119d9 |
printf("%s EVENT: Domain %s(%d) tunable updated:\n",
|
|
|
9119d9 |
__func__, virDomainGetName(dom), virDomainGetID(dom));
|
|
|
9119d9 |
|
|
|
9119d9 |
-#ifdef WIN32
|
|
|
9119d9 |
-/* MinGW doesn't know the lld/llu so we have to use I64f/I64u instead. */
|
|
|
9119d9 |
-# define LLD_FORMAT "%I64d"
|
|
|
9119d9 |
-# define LLU_FORMAT "%I64u"
|
|
|
9119d9 |
-#else /* WIN32 */
|
|
|
9119d9 |
-# define LLD_FORMAT "%lld"
|
|
|
9119d9 |
-# define LLU_FORMAT "%llu"
|
|
|
9119d9 |
-#endif /* WIN32 */
|
|
|
9119d9 |
-
|
|
|
9119d9 |
for (i = 0; i < nparams; i++) {
|
|
|
9119d9 |
switch (params[i].type) {
|
|
|
9119d9 |
case VIR_TYPED_PARAM_INT:
|
|
|
9119d9 |
@@ -494,10 +485,12 @@ myDomainEventTunableCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
9119d9 |
printf("\t%s: %u\n", params[i].field, params[i].value.ui);
|
|
|
9119d9 |
break;
|
|
|
9119d9 |
case VIR_TYPED_PARAM_LLONG:
|
|
|
9119d9 |
- printf("\t%s: " LLD_FORMAT "\n", params[i].field, params[i].value.l);
|
|
|
9119d9 |
+ printf("\t%s: %" PRId64 "\n", params[i].field,
|
|
|
9119d9 |
+ (int64_t) params[i].value.l);
|
|
|
9119d9 |
break;
|
|
|
9119d9 |
case VIR_TYPED_PARAM_ULLONG:
|
|
|
9119d9 |
- printf("\t%s: " LLU_FORMAT "\n", params[i].field, params[i].value.ul);
|
|
|
9119d9 |
+ printf("\t%s: %" PRIu64 "\n", params[i].field,
|
|
|
9119d9 |
+ (uint64_t) params[i].value.ul);
|
|
|
9119d9 |
break;
|
|
|
9119d9 |
case VIR_TYPED_PARAM_DOUBLE:
|
|
|
9119d9 |
printf("\t%s: %g\n", params[i].field, params[i].value.d);
|
|
|
9119d9 |
--
|
|
|
9119d9 |
2.1.1
|
|
|
9119d9 |
|