diff mbox

[13/33] kvm tools: improve framebuffer manager initialization

Message ID 1346833927-15740-14-git-send-email-levinsasha928@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sasha Levin Sept. 5, 2012, 8:31 a.m. UTC
Make the init and exit functions of the framebuffer similar to the rest
of the code.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/builtin-run.c             | 6 ++++--
 tools/kvm/framebuffer.c             | 6 ++++--
 tools/kvm/include/kvm/framebuffer.h | 4 ++--
 3 files changed, 10 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
index 8b332c1..569c934 100644
--- a/tools/kvm/builtin-run.c
+++ b/tools/kvm/builtin-run.c
@@ -1197,7 +1197,7 @@  static int kvm_cmd_run_init(int argc, const char **argv)
 		}
 	}
 
-	r = fb__start();
+	r = fb__init(kvm);
 	if (r < 0) {
 		pr_err("fb__init() failed with error %d\n", r);
 		goto fail;
@@ -1258,7 +1258,9 @@  static void kvm_cmd_run_exit(int guest_ret)
 	if (r < 0)
 		pr_warning("irq__exit() failed with error %d\n", r);
 
-	fb__stop();
+	r = fb__exit(kvm);
+	if (r < 0)
+		pr_warning("fb__exit() failed with error %d\n", r);
 
 	r = virtio_scsi_exit(kvm);
 	if (r < 0)
diff --git a/tools/kvm/framebuffer.c b/tools/kvm/framebuffer.c
index e15b717..a9d6f75 100644
--- a/tools/kvm/framebuffer.c
+++ b/tools/kvm/framebuffer.c
@@ -44,7 +44,7 @@  static int start_targets(struct framebuffer *fb)
 	return 0;
 }
 
-int fb__start(void)
+int fb__init(struct kvm *kvm)
 {
 	struct framebuffer *fb;
 
@@ -59,7 +59,7 @@  int fb__start(void)
 	return 0;
 }
 
-void fb__stop(void)
+int fb__exit(struct kvm *kvm)
 {
 	struct framebuffer *fb;
 
@@ -72,4 +72,6 @@  void fb__stop(void)
 
 		munmap(fb->mem, fb->mem_size);
 	}
+
+	return 0;
 }
diff --git a/tools/kvm/include/kvm/framebuffer.h b/tools/kvm/include/kvm/framebuffer.h
index 64f6a26..e3200e5 100644
--- a/tools/kvm/include/kvm/framebuffer.h
+++ b/tools/kvm/include/kvm/framebuffer.h
@@ -30,7 +30,7 @@  struct framebuffer {
 
 struct framebuffer *fb__register(struct framebuffer *fb);
 int fb__attach(struct framebuffer *fb, struct fb_target_operations *ops);
-int fb__start(void);
-void fb__stop(void);
+int fb__init(struct kvm *kvm);
+int fb__exit(struct kvm *kvm);
 
 #endif /* KVM__FRAMEBUFFER_H */