ssh-generator: handle gracefully if AF_VSOCK works, but /dev/vsock doesn't
Apparently this case exists, let's handle it gracefully. Prompted by: https://github.com/systemd/systemd/pull/31544#issuecomment-1971241397
This commit is contained in:
@@ -207,8 +207,14 @@ static int add_vsock_socket(
|
||||
/* Determine the local CID so that we can log it to help users to connect to this VM */
|
||||
unsigned local_cid;
|
||||
r = vsock_get_local_cid(&local_cid);
|
||||
if (r < 0)
|
||||
if (r < 0) {
|
||||
if (ERRNO_IS_DEVICE_ABSENT(r)) {
|
||||
log_debug("Not creating AF_VSOCK ssh listener, since /dev/vsock is not available (even though AF_VSOCK is).");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return log_error_errno(r, "Failed to query local AF_VSOCK CID: %m");
|
||||
}
|
||||
|
||||
r = make_sshd_template_unit(
|
||||
dest,
|
||||
|
||||
Reference in New Issue
Block a user