Skip to contentSkip to conversation

Char patches

GIT PULL Applied Marc-André Lureau 2 participants 5 messages Jun 8, 2017 – Jun 13, 2017

lore
Share & tools
lore
#0 lore raw

The following changes since commit 64175afc695c0672876fbbfc31b299c86d562cb4:

arm_gicv3: Fix ICC_BPR1 reset value when EL3 not implemented (2017-06-07 17:21:44 +0100)

are available in the git repository at:

https://github.com/elmarco/qemu.git tags/char-pull-request

for you to fetch changes up to 27d4c3789ddde40e1c7280150b46eb20a6a892e6:

test-char: start a /char/serial test (2017-06-08 17:58:13 +0400)

----------------------------------------------------------------

----------------------------------------------------------------

Marc-André Lureau (3):
char: fix alias devices regression
chardev: don't use alias names in parse_compat()
test-char: start a /char/serial test

 include/chardev/char-parallel.h |  5 -----
 include/chardev/char-serial.h   |  8 --------
 include/qemu/osdep.h            | 13 +++++++++++++
 chardev/char.c                  |  4 ++--
 tests/test-char.c               | 29 +++++++++++++++++++++++++++++
 5 files changed, 44 insertions(+), 15 deletions(-)
Signature · 1 line
2.13.0.91.g00982b8dd
#1 lore raw

[Qemu-devel] [PULL 2/3] chardev: don't use alias names in parse_compat()

"parport" is considered "old" since commit 88a946d32d, when "parallel" was added. Similarly for "tty" in commit d59044ef74d.

---
 chardev/char.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
chardev/char.c +2 -2
index 7aa0210765..bcfc065d16 100644
@@ -450,12 +450,12 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename)
     }
     if (strstart(filename, "/dev/parport", NULL) ||
         strstart(filename, "/dev/ppi", NULL)) {
-        qemu_opt_set(opts, "backend", "parport", &error_abort);
+        qemu_opt_set(opts, "backend", "parallel", &error_abort);
         qemu_opt_set(opts, "path", filename, &error_abort);
         return opts;
     }
     if (strstart(filename, "/dev/", NULL)) {
-        qemu_opt_set(opts, "backend", "tty", &error_abort);
+        qemu_opt_set(opts, "backend", "serial", &error_abort);
         qemu_opt_set(opts, "path", filename, &error_abort);
         return opts;
     }
Signature · 1 line
2.13.0.91.g00982b8dd
#2 lore raw

[Qemu-devel] [PULL 1/3] char: fix alias devices regression

In reply to Marc-André Lureau

Fix regression from commit 4d43a603c71, where the serial and parallel headers got removed from char.c, which broke the alias table.

Move the HAVE_CHARDEV_SERIAL/HAVE_CHARDEV_PARPORT to osdep.h instead of being in separate headers.

---
 include/chardev/char-parallel.h |  5 -----
 include/chardev/char-serial.h   |  8 --------
 include/qemu/osdep.h            | 13 +++++++++++++
 3 files changed, 13 insertions(+), 13 deletions(-)
include/chardev/char-parallel.h +0 -5
index 3284a1b96b..c09751fd6c 100644
@@ -26,11 +26,6 @@
 
 #include "chardev/char.h"
 
-#if defined(__linux__) || defined(__FreeBSD__) ||               \
-    defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-#define HAVE_CHARDEV_PARPORT 1
-#endif
-
 #define CHR_IOCTL_PP_READ_DATA        3
 #define CHR_IOCTL_PP_WRITE_DATA       4
 #define CHR_IOCTL_PP_READ_CONTROL     5
include/chardev/char-serial.h +0 -8
index cb2e59e82a..ad6891b26d 100644
@@ -26,14 +26,6 @@
 
 #include "chardev/char.h"
 
-#ifdef _WIN32
-#define HAVE_CHARDEV_SERIAL 1
-#elif defined(__linux__) || defined(__sun__) || defined(__FreeBSD__)    \
-    || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) \
-    || defined(__GLIBC__)
-#define HAVE_CHARDEV_SERIAL 1
-#endif
-
 #define CHR_IOCTL_SERIAL_SET_PARAMS   1
 typedef struct {
     int speed;
include/qemu/osdep.h +13 -0
index 1c9f5e260c..fb008a2e65 100644
@@ -284,6 +284,19 @@ void qemu_anon_ram_free(void *ptr, size_t size);
 
 #endif
 
+#ifdef _WIN32
+#define HAVE_CHARDEV_SERIAL 1
+#elif defined(__linux__) || defined(__sun__) || defined(__FreeBSD__)    \
+    || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) \
+    || defined(__GLIBC__)
+#define HAVE_CHARDEV_SERIAL 1
+#endif
+
+#if defined(__linux__) || defined(__FreeBSD__) ||               \
+    defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+#define HAVE_CHARDEV_PARPORT 1
+#endif
+
 #if defined(CONFIG_LINUX)
 #ifndef BUS_MCEERR_AR
 #define BUS_MCEERR_AR 4
Signature · 1 line
2.13.0.91.g00982b8dd
#3 lore raw

[Qemu-devel] [PULL 3/3] test-char: start a /char/serial test

In reply to Marc-André Lureau

Quite limited test, to check that the chardev can be created with a path and with the tty alias.

---
 tests/test-char.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
tests/test-char.c +29 -0
index dfe856cb85..9e361c8d09 100644
@@ -450,6 +450,32 @@ static void char_udp_test(void)
     g_free(tmp);
 }
 
+#ifdef HAVE_CHARDEV_SERIAL
+static void char_serial_test(void)
+{
+    QemuOpts *opts;
+    Chardev *chr;
+
+    opts = qemu_opts_create(qemu_find_opts("chardev"), "serial-id",
+                            1, &error_abort);
+    qemu_opt_set(opts, "backend", "serial", &error_abort);
+    qemu_opt_set(opts, "path", "/dev/null", &error_abort);
+
+    chr = qemu_chr_new_from_opts(opts, NULL);
+    g_assert_nonnull(chr);
+    /* TODO: add more tests with a pty */
+    object_unparent(OBJECT(chr));
+
+    /* test tty alias */
+    qemu_opt_set(opts, "backend", "tty", &error_abort);
+    chr = qemu_chr_new_from_opts(opts, NULL);
+    g_assert_nonnull(chr);
+    object_unparent(OBJECT(chr));
+
+    qemu_opts_del(opts);
+}
+#endif
+
 static void char_file_test(void)
 {
     char *tmp_path = g_dir_make_tmp("qemu-test-char.XXXXXX", NULL);
@@ -597,6 +623,9 @@ int main(int argc, char **argv)
     g_test_add_func("/char/file", char_file_test);
     g_test_add_func("/char/socket", char_socket_test);
     g_test_add_func("/char/udp", char_udp_test);
+#ifdef HAVE_CHARDEV_SERIAL
+    g_test_add_func("/char/serial", char_serial_test);
+#endif
 
     return g_test_run();
 }
Signature · 1 line
2.13.0.91.g00982b8dd
#4 lore raw
In reply to Marc-André Lureau
Quoted 6 lines · Marc-André Lureau

The following changes since commit 64175afc695c0672876fbbfc31b299c86d562cb4:

arm_gicv3: Fix ICC_BPR1 reset value when EL3 not implemented (2017-06-07 17:21:44 +0100)

are available in the git repository at:

Quoted 8 lines

https://github.com/elmarco/qemu.git tags/char-pull-request

for you to fetch changes up to 27d4c3789ddde40e1c7280150b46eb20a6a892e6:

test-char: start a /char/serial test (2017-06-08 17:58:13 +0400)

----------------------------------------------------------------

Applied, thanks.

-- PMM