-----BEGIN PGP SIGNATURE-----
iQIcBAABAgAGBQJZOVs7AAoJENro4Ql1lpzl/gsQAIVWul5PYhEyUphev1uZH+e0 8qLSYFeLhtBNYJgXN4Hvop038vWspKrtUb2k3cCHduSUa/LDNnlafCZbb+iXlWa3 ItDzxSwAN8wMD5+8jYSEiBorzXHe0q1GV33MqYd/cs0su7ZzwrvLsCFabgqjRDrm RRasVmO8ZJU9VPcOl8Vq+7gAu69VS4aCDGU5GAJG2VFghIQxE5KD8pLPrMW2+/+k qJRbLNDyMkFQig+AR5DRggvtFKx+QWRaSOo7FoMeVBG8sgo5mbjrVHIi11KWcPUf nEsjhbLpgAr0+p+eIQKs6/Y5w/e9m3jL+IbKiVAJsARpV/4cu6j2f2URu7UCd1Gs iPT1Vrw8bmULOx+6gTHvmhZS2Qt6rxPWxQnzY2ogSlyAZR6fco+SIJS/quNiWyG1 iTDySYWACbbqk0V2eOyCQK5aZocrkvwpK+ChQicODWrKYkap/myHTJtMljPFNgTh yU0AgMw/oJYQEc5734hT4+7k7tqSzGR7HMVjdnoTMMG0B5x5eCJbJfLxTAbSjfL5 6QngGiJwDuRKjeAxTN4xIoI4CHx+xlFx4eiw3cGU8yVhWNTjcNTYfm+CcVUox1U9 pzSsms+r0tYYgBUtDeFtoYUk4UTHRCVbDAZQSPznXTm5xwn47Y9MAIa9C5zh9IDb caerF+Mituu90chKk63Z =CXN6 -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/elmarco/tags/char-pull-request' into staging # gpg: Signature made Thu 08 Jun 2017 15:12:11 BST # gpg: using RSA key 0xDAE8E10975969CE5 # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" # gpg: aka "Marc-André Lureau <marcandre.lureau@gmail.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 87A9 BD93 3F87 C606 D276 F62D DAE8 E109 7596 9CE5 * remotes/elmarco/tags/char-pull-request: test-char: start a /char/serial test chardev: don't use alias names in parse_compat() char: fix alias devices regression Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
9bba618f18
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user