From patchwork Wed Sep 5 08:31:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 1406531 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D7DC740220 for ; Wed, 5 Sep 2012 08:32:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758105Ab2IEIc4 (ORCPT ); Wed, 5 Sep 2012 04:32:56 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:49279 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758095Ab2IEIcx (ORCPT ); Wed, 5 Sep 2012 04:32:53 -0400 Received: by weyx8 with SMTP id x8so221301wey.19 for ; Wed, 05 Sep 2012 01:32:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=LEwNMQL6ToWu3MqAI4VonNDRAoDKs6qG/nUMT0d1lrU=; b=UBTTqu6cENv454S+ON51tHClxCiiPBUWI8Du+ImqwoZQLlau7yu3pomime/kmsuRWL SIBu20NQxGWP56mgeYdBXHfe176G6qcvriweW2I/RMmGDeQMKhlsBKKBF6Xu6LRcTL6X M18clj2nV2TS+nbQQnKGXD5U5IA++7Mpg0002nCTvEtNSIVfWg4IwQMlVzSn1F7AtdYr T8a+n46ljVX4As8kYzM8lEA/kmrNgQYWXgtqRzH2Ez7eERplF55B8hEi5ndL3XwYjvmD WuJpV3r30reylMfkCMi8q9A22AVCehBv6DGYII6zE1fe5uyxm5coQ2cl48sCUWG+ilgU nmwQ== Received: by 10.216.54.146 with SMTP id i18mr12688986wec.187.1346833972574; Wed, 05 Sep 2012 01:32:52 -0700 (PDT) Received: from lappy.capriciverd.com (20.Red-80-59-140.staticIP.rima-tde.net. [80.59.140.20]) by mx.google.com with ESMTPS id q4sm27971068wix.9.2012.09.05.01.32.49 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Sep 2012 01:32:51 -0700 (PDT) From: Sasha Levin To: penberg@kernel.org Cc: asias.hejun@gmail.com, mingo@elte.hu, gorcunov@openvz.org, kvm@vger.kernel.org, Sasha Levin Subject: [PATCH 13/33] kvm tools: improve framebuffer manager initialization Date: Wed, 5 Sep 2012 10:31:47 +0200 Message-Id: <1346833927-15740-14-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1346833927-15740-1-git-send-email-levinsasha928@gmail.com> References: <1346833927-15740-1-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Make the init and exit functions of the framebuffer similar to the rest of the code. Signed-off-by: Sasha Levin --- 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 --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 */