From nobody Thu Jan 26 22:35:12 2023 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 4P2wWh3Vm5z3cCdr; Thu, 26 Jan 2023 22:35:12 +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 4P2wWh2XdFz4Dwh; Thu, 26 Jan 2023 22:35:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674772512; 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=DEFN9aSe42U4LDvDh0CDmQPEOTLnwt+z3YO/xH8s/6E=; b=EANMzPAZGiBPQL29soetb9tE8HVsanIuEWug0q9PvQKHl0nl8jItp0I25W2OBpQTjx7kAf 3EwSucDNjKgKB4J6Ee7AjrVlvgUHOeJf49KGozGbn5YaqwW/xQ8TKlZjrn7hH+kNBy5WC1 OmC/Fmzic0I1Fu8k0gGe1t9l+t71ERxHyGqCTAHrDUK984QnlHdZzwq8cumW21Cn/p16ew rMonMvx8H5qlRKNn1bmD9mZjE77zRyhvB53maRI4hUEoX6hPGN0Zgbqu5/UWD6xBLuhaMN be5eKV0c5cJQy6yPXskjysTeSizKDstLIHvQF9ewArheToeUat+QVoa1mV5W4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674772512; 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=DEFN9aSe42U4LDvDh0CDmQPEOTLnwt+z3YO/xH8s/6E=; b=kG5PPhfVnlzRkbmUgWa3n1JPozcOQTXbZYCwvODbP9AOUWo5/necVsQJNz2X4GxeKIcQum q2dcimJgjMe/ua0C0vfC6w+Tv48qfDLOckQViuVdg4wF2rOUZSd2E4llLSeUdx8vuiKPcd Zo/wlFuREFwkhh11/x6h805PasJ2pHNRsW4BYvWLMTEjs1wVr1XONd0+TLY7UAFgCgIb+L xkmkN4l0u3SqHYVAyRivmFTSXWPV1FMQZl1pyDxEqyFx7Qg3DSIA7bjmXDu09v2kKQIwM4 F7exaR9ABT4fuibsD3sz5he5lf6We6jZYaDrQpFHXxiaqwvC5Zki1xNcKTzHhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674772512; a=rsa-sha256; cv=none; b=sODDX3gHs6NhU1SHVGDHvH5TzDE3u4ph6KoWakVlW1ix3RQRJBbw7caQtacdQkF+k8Fr0k RfgjnH3g8RQxf0+WGIt82OFgOPe1aIF/rbOya/KNNiXIJh2Gh/l3wwvS8a01p48ZYKvZuh d3l7BAL/+zy66Zf7BquYbtGa2eXvq02ZBF//LUgPAOED8c4rdoctxNyqpkzEvJu0cgB/GW kHFrEH5DLvvHk9n8kk7VUJFiliVv5G7Asug11tQF4tcf0KAu+qaK+GT1s2RLQWpbYWS+No 6mcyqAKIsdlcpqVyAVyswiE61Shu5qbVXaOq6Zzix/WxlVhk2vKKWBZSg5FZug== 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 4P2wWh1X6vzmKB; Thu, 26 Jan 2023 22:35:12 +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 30QMZCDB051804; Thu, 26 Jan 2023 22:35:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30QMZC13051803; Thu, 26 Jan 2023 22:35:12 GMT (envelope-from git) Date: Thu, 26 Jan 2023 22:35:12 GMT Message-Id: <202301262235.30QMZC13051803@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b0bd185dc3f0 - stable/13 - bhyveload: open guest boot disk image O_RDWR 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b0bd185dc3f0e90d4f9d3cd6c6bb9487af282474 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b0bd185dc3f0e90d4f9d3cd6c6bb9487af282474 commit b0bd185dc3f0e90d4f9d3cd6c6bb9487af282474 Author: Robert Wing AuthorDate: 2022-12-05 17:22:45 +0000 Commit: John Baldwin CommitDate: 2023-01-26 22:29:36 +0000 bhyveload: open guest boot disk image O_RDWR When a boot environment has been booted via the bootonce feature, userboot clears the bootonce value from an nvlist but fails to write the updated nvlist back to disk. The failure occurs because bhyveload opens the guest boot disk image O_RDONLY, fix this by opening it O_RDWR. Reviewed by: imp, markj, jhb Differential Revision: https://reviews.freebsd.org/D37274 (cherry picked from commit 5a023bd2a53a7279b126ae6bf949560c6342b57a) --- usr.sbin/bhyveload/bhyveload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyveload/bhyveload.c b/usr.sbin/bhyveload/bhyveload.c index db7d995f2466..1a24b5f0044a 100644 --- a/usr.sbin/bhyveload/bhyveload.c +++ b/usr.sbin/bhyveload/bhyveload.c @@ -690,7 +690,7 @@ disk_open(char *path) if (ndisks >= NDISKS) return (ERANGE); - fd = open(path, O_RDONLY); + fd = open(path, O_RDWR); if (fd < 0) return (errno);