From nobody Fri Jan 28 14:33:30 2022 X-Original-To: dev-commits-src-all@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 031E819842A0; Fri, 28 Jan 2022 14:33:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jlg1Q4tFXz3h8b; Fri, 28 Jan 2022 14:33:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643380410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4F026UPUx1BzPnPkfobUbFpaREOmmShd/JCcMeCat8A=; b=u5khfyS1kue973A7FvBYIXMnyAQIf5fFeG6tsKSupAuTE/cjlYAe9oWTfiiOzaLZRFJHXf G3BdVstn0eoymS7RRTtav2Fon1vT+8rqs9NohC6EusxI9gOWKDIPBVg7cJEGLuwiSkc7yD GCoJnNa/ymVL26KMewEGTpT8QqerrZw+N9hJVN2AEDhakX5nn8dgR/25l/zxtEwyTr/svT m+JcNe+IKPJAf64xrNugyJ1FT7DFSWcrl/vGv6YpcQFURaRXEtq54rKB2D7BmB0OEKB/w5 T0S4KJTg/f2bnWPJZNWmyYAAEohko9mNP+x3monenQn/eZ76zuJQR3SQmMxrZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A2F32BC21; Fri, 28 Jan 2022 14:33:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20SEXUc7080949; Fri, 28 Jan 2022 14:33:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20SEXU4p080948; Fri, 28 Jan 2022 14:33:30 GMT (envelope-from git) Date: Fri, 28 Jan 2022 14:33:30 GMT Message-Id: <202201281433.20SEXU4p080948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ryan Moeller Subject: git: 51ce77b26157 - stable/13 - bhyve: ahci: Fix regression with no ports List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 51ce77b261575890d3cecb7529357608b7972ac4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643380410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4F026UPUx1BzPnPkfobUbFpaREOmmShd/JCcMeCat8A=; b=PhLWXuWZdnfqrSYFa1L7EQ2OgRRLoWQeiWxFGRAupvu8KzzPvnHwC2bRXKOg7Jyg1thAhm D78zjVR23Pe8tyxHPiaNJ/6HxHK0ajvtQb0tgoNXtc8mstEA3tOUweur86nmub0b/l4xi9 l2QFJZY8i7xOB4uu0Yzv8pKBFYmJVcO3Dp+RG19kRSLONNgFnmUBZk/ruLuc7XdmwV9rEm MWidJ7E/soR2OneNxXeQgj5aVuzaBe6lHMRybVRBP0kMudayHplM88iVhZf4zkMLGNchFS Kij9F48UkdKD2RRRK19nDKq2Fanj+9nJGwlwwl4NQkTcucGluoIvBAEe/F16sA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643380410; a=rsa-sha256; cv=none; b=Ww6FPVU4tMaNjKYOBqa2FtK9TA5+IeYBy7oRbC0HKwxPKcCGeYW7VfZjPwZ3YChq6n8z7S 9P1ztCZpvtyZ+InTD+miVrPBIXL+eWckniV70KXaKep3e9rsubaYOLsZDkeBvTYKYxPL4I r19Bdmhbnx/zT6GGHXymHs6tbgoCV0N0YFdEhUdkMKow4ccKdOSQzJGgzn0mDCBIWWii2x W5MmoAms3Tpsj59wnqOpKW7ZxhFBxYcie5joupQDZlwOqUHyfyqG49HilJO3A/CcWw2T19 vUHtAR4RBtx9rNHt2eKCeCIuToloycIkFAoKrZXcVW7iN3yTL7durHHEUh2n2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=51ce77b261575890d3cecb7529357608b7972ac4 commit 51ce77b261575890d3cecb7529357608b7972ac4 Author: Ryan Moeller AuthorDate: 2022-01-21 12:59:25 +0000 Commit: Ryan Moeller CommitDate: 2022-01-28 14:32:31 +0000 bhyve: ahci: Fix regression with no ports An AHCI controller may be specified with no connected ports. Avoid dumping core in this case for compatibility with existing VM configs. Reviewed by: khng, jhb Fixes: 621b5090487de Refactor configuration management in bhyve. MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D33969 (cherry picked from commit b252fb24301c1f7e7d83eab631e7d9fa947e227d) --- usr.sbin/bhyve/pci_ahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_ahci.c b/usr.sbin/bhyve/pci_ahci.c index 38ec87c34eed..7f7259abfe66 100644 --- a/usr.sbin/bhyve/pci_ahci.c +++ b/usr.sbin/bhyve/pci_ahci.c @@ -2440,7 +2440,7 @@ pci_ahci_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) slots = 32; ports_nvl = find_relative_config_node(nvl, "port"); - for (p = 0; p < MAX_PORTS; p++) { + for (p = 0; ports_nvl != NULL && p < MAX_PORTS; p++) { struct ata_params *ata_ident = &sc->port[p].ata_ident; char ident[AHCI_PORT_IDENT];