git: 487c84bb61d4 - stable/13 - bhyve/block_if: allow DIOCGMEDIASIZE ioctl

From: Robert Wing <rew_at_FreeBSD.org>
Date: Wed, 23 Feb 2022 17:45:36 UTC
The branch stable/13 has been updated by rew:

URL: https://cgit.FreeBSD.org/src/commit/?id=487c84bb61d4f06ef2cf98f806d348952f327cae

commit 487c84bb61d4f06ef2cf98f806d348952f327cae
Author:     Robert Wing <rew@FreeBSD.org>
AuthorDate: 2022-01-25 16:44:13 +0000
Commit:     Robert Wing <rew@FreeBSD.org>
CommitDate: 2022-02-23 17:45:32 +0000

    bhyve/block_if: allow DIOCGMEDIASIZE ioctl
    
    This is needed to get mediasize of the device after a resize event.
    
    I missed this earlier as I was building WITH_BHYVE_SNAPSHOT, which
    disables capsicum.
    
    Reviewed by:    khng, markj
    Fixes: ae9ea22e14bf ("bhyve: get mediasize for character devices when ...")
    Differential Revision:  https://reviews.freebsd.org/D34013
    
    (cherry picked from commit 08cb63a12fd9c0e575ee489353b53d53b4a45411)
---
 usr.sbin/bhyve/block_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/bhyve/block_if.c b/usr.sbin/bhyve/block_if.c
index 0d41b5175166..89964969c1ee 100644
--- a/usr.sbin/bhyve/block_if.c
+++ b/usr.sbin/bhyve/block_if.c
@@ -468,7 +468,7 @@ blockif_open(nvlist_t *nvl, const char *ident)
 
 #ifndef WITHOUT_CAPSICUM
 	cap_rights_t rights;
-	cap_ioctl_t cmds[] = { DIOCGFLUSH, DIOCGDELETE };
+	cap_ioctl_t cmds[] = { DIOCGFLUSH, DIOCGDELETE, DIOCGMEDIASIZE };
 #endif
 
 	pthread_once(&blockif_once, blockif_init);