summaryrefslogtreecommitdiffstats
path: root/auto-virtserial-guest.c
diff options
context:
space:
mode:
Diffstat (limited to 'auto-virtserial-guest.c')
-rw-r--r--auto-virtserial-guest.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/auto-virtserial-guest.c b/auto-virtserial-guest.c
index 85d5758..9ceda19 100644
--- a/auto-virtserial-guest.c
+++ b/auto-virtserial-guest.c
@@ -252,6 +252,17 @@ static int close_port(int nr)
return ret;
}
+static int seek_port(int nr)
+{
+ int ret;
+
+ ret = lseek(g_open_fds[nr], 20, SEEK_SET);
+ if (ret < 0)
+ ret = -errno;
+
+ return ret;
+}
+
static int set_port_nonblocking(int val)
{
int ret, flags;
@@ -716,6 +727,9 @@ back_to_open:
case KEY_SHUTDOWN:
system("shutdown -h now");
break;
+ case KEY_LSEEK:
+ ret = seek_port(gpkt.value);
+ send_report(cfd, ret);
default:
send_report(cfd, -ERANGE);
break;