cloud-hypervisor sockets: use spectrum names

- CONNECT.sock → vsock.sock
- ch.sock → vmm.sock
This commit is contained in:
Else, Someone 2025-10-09 04:22:43 +03:00
parent 6dcbe5b3d7
commit 665fd95d70
4 changed files with 8 additions and 8 deletions

View file

@ -41,7 +41,7 @@ char *extract_uvm(const char *host_string) {
} }
char *result; char *result;
if (asprintf(&result, "%s/uvms/%s/CONNECT.sock", home, &host_string[PREFIX_LEN]) == -1) { if (asprintf(&result, "%s/uvms/%s/vsock.sock", home, &host_string[PREFIX_LEN]) == -1) {
perror("ch-proxy/extract_uvm"); perror("ch-proxy/extract_uvm");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -59,7 +59,7 @@ char *extract_muvm(const char *host_string) {
} }
char *result; char *result;
if (asprintf(&result, "/var/lib/microvms/%s/CONNECT.sock", &host_string[PREFIX_LEN]) == -1) { if (asprintf(&result, "/var/lib/microvms/%s/vsock.sock", &host_string[PREFIX_LEN]) == -1) {
perror("ch-proxy/extract_muvm"); perror("ch-proxy/extract_muvm");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View file

@ -51,8 +51,8 @@ in
"--cmdline=${lib.concatStringsSep " " cfg.cmdline}" "--cmdline=${lib.concatStringsSep " " cfg.cmdline}"
"--kernel=${config.boot.kernelPackages.kernel}/${pkgs.stdenv.hostPlatform.linux-kernel.target}" "--kernel=${config.boot.kernelPackages.kernel}/${pkgs.stdenv.hostPlatform.linux-kernel.target}"
"--initramfs=${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}" "--initramfs=${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}"
"--vsock=cid=4,socket=CONNECT.sock" "--vsock=cid=4,socket=vsock.sock"
"--api-socket=ch.sock" "--api-socket=vmm.sock"
"--serial=tty" "--serial=tty"
"--console=null" "--console=null"
"--watchdog" "--watchdog"
@ -69,7 +69,7 @@ in
mkdir -p "$HOME/uvms/$GUESTNAME" mkdir -p "$HOME/uvms/$GUESTNAME"
cd "$HOME/uvms/$GUESTNAME" cd "$HOME/uvms/$GUESTNAME"
cleanup() { cleanup() {
rm "$HOME/uvms/$GUESTNAME"/{ch,CONNECT}.sock rm "$HOME/uvms/$GUESTNAME"/{vmm,vsock}.sock
} }
exec -a "uuvm/$GUESTNAME" "''${args[@]}" exec -a "uuvm/$GUESTNAME" "''${args[@]}"
''; '';

View file

@ -54,8 +54,8 @@ in
]; ];
systemd.services."microvm@".serviceConfig.ExecStartPost = [ systemd.services."microvm@".serviceConfig.ExecStartPost = [
(pkgs.writeShellScript "microvm-fix-umask" '' (pkgs.writeShellScript "microvm-fix-umask" ''
if [[ -e CONNECT.sock ]] ; then if [[ -e vsock.sock ]] ; then
chmod g+rw CONNECT.sock chmod g+rw vsock.sock
fi fi
'') '')
]; ];

View file

@ -12,7 +12,7 @@ in
(mkIfGuest { (mkIfGuest {
microvm.cloud-hypervisor.extraArgs = [ microvm.cloud-hypervisor.extraArgs = [
"--vsock" "--vsock"
"cid=4,socket=CONNECT.sock" "cid=4,socket=vsock.sock"
]; ];
}) })
{ {