From 5a023bd2a53a7279b126ae6bf949560c6342b57a Mon Sep 17 00:00:00 2001 From: Robert Wing Date: Mon, 5 Dec 2022 08:22:45 -0900 Subject: [PATCH] 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 --- 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);