summary refs log tree commit diff
path: root/host/start-vm
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-02-15 23:56:22 +0000
committerAlyssa Ross <hi@alyssa.is>2022-02-15 23:57:09 +0000
commit8950b19069f6f4d9671984844206cacfa73aca79 (patch)
tree7b35017a187433a32d3bd3a542b7f067590e83ce /host/start-vm
parent59fbdfb0d76f03dc920a5eed924704c548e0c933 (diff)
downloadspectrum-8950b19069f6f4d9671984844206cacfa73aca79.tar
spectrum-8950b19069f6f4d9671984844206cacfa73aca79.tar.gz
spectrum-8950b19069f6f4d9671984844206cacfa73aca79.tar.bz2
spectrum-8950b19069f6f4d9671984844206cacfa73aca79.tar.lz
spectrum-8950b19069f6f4d9671984844206cacfa73aca79.tar.xz
spectrum-8950b19069f6f4d9671984844206cacfa73aca79.tar.zst
spectrum-8950b19069f6f4d9671984844206cacfa73aca79.zip
host/start-vm: fix indentation
Diffstat (limited to 'host/start-vm')
-rw-r--r--host/start-vm/ch.h2
-rw-r--r--host/start-vm/meson.build4
-rw-r--r--host/start-vm/net.c18
3 files changed, 12 insertions, 12 deletions
diff --git a/host/start-vm/ch.h b/host/start-vm/ch.h
index 661208d..f9a631c 100644
--- a/host/start-vm/ch.h
+++ b/host/start-vm/ch.h
@@ -6,7 +6,7 @@
 struct ch_device;
 
 int ch_add_net(const char *vm_name, int tap, const uint8_t mac[6],
-	       struct ch_device **out);
+               struct ch_device **out);
 int ch_remove_device(const char *vm_name, struct ch_device *);
 
 void ch_device_free(struct ch_device *);
diff --git a/host/start-vm/meson.build b/host/start-vm/meson.build
index 1bda32b..992f3be 100644
--- a/host/start-vm/meson.build
+++ b/host/start-vm/meson.build
@@ -10,5 +10,5 @@ c_lib = static_library('start-vm-c', 'net.c', 'net-util.c',
 executable('start-vm', 'start-vm.rs', link_with : c_lib, install : true)
 
 test('Rust unit tests', executable('start-vm-test', 'start-vm.rs',
-                                   rust_args : ['--test'],
-                                   link_with : c_lib))
+  rust_args : ['--test'],
+  link_with : c_lib))
diff --git a/host/start-vm/net.c b/host/start-vm/net.c
index ebd6126..916c527 100644
--- a/host/start-vm/net.c
+++ b/host/start-vm/net.c
@@ -25,7 +25,7 @@ static int setup_tap(const char *bridge_name, const char *tap_prefix)
 
 	// We assume ≤16-bit pids.
 	if (snprintf(tap_name, sizeof tap_name, "%s%d",
-		     tap_prefix, getpid()) == -1)
+	             tap_prefix, getpid()) == -1)
 		return -1;
 	if ((fd = tap_open(tap_name, IFF_NO_PI|IFF_VNET_HDR|IFF_TUN_EXCL)) == -1)
 		goto out;
@@ -48,7 +48,7 @@ static int client_net_setup(const char *bridge_name)
 }
 
 static int router_net_setup(const char *bridge_name, const char *router_vm_name,
-			    const uint8_t mac[6], struct ch_device **out)
+                            const uint8_t mac[6], struct ch_device **out)
 {
 	int e, fd = setup_tap(bridge_name, "router");
 	if (fd == -1)
@@ -63,7 +63,7 @@ static int router_net_setup(const char *bridge_name, const char *router_vm_name,
 }
 
 static int router_net_cleanup(pid_t pid, const char *vm_name,
-			      struct ch_device *vm_net_device)
+                              struct ch_device *vm_net_device)
 {
 	int e;
 	char name[IFNAMSIZ], newname[IFNAMSIZ], brname[IFNAMSIZ];
@@ -97,8 +97,8 @@ static int bridge_cleanup(pid_t pid)
 }
 
 static noreturn void exit_listener_main(int fd, pid_t pid,
-					const char *router_vm_name,
-					struct ch_device *router_vm_net_device)
+                                        const char *router_vm_name,
+                                        struct ch_device *router_vm_net_device)
 {
 	// Wait for the other end of the pipe to be closed.
 	int status = EXIT_SUCCESS;
@@ -112,7 +112,7 @@ static noreturn void exit_listener_main(int fd, pid_t pid,
 	assert(pollfd.revents == POLLERR);
 
 	if (router_net_cleanup(pid, router_vm_name,
-			       router_vm_net_device) == -1) {
+	                       router_vm_net_device) == -1) {
 		warn("cleaning up router tap");
 		status = EXIT_FAILURE;
 	}
@@ -125,7 +125,7 @@ static noreturn void exit_listener_main(int fd, pid_t pid,
 }
 
 static int exit_listener_setup(const char *router_vm_name,
-			       struct ch_device *router_vm_net_device)
+                               struct ch_device *router_vm_net_device)
 {
 	pid_t pid = getpid();
 	int fd[2];
@@ -141,7 +141,7 @@ static int exit_listener_setup(const char *router_vm_name,
 	case 0:
 		close(fd[0]);
 		exit_listener_main(fd[1], pid, router_vm_name,
-				   router_vm_net_device);
+		                   router_vm_net_device);
 	default:
 		close(fd[1]);
 		return 0;
@@ -177,7 +177,7 @@ struct net_config net_setup(const char *router_vm_name)
 		goto fail_bridge;
 
 	if (router_net_setup(bridge_name, router_vm_name, router_mac,
-			     &router_vm_net_device) == -1)
+	                     &router_vm_net_device) == -1)
 		goto fail_bridge;
 
 	// Set up a process that will listen for this process dying,