From nobody Sun Jul 13 13:43:10 2025 X-Original-To: freebsd-virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bg6Cm6Xfyz610C9 for ; Sun, 13 Jul 2025 13:45:40 +0000 (UTC) (envelope-from bogorodskiy@gmail.com) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg6Cl5G2gz3hWy for ; Sun, 13 Jul 2025 13:45:39 +0000 (UTC) (envelope-from bogorodskiy@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=cKh53Gol; spf=pass (mx1.freebsd.org: domain of bogorodskiy@gmail.com designates 2a00:1450:4864:20::52f as permitted sender) smtp.mailfrom=bogorodskiy@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-60700a745e5so7236303a12.3 for ; Sun, 13 Jul 2025 06:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752414333; x=1753019133; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=lAfGdwHHeYqJ8TGcakq0bJ2fuHdYqVYwsf+ui5+S2IY=; b=cKh53GolgVHURVsf+t2TpPrG/xwlnXbmTkGxGMxzv+3IjOv3uSdktBRsuQKXnfvSl2 aGN4kd+UHfOkCQcCXJKZkI347qmRTveLFCdXs0zYg1UP6zcBWM6g5RwbuDb3XdE+gsE4 H5CoN5xapN6QaFjCM26GTqDNPgUkVly4W1c+/IZQWWkarepHn9+my2Cg9v4qMgHTCq/G y/x89y6AhPBiUxUkdtWqjfJGn9QekaWuiENeOaZNbH0ElhoCPqV7x2GCAu74IczEPhI/ xQ8hgnkOvzYcIu4THDBDAah+wB6uRSVFB3t4Lnq+2pC24UMsROm8miK2tG/aLYpvwo0s LZSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752414333; x=1753019133; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lAfGdwHHeYqJ8TGcakq0bJ2fuHdYqVYwsf+ui5+S2IY=; b=JJnWCi92e6Un+RmEJuYMWFf8g8Mx+EE52WlZ30/8zXi8gPU7u2bwwXx7e9jlRsvw91 AbvB1mIfqEWpRz5jdYqXfuxzmuaD+5Smo0SAwhG4/p7CDsW8Y93f0JID03Xkox5avRBy YSSrjnhLCETxNvxLcazt62Zhm9RiTSiLuALcQgeoOoy5YFsfJ4qVdwu2DiljIYiwJl4p 2c1Fqp0C2CRpCSORNhNe+3MArKcnydgX4RelTR3qsdrsGyzZw8OKtrJlOE3OBp6x9VrT 7AELZPXtNZGtAqZhQfLzeq2B0LwP42/ZdAF2Gn27+FMm5JFL5YQ2GXjQcfHBhcWbUThK /Lww== X-Gm-Message-State: AOJu0YwGRU+SmTPIm20AkA8X2PSaKQVjEsJ4qDk5ASghj8epZFjD2ZJc 58yXXmlboR4Y4A7ZC1sShBWSt+eIoZNGSKrflykYcLimW1aPDxxsT8FJ0IwrPFOKXIrkZQ== X-Gm-Gg: ASbGncvKLkxoM22HMjA5IzB4THNlPquPKloMJJaDlB9fAX+GKgIeSX/T1SofzNG7F49 5CYt6hdFpCCilUicNuW+/Tm2RrcdKOLq/5YxuREZEcZ8qi0n9x6fgr4OAXaiIljm5isUEw5wS6/ ajJ6reMCC6M9WgToHCLcAM9XQyqsT0ffZDljzQ2VBcbWLmFwV78oTb5KErAVqT9XHq07C8DXsVm n+pBWBrwwXYbogwiWcUe0rN0LIUphDZ/dwdQ6xaLjGf1gMN/13OJCHcJbSD8uwvKIZY/xVHI83H /YtkzMNmSZ9x5tLMXSEAkDExMuMuLI0nM/W/bnYpOqlJn9DyxUo9oVUW57vQNYtetNlwqRuV65v XqtWdkcuvUqBNTbPsr01DGibTXxNXU5XoGHAMKWvmQQvdwnlrM0Zi X-Google-Smtp-Source: AGHT+IEiMKJkkP9TJANHC1HL5NhVA2eJqRfLF1sA6/EHJ89d0ASVjp/3N+WS/D9FArxrk7MIhMYhDA== X-Received: by 2002:a17:906:dc8c:b0:ae0:d97d:7fa0 with SMTP id a640c23a62f3a-ae6fcbc283dmr725486866b.38.1752414332789; Sun, 13 Jul 2025 06:45:32 -0700 (PDT) Received: from tulp (80-115-115-199.cable.dynamic.v4.ziggo.nl. [80.115.115.199]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ae6e7ee4607sm663576166b.57.2025.07.13.06.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Jul 2025 06:45:32 -0700 (PDT) Date: Sun, 13 Jul 2025 15:43:10 +0200 From: Roman Bogorodskiy To: John-Mark Gurney Cc: freebsd-virtualization@freebsd.org Subject: Re: bhyve: detecting TCP console support Message-ID: References: <20250620014734.GC4297@funkthat.com> List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-virtualization@freebsd.org Sender: owner-freebsd-virtualization@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250620014734.GC4297@funkthat.com> X-Spamd-Result: default: False [-0.41 / 15.00]; NEURAL_SPAM_LONG(1.00)[0.998]; NEURAL_HAM_MEDIUM(-0.95)[-0.954]; NEURAL_HAM_SHORT(-0.86)[-0.858]; MID_RHS_NOT_FQDN(0.50)[]; FORGED_SENDER(0.30)[novel@freebsd.org,bogorodskiy@gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MISSING_XM_UA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[novel@freebsd.org,bogorodskiy@gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; MLMMJ_DEST(0.00)[freebsd-virtualization@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::52f:from] X-Rspamd-Queue-Id: 4bg6Cl5G2gz3hWy X-Spamd-Bar: / John-Mark Gurney wrote: > Roman Bogorodskiy wrote this message on Thu, Jun 19, 2025 at 18:50 +0200: > > Hi, > > > > Is there a way to check if the given bhyve binary supports tcp console, > > such as "... -l com1,tcp="? > > > > I've been using various workarounds to detect bhyve features for quite > > some time, including parsing of the "bhyve -h" output or running "bhyve > > -s 0," and see if reports unknown device etc, but apparently none > > of that works for the tcp console. > > > > Am I missing something or is it really not possible? > > Likely the current best way is to use `uname -U`, and have a table to > check which version the feature was added. Less than ideal, in that > you'll have to dig that info up, but not entirely terribly hard to do. > > Use git blame to figure out commit hash when a feature was added, then > use: > git show :sys/sys/param.h | grep __FreeBSD_version > > to fetch it. Annoyingly, this will may need to be done for each stable > branch as features are backported. > > This obviously doesn't solve the problem where someone in place upgraded > bhyve, but that shouldn't be common, and if they did that, they should > know that they might break things. It's not terribly hard to do, but cumbersome enough not to do it. Also, it's not quite accurate, obviously, because there's no direct mapping of __FreeBSD_version bumps to bhyve features. Not sure how uncommon is the inplace upgrade usecase, but I use it from time to time to test patches that are not committed yet, and approach like that complicates things. I would not say that the inplace upgrade "breaks things" in this specific case, it's just that approach is not accurate enough. Quite some time ago I've proposed a different approach which I think is more accurate: https://reviews.freebsd.org/D15992. Sadly, it didn't move anywhere, though I was able to work around the lack of feature detection by various hacks like analyzing error message outputs (which is already not super reliable though). TCP console is, unfortunately, the first feature that I wasn't able to find detection workaround for. Roman