Skip to contentSkip to conversation

libkvm: dump all errors to stderr

PATCH Applied Jan Kiszka 2 participants 2 messages Apr 30, 2008 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 libkvm: dump all errors to stderr

Minor cleanup I came across while reverting printf instrumentations.

---
 libkvm/libkvm-x86.c |    4 ++--
 libkvm/libkvm.c     |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
libkvm/libkvm-x86.c +2 -2
Index: b/libkvm/libkvm-x86.c
===================================================================
@@ -117,7 +117,7 @@ static int kvm_init_tss(kvm_context_t kv
 		 */
 		r = kvm_set_tss_addr(kvm, 0xfffbd000);
 		if (r < 0) {
-			printf("kvm_init_tss: unable to set tss addr\n");
+			fprintf(stderr, "kvm_init_tss: unable to set tss addr\n");
 			return r;
 		}
 
@@ -157,7 +157,7 @@ int kvm_create_pit(kvm_context_t kvm)
 			if (r >= 0)
 				kvm->pit_in_kernel = 1;
 			else {
-				printf("Create kernel PIC irqchip failed\n");
+				fprintf(stderr, "Create kernel PIC irqchip failed\n");
 				return r;
 			}
 		}
libkvm/libkvm.c +2 -2
Index: b/libkvm/libkvm.c
===================================================================
@@ -368,7 +368,7 @@ void kvm_create_irqchip(kvm_context_t kv
 			if (r >= 0)
 				kvm->irqchip_in_kernel = 1;
 			else
-				printf("Create kernel PIC irqchip failed\n");
+				fprintf(stderr, "Create kernel PIC irqchip failed\n");
 		}
 	}
 #endif
@@ -877,7 +877,7 @@ again:
 	if (r == -1 && errno != EINTR && errno != EAGAIN) {
 		r = -errno;
 		post_kvm_run(kvm, vcpu);
-		printf("kvm_run: %s\n", strerror(-r));
+		fprintf(stderr, "kvm_run: %s\n", strerror(-r));
 		return r;
 	}
 

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

Applied
#1 lore raw
Quoted 3 lines · Jan Kiszka

Minor cleanup I came across while reverting printf instrumentations.

Applied, thanks.

Signature · 8 lines
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone