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
This commit is contained in:
Robert Wing 2022-12-05 08:22:45 -09:00
parent dacbe4d533
commit 5a023bd2a5

View File

@ -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);