summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--auto-virtserial-guest.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/auto-virtserial-guest.c b/auto-virtserial-guest.c
index cfa90b7..53d815d 100644
--- a/auto-virtserial-guest.c
+++ b/auto-virtserial-guest.c
@@ -35,7 +35,8 @@
#include <sys/wait.h>
#include "virtserial.h"
-#define CONTROL_PORT "/dev/vport0p1"
+#define CONTROL_PORT "/dev/virtio-ports/test0"
+#define CONTROL_PORT2 "/dev/vport0p1"
#define MAX_PORTS 10
/* The fd to work with for read / write requests. Set by the open message */
@@ -604,13 +605,21 @@ int main(int argc, char *argv[])
install_sigio_handler();
ret = access(CONTROL_PORT, R_OK|W_OK);
- if (ret == -1)
- error(errno, errno, "No control port found %s", CONTROL_PORT);
+ if (ret == -1) {
+ ret = access(CONTROL_PORT2, R_OK|W_OK);
+ if (ret == -1) {
+ error(errno, errno, "No control port found %s or %s", CONTROL_PORT, CONTROL_PORT2);
+ }
+ }
back_to_open:
cfd = open(CONTROL_PORT, O_RDWR);
- if (cfd == -1)
- error(errno, errno, "open control port %s", CONTROL_PORT);
+ if (cfd == -1) {
+ cfd = open(CONTROL_PORT2, O_RDWR);
+ if (cfd == -1) {
+ error(errno, errno, "open control port %s", CONTROL_PORT);
+ }
+ }
gpkt.key = KEY_STATUS_OK;
gpkt.value = 1;