CVS commit: src/sys/dev/vmt

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 20:04:16 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
fix llvm build


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vmt/vmt_subr.c
diff -u src/sys/dev/vmt/vmt_subr.c:1.8 src/sys/dev/vmt/vmt_subr.c:1.9
--- src/sys/dev/vmt/vmt_subr.c:1.8	Wed Mar 20 19:34:24 2024
+++ src/sys/dev/vmt/vmt_subr.c	Tue Apr  2 16:04:16 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: vmt_subr.c,v 1.8 2024/03/20 23:34:24 msaitoh Exp $ */
+/* $NetBSD: vmt_subr.c,v 1.9 2024/04/02 20:04:16 christos Exp $ */
 /* $OpenBSD: vmt.c,v 1.11 2011/01/27 21:29:25 dtucker Exp $ */
 
 /*
@@ -108,7 +108,6 @@ struct vmt_tclo_rpc {
 	{ "Set_Option broadcastIP 1",	vmt_tclo_broadcastip },
 	{ "ping",			vmt_tclo_ping },
 	{ "reset",			vmt_tclo_reset },
-	{ NULL },
 #if 0
 	/* Various unsupported commands */
 	{ "Set_Option autohide 0" },
@@ -130,6 +129,7 @@ struct vmt_tclo_rpc {
 	{ "Time_Synchronize 0" },
 	{ "Vix_1_Relayed_Command \"38cdcae40e075d66\"" },
 #endif
+	{ NULL, NULL },
 };
 
 extern char hostname[MAXHOSTNAMELEN];



CVS commit: src/sys/dev/vmt

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 20:04:16 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
fix llvm build


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:34:24 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
Process all queued messages without delay immediately. From OpenBSD.

 Apply the remaining part of OpenBSD sys/dev/vmt.c rev. 1.22.

 > The VM host might send multiple messages at once but vmt(4) only
 > processed one of time per second.  Change the code to process all
 > queued messages without delay immediately.  This fixes two things: a)
 > the vmt time sensor is available on boot when ntpd -s is loaded and b)
 > the random seeding on resume (OS_Resume message) is executed almost
 > immediately and not delayed by about 20 seconds.

 Apply OpenBSD sys/dev/pv/vmt.c rev. 1.4.

 >  Merge two return branches in vmt_tclo_tick().  No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vmt/vmt_subr.c
diff -u src/sys/dev/vmt/vmt_subr.c:1.7 src/sys/dev/vmt/vmt_subr.c:1.8
--- src/sys/dev/vmt/vmt_subr.c:1.7	Wed Mar 20 23:33:22 2024
+++ src/sys/dev/vmt/vmt_subr.c	Wed Mar 20 23:34:24 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: vmt_subr.c,v 1.7 2024/03/20 23:33:22 msaitoh Exp $ */
+/* $NetBSD: vmt_subr.c,v 1.8 2024/03/20 23:34:24 msaitoh Exp $ */
 /* $OpenBSD: vmt.c,v 1.11 2011/01/27 21:29:25 dtucker Exp $ */
 
 /*
@@ -774,7 +774,11 @@ vmt_tclo_tick(void *xarg)
 	struct vmt_softc *sc = xarg;
 	u_int32_t rlen;
 	u_int16_t ack;
+	int delay;
 
+	/* By default, poll every second for new messages */
+	delay = 1;
+	
 	/* reopen tclo channel if it's currently closed */
 	if (sc->sc_tclo_rpc.channel == 0 &&
 	sc->sc_tclo_rpc.cookie1 == 0 &&
@@ -782,8 +786,8 @@ vmt_tclo_tick(void *xarg)
 		if (vm_rpc_open(>sc_tclo_rpc, VM_RPC_OPEN_TCLO) != 0) {
 			device_printf(sc->sc_dev,
 			"unable to reopen TCLO channel\n");
-			callout_schedule(>sc_tclo_tick, hz * 15);
-			return;
+			delay = 15;
+			goto out;
 		}
 
 		if (vm_rpc_send_str(>sc_tclo_rpc,
@@ -829,6 +833,9 @@ vmt_tclo_tick(void *xarg)
 	}
 	sc->sc_tclo_ping = 0;
 
+	/* The VM host can queue multiple messages; continue without delay */
+	delay = 0;
+
 #ifdef VMT_DEBUG
 	printf("vmware: received message '%s'\n", sc->sc_rpc_buf);
 #endif
@@ -842,10 +849,13 @@ vmt_tclo_tick(void *xarg)
 		}
 	}
 
+	if (sc->sc_rpc_error == 1) {
+		/* On error, give time to recover and wait a second */
+		delay = 1;
+	}
+
 out:
-	/* On error, give time to recover and wait a second */
-	callout_schedule(>sc_tclo_tick,
-	(sc->sc_tclo_ping || sc->sc_rpc_error) ? hz : 1);
+	callout_schedule(>sc_tclo_tick, hz * delay);
 }
 
 static void



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:34:24 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
Process all queued messages without delay immediately. From OpenBSD.

 Apply the remaining part of OpenBSD sys/dev/vmt.c rev. 1.22.

 > The VM host might send multiple messages at once but vmt(4) only
 > processed one of time per second.  Change the code to process all
 > queued messages without delay immediately.  This fixes two things: a)
 > the vmt time sensor is available on boot when ntpd -s is loaded and b)
 > the random seeding on resume (OS_Resume message) is executed almost
 > immediately and not delayed by about 20 seconds.

 Apply OpenBSD sys/dev/pv/vmt.c rev. 1.4.

 >  Merge two return branches in vmt_tclo_tick().  No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:33:23 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
On error, give time to recover and wait a second.

Part of OpenBSD sys/dev/vmt.c rev. 1.22.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vmt/vmt_subr.c
diff -u src/sys/dev/vmt/vmt_subr.c:1.6 src/sys/dev/vmt/vmt_subr.c:1.7
--- src/sys/dev/vmt/vmt_subr.c:1.6	Wed Mar 20 23:33:02 2024
+++ src/sys/dev/vmt/vmt_subr.c	Wed Mar 20 23:33:22 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: vmt_subr.c,v 1.6 2024/03/20 23:33:02 msaitoh Exp $ */
+/* $NetBSD: vmt_subr.c,v 1.7 2024/03/20 23:33:22 msaitoh Exp $ */
 /* $OpenBSD: vmt.c,v 1.11 2011/01/27 21:29:25 dtucker Exp $ */
 
 /*
@@ -843,7 +843,9 @@ vmt_tclo_tick(void *xarg)
 	}
 
 out:
-	callout_schedule(>sc_tclo_tick, sc->sc_tclo_ping ? hz : 1);
+	/* On error, give time to recover and wait a second */
+	callout_schedule(>sc_tclo_tick,
+	(sc->sc_tclo_ping || sc->sc_rpc_error) ? hz : 1);
 }
 
 static void



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:33:23 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
On error, give time to recover and wait a second.

Part of OpenBSD sys/dev/vmt.c rev. 1.22.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:33:02 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
Use a table like OpenBSD vmt.c rev. 1.27. No functional change.

 Add new vmt_tclo_rpc[] table and use it. In this change, all of
vmt_tclo_xxx()'s functionality are not changed from previous.

 Now we can understand what's the difference between OpenBSD's
sys/dev/pv/vmt.c and NetBSD's sys/dev/vmt/vmt_subr.c.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vmt/vmt_subr.c
diff -u src/sys/dev/vmt/vmt_subr.c:1.5 src/sys/dev/vmt/vmt_subr.c:1.6
--- src/sys/dev/vmt/vmt_subr.c:1.5	Wed Mar 20 23:32:17 2024
+++ src/sys/dev/vmt/vmt_subr.c	Wed Mar 20 23:33:02 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: vmt_subr.c,v 1.5 2024/03/20 23:32:17 msaitoh Exp $ */
+/* $NetBSD: vmt_subr.c,v 1.6 2024/03/20 23:33:02 msaitoh Exp $ */
 /* $OpenBSD: vmt.c,v 1.11 2011/01/27 21:29:25 dtucker Exp $ */
 
 /*
@@ -79,10 +79,59 @@ static void vmt_update_guest_uptime(stru
 static void vmt_sync_guest_clock(struct vmt_softc *);
 
 static void vmt_tick(void *);
-static void vmt_tclo_tick(void *);
 static void vmt_clock_sync_tick(void *);
 static void vmt_pswitch_event(void *);
 
+static void vmt_tclo_tick(void *);
+static int vmt_tclo_process(struct vmt_softc *, const char *);
+static void vmt_tclo_reset(struct vmt_softc *);
+static void vmt_tclo_ping(struct vmt_softc *);
+static void vmt_tclo_halt(struct vmt_softc *);
+static void vmt_tclo_reboot(struct vmt_softc *);
+static void vmt_tclo_poweron(struct vmt_softc *);
+static void vmt_tclo_suspend(struct vmt_softc *);
+static void vmt_tclo_resume(struct vmt_softc *);
+static void vmt_tclo_capreg(struct vmt_softc *);
+static void vmt_tclo_broadcastip(struct vmt_softc *);
+
+struct vmt_tclo_rpc {
+	const char	*name;
+	void		(*cb)(struct vmt_softc *);
+} vmt_tclo_rpc[] = {
+	/* Keep sorted by name (case-sensitive) */
+	{ "Capabilities_Register",	vmt_tclo_capreg },
+	{ "OS_Halt",			vmt_tclo_halt },
+	{ "OS_PowerOn",			vmt_tclo_poweron },
+	{ "OS_Reboot",			vmt_tclo_reboot },
+	{ "OS_Resume",			vmt_tclo_resume },
+	{ "OS_Suspend",			vmt_tclo_suspend },
+	{ "Set_Option broadcastIP 1",	vmt_tclo_broadcastip },
+	{ "ping",			vmt_tclo_ping },
+	{ "reset",			vmt_tclo_reset },
+	{ NULL },
+#if 0
+	/* Various unsupported commands */
+	{ "Set_Option autohide 0" },
+	{ "Set_Option copypaste 1" },
+	{ "Set_Option enableDnD 1" },
+	{ "Set_Option enableMessageBusTunnel 0" },
+	{ "Set_Option linkRootHgfsShare 0" },
+	{ "Set_Option mapRootHgfsShare 0" },
+	{ "Set_Option synctime 1" },
+	{ "Set_Option synctime.period 0" },
+	{ "Set_Option time.synchronize.tools.enable 1" },
+	{ "Set_Option time.synchronize.tools.percentCorrection 0" },
+	{ "Set_Option time.synchronize.tools.slewCorrection 1" },
+	{ "Set_Option time.synchronize.tools.startup 1" },
+	{ "Set_Option toolScripts.afterPowerOn 1" },
+	{ "Set_Option toolScripts.afterResume 1" },
+	{ "Set_Option toolScripts.beforePowerOff 1" },
+	{ "Set_Option toolScripts.beforeSuspend 1" },
+	{ "Time_Synchronize 0" },
+	{ "Vix_1_Relayed_Command \"38cdcae40e075d66\"" },
+#endif
+};
+
 extern char hostname[MAXHOSTNAMELEN];
 
 static void
@@ -524,6 +573,202 @@ vmt_pswitch_event(void *xarg)
 }
 
 static void
+vmt_tclo_reset(struct vmt_softc *sc)
+{
+
+	if (sc->sc_rpc_error != 0) {
+		device_printf(sc->sc_dev, "resetting rpc\n");
+		vm_rpc_close(>sc_tclo_rpc);
+
+		/* reopen and send the reset reply next time around */
+		return;
+	}
+
+	if (vm_rpc_send_str(>sc_tclo_rpc, VM_RPC_RESET_REPLY) != 0) {
+		device_printf(sc->sc_dev, "failed to send reset reply\n");
+		sc->sc_rpc_error = 1;
+	}
+
+}
+
+static void
+vmt_tclo_ping(struct vmt_softc *sc)
+{
+
+	vmt_update_guest_info(sc);
+	if (vm_rpc_send_str(>sc_tclo_rpc, VM_RPC_REPLY_OK) != 0) {
+		device_printf(sc->sc_dev, "error sending ping response\n");
+		sc->sc_rpc_error = 1;
+	}
+}
+
+static void
+vmt_tclo_halt(struct vmt_softc *sc)
+{
+
+	vmt_do_shutdown(sc);
+}
+
+static void
+vmt_tclo_reboot(struct vmt_softc *sc)
+{
+
+	vmt_do_reboot(sc);
+}
+
+static void
+vmt_tclo_poweron(struct vmt_softc *sc)
+{
+
+	vmt_tclo_state_change_success(sc, 1, VM_STATE_CHANGE_POWERON);
+	if (vm_rpc_send_str(>sc_tclo_rpc, VM_RPC_REPLY_OK) != 0) {
+		device_printf(sc->sc_dev, "error sending poweron response\n");
+		sc->sc_rpc_error = 1;
+	}
+}
+
+static void
+vmt_tclo_suspend(struct vmt_softc *sc)
+{
+
+	log(LOG_KERN | LOG_NOTICE,
+	"VMware guest entering suspended state\n");
+
+	vmt_tclo_state_change_success(sc, 1, VM_STATE_CHANGE_SUSPEND);
+	if (vm_rpc_send_str(>sc_tclo_rpc, VM_RPC_REPLY_OK) != 0) {
+		device_printf(sc->sc_dev, "error sending suspend response\n");
+		sc->sc_rpc_error = 1;
+	}
+}
+
+static void
+vmt_tclo_resume(struct vmt_softc *sc)
+{
+
+	vmt_do_resume(sc); /* XXX msaitoh extract */
+}
+
+static 

CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:33:02 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
Use a table like OpenBSD vmt.c rev. 1.27. No functional change.

 Add new vmt_tclo_rpc[] table and use it. In this change, all of
vmt_tclo_xxx()'s functionality are not changed from previous.

 Now we can understand what's the difference between OpenBSD's
sys/dev/pv/vmt.c and NetBSD's sys/dev/vmt/vmt_subr.c.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:32:18 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
Move a prototype definition. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:32:18 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
Move a prototype definition. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vmt/vmt_subr.c
diff -u src/sys/dev/vmt/vmt_subr.c:1.4 src/sys/dev/vmt/vmt_subr.c:1.5
--- src/sys/dev/vmt/vmt_subr.c:1.4	Wed Mar 20 23:31:54 2024
+++ src/sys/dev/vmt/vmt_subr.c	Wed Mar 20 23:32:17 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: vmt_subr.c,v 1.4 2024/03/20 23:31:54 msaitoh Exp $ */
+/* $NetBSD: vmt_subr.c,v 1.5 2024/03/20 23:32:17 msaitoh Exp $ */
 /* $OpenBSD: vmt.c,v 1.11 2011/01/27 21:29:25 dtucker Exp $ */
 
 /*
@@ -72,6 +72,7 @@ static int vm_rpci_response_successful(s
 static void vmt_tclo_state_change_success(struct vmt_softc *, int, char);
 static void vmt_do_reboot(struct vmt_softc *);
 static void vmt_do_shutdown(struct vmt_softc *);
+static bool vmt_shutdown(device_t, int);
 
 static void vmt_update_guest_info(struct vmt_softc *);
 static void vmt_update_guest_uptime(struct vmt_softc *);
@@ -80,7 +81,6 @@ static void vmt_sync_guest_clock(struct 
 static void vmt_tick(void *);
 static void vmt_tclo_tick(void *);
 static void vmt_clock_sync_tick(void *);
-static bool vmt_shutdown(device_t, int);
 static void vmt_pswitch_event(void *);
 
 extern char hostname[MAXHOSTNAMELEN];



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:31:54 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:31:54 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vmt/vmt_subr.c
diff -u src/sys/dev/vmt/vmt_subr.c:1.3 src/sys/dev/vmt/vmt_subr.c:1.4
--- src/sys/dev/vmt/vmt_subr.c:1.3	Sat Mar 27 21:23:14 2021
+++ src/sys/dev/vmt/vmt_subr.c	Wed Mar 20 23:31:54 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: vmt_subr.c,v 1.3 2021/03/27 21:23:14 ryo Exp $ */
+/* $NetBSD: vmt_subr.c,v 1.4 2024/03/20 23:31:54 msaitoh Exp $ */
 /* $OpenBSD: vmt.c,v 1.11 2011/01/27 21:29:25 dtucker Exp $ */
 
 /*
@@ -175,14 +175,17 @@ vmt_common_attach(struct vmt_softc *sc)
 	sc->sc_rpc_buf = kmem_alloc(VMT_RPC_BUFLEN, KM_SLEEP);
 
 	if (vm_rpc_open(>sc_tclo_rpc, VM_RPC_OPEN_TCLO) != 0) {
-		aprint_error_dev(self, "failed to open backdoor RPC channel (TCLO protocol)\n");
+		aprint_error_dev(self, "failed to open backdoor RPC channel "
+		"(TCLO protocol)\n");
 		goto free;
 	}
 	sc->sc_tclo_rpc_open = true;
 
 	/* don't know if this is important at all yet */
-	if (vm_rpc_send_rpci_tx(sc, "tools.capability.hgfs_server toolbox 1") != 0) {
-		aprint_error_dev(self, "failed to set HGFS server capability\n");
+	if (vm_rpc_send_rpci_tx(sc,
+	"tools.capability.hgfs_server toolbox 1") != 0) {
+		aprint_error_dev(self,
+		"failed to set HGFS server capability\n");
 		goto free;
 	}
 
@@ -313,7 +316,7 @@ vmt_sysctl_setup_clock_sync(device_t sel
 	rv = sysctl_createv(>sc_log, 0, , _node,
 	CTLFLAG_READWRITE, CTLTYPE_INT, "period",
 	SYSCTL_DESCR("Period, in seconds, at which to update the "
-	"guest's clock"),
+		"guest's clock"),
 	vmt_sysctl_update_clock_sync_period, 0, (void *)sc, 0,
 	CTL_CREATE, CTL_EOL);
 	return rv;
@@ -380,20 +383,23 @@ vmt_update_guest_info(struct vmt_softc *
 	}
 
 	/*
-	 * we're supposed to pass the full network address information back here,
-	 * but that involves xdr (sunrpc) data encoding, which seems a bit unreasonable.
+	 * we're supposed to pass the full network address information back
+	 * here, but that involves xdr (sunrpc) data encoding, which seems
+	 * a bit unreasonable.
 	 */
 
 	if (sc->sc_set_guest_os == 0) {
 		if (vm_rpc_send_rpci_tx(sc, "SetGuestInfo  %d %s %s %s",
-		VM_GUEST_INFO_OS_NAME_FULL, ostype, osrelease, machine_arch) != 0) {
-			device_printf(sc->sc_dev, "unable to set full guest OS\n");
+		VM_GUEST_INFO_OS_NAME_FULL,
+		ostype, osrelease, machine_arch) != 0) {
+			device_printf(sc->sc_dev,
+			"unable to set full guest OS\n");
 			sc->sc_rpc_error = 1;
 		}
 
 		/*
-		 * host doesn't like it if we send an OS name it doesn't recognise,
-		 * so use "other" for i386 and "other-64" for amd64
+		 * Host doesn't like it if we send an OS name it doesn't
+		 * recognise, so use "other" for i386 and "other-64" for amd64.
 		 */
 		if (vm_rpc_send_rpci_tx(sc, "SetGuestInfo  %d %s",
 		VM_GUEST_INFO_OS_NAME, VM_OS_NAME) != 0) {
@@ -442,7 +448,8 @@ vmt_tclo_state_change_success(struct vmt
 {
 	if (vm_rpc_send_rpci_tx(sc, "tools.os.statechange.status %d %d",
 	success, state) != 0) {
-		device_printf(sc->sc_dev, "unable to send state change result\n");
+		device_printf(sc->sc_dev,
+		"unable to send state change result\n");
 		sc->sc_rpc_error = 1;
 	}
 }
@@ -493,8 +500,10 @@ vmt_shutdown(device_t self, int flags)
 {
 	struct vmt_softc *sc = device_private(self);
 
-	if (vm_rpc_send_rpci_tx(sc, "tools.capability.hgfs_server toolbox 0") != 0) {
-		device_printf(sc->sc_dev, "failed to disable hgfs server capability\n");
+	if (vm_rpc_send_rpci_tx(sc,
+	"tools.capability.hgfs_server toolbox 0") != 0) {
+		device_printf(sc->sc_dev,
+		"failed to disable hgfs server capability\n");
 	}
 
 	if (vm_rpc_send(>sc_tclo_rpc, NULL, 0) != 0) {
@@ -526,13 +535,16 @@ vmt_tclo_tick(void *xarg)
 	sc->sc_tclo_rpc.cookie1 == 0 &&
 	sc->sc_tclo_rpc.cookie2 == 0) {
 		if (vm_rpc_open(>sc_tclo_rpc, VM_RPC_OPEN_TCLO) != 0) {
-			device_printf(sc->sc_dev, "unable to reopen TCLO channel\n");
+			device_printf(sc->sc_dev,
+			"unable to reopen TCLO channel\n");
 			callout_schedule(>sc_tclo_tick, hz * 15);
 			return;
 		}
 
-		if (vm_rpc_send_str(>sc_tclo_rpc, VM_RPC_RESET_REPLY) != 0) {
-			device_printf(sc->sc_dev, "failed to send reset reply\n");
+		if (vm_rpc_send_str(>sc_tclo_rpc,
+		VM_RPC_RESET_REPLY) != 0) {
+			device_printf(sc->sc_dev,
+			"failed to send reset reply\n");
 			sc->sc_rpc_error = 1;
 			goto out;
 		} else {
@@ -542,14 +554,16 @@ vmt_tclo_tick(void *xarg)
 
 	if (sc->sc_tclo_ping) {
 		if (vm_rpc_send(>sc_tclo_rpc, NULL, 0) != 0) {
-			device_printf(sc->sc_dev, "failed to send TCLO outgoing ping\n");
+			device_printf(sc->sc_dev,
+			"failed to send TCLO