All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandru Elisei <alexandru.elisei@arm.com>
To: kvm@vger.kernel.org
Cc: andre.przywara@arm.com, kvmarm@lists.cs.columbia.edu
Subject: [kvm-unit-tests PATCH 3/7] lib: chr-testdev: Make chr_testdev_init() return status
Date: Thu, 24 Jan 2019 11:16:30 +0000	[thread overview]
Message-ID: <20190124111634.4727-4-alexandru.elisei@arm.com> (raw)
In-Reply-To: <20190124111634.4727-1-alexandru.elisei@arm.com>

Make chr_testdev_init() return 0 (success) if the virtio console was
initialized properly, otherwise return -1 (failure).

Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
 lib/chr-testdev.h | 2 +-
 lib/chr-testdev.c | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/chr-testdev.h b/lib/chr-testdev.h
index ffd9a851aa9b..fdd0582e2da1 100644
--- a/lib/chr-testdev.h
+++ b/lib/chr-testdev.h
@@ -9,6 +9,6 @@
  *
  * This work is licensed under the terms of the GNU LGPL, version 2.
  */
-extern void chr_testdev_init(void);
+extern int chr_testdev_init(void);
 extern void chr_testdev_exit(int code);
 #endif
diff --git a/lib/chr-testdev.c b/lib/chr-testdev.c
index 6890f63c8b29..26e14301e3db 100644
--- a/lib/chr-testdev.c
+++ b/lib/chr-testdev.c
@@ -47,7 +47,7 @@ out:
 	spin_unlock(&lock);
 }
 
-void chr_testdev_init(void)
+int chr_testdev_init(void)
 {
 	const char *io_names[] = { "input", "output" };
 	struct virtqueue *vqs[2];
@@ -57,7 +57,7 @@ void chr_testdev_init(void)
 	if (vcon == NULL) {
 		printf("%s: %s: can't find a virtio-console\n",
 				__func__, TESTDEV_NAME);
-		return;
+		return -1;
 	}
 
 	ret = vcon->config->find_vqs(vcon, 2, vqs, NULL, io_names);
@@ -65,9 +65,11 @@ void chr_testdev_init(void)
 		printf("%s: %s: can't init virtqueues\n",
 				__func__, TESTDEV_NAME);
 		vcon = NULL;
-		return;
+		return -1;
 	}
 
 	in_vq = vqs[0];
 	out_vq = vqs[1];
+
+	return 0;
 }
-- 
2.17.0

  parent reply	other threads:[~2019-01-24 11:16 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-24 11:16 [kvm-unit-tests PATCH 0/7] arm/arm64: Add support for running under kvmtool Alexandru Elisei
2019-01-24 11:16 ` [kvm-unit-tests PATCH 1/7] lib: arm: Discover ns16550a UART Alexandru Elisei
2019-01-24 11:54   ` Andre Przywara
2019-01-24 13:11   ` Andrew Jones
2019-01-25 14:07     ` Alexandru Elisei
2019-01-24 11:16 ` [kvm-unit-tests PATCH 2/7] lib: arm: Remove warning about uart0_base mismatch Alexandru Elisei
2019-01-24 11:59   ` Andre Przywara
2019-01-24 12:37     ` Andrew Jones
2019-01-25 16:36       ` Alexandru Elisei
2019-01-25 16:47         ` Andrew Jones
2019-01-28 14:24           ` Alexandru Elisei
2019-01-28 16:31             ` Andrew Jones
2019-01-28 17:58               ` Andre Przywara
2019-01-29 10:32                 ` Andrew Jones
2019-01-29 11:16               ` Alexandru Elisei
2019-01-29 12:23                 ` Andrew Jones
2019-01-29 13:40                   ` Alexandru Elisei
2019-01-24 11:16 ` Alexandru Elisei [this message]
2019-01-24 12:56   ` [kvm-unit-tests PATCH 3/7] lib: chr-testdev: Make chr_testdev_init() return status Andrew Jones
2019-01-24 11:16 ` [kvm-unit-tests PATCH 4/7] lib: arm: Implement PSCI SYSTEM_OFF in psci_system_off() Alexandru Elisei
2019-01-24 13:01   ` Andrew Jones
2019-01-25 14:08     ` Alexandru Elisei
2019-01-25 14:25       ` Andrew Jones
2019-01-24 11:16 ` [kvm-unit-tests PATCH 5/7] lib: arm: Fallback to psci_system_off() in exit() Alexandru Elisei
2019-01-24 13:00   ` Andrew Jones
2019-01-24 13:35     ` Andrew Jones
2019-01-25 14:56       ` Alexandru Elisei
2019-01-25 15:31         ` Andrew Jones
2019-01-25 15:51           ` Alexandru Elisei
2019-01-25 16:05           ` Andrew Jones
2019-01-25 16:14             ` Andre Przywara
2019-01-25 16:44               ` Alexandru Elisei
2019-01-25 16:50                 ` Andrew Jones
2019-01-25 14:18     ` Alexandru Elisei
2019-01-24 11:16 ` [kvm-unit-tests PATCH 6/7] lib: argv: Implement argv_find() for test parameters Alexandru Elisei
2019-01-24 11:16 ` [kvm-unit-tests PATCH 7/7] arm/arm64: Use argv_find() for test names Alexandru Elisei
2019-01-24 13:07   ` Andrew Jones
2019-01-24 13:43     ` Andre Przywara
2019-01-28 12:16     ` Alexandru Elisei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190124111634.4727-4-alexandru.elisei@arm.com \
    --to=alexandru.elisei@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.