c1d5388
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
c1d5388
From: Hans de Goede <hdegoede@redhat.com>
c1d5388
Date: Tue, 19 May 2020 14:33:13 +0200
c1d5388
Subject: [PATCH] virt: vbox: Rename guest_caps struct members to
c1d5388
 set_guest_caps
c1d5388
c1d5388
Rename guest_caps[_tracker] struct members to set_guest_caps[_tracker]
c1d5388
this is a preparation patch for adding support for the
c1d5388
VBGL_IOCTL_GUEST_CAPS_ACQUIRE ioctl.
c1d5388
c1d5388
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
c1d5388
Upstream Status: https://lore.kernel.org/lkml/20200520195440.38759-1-hdegoede@redhat.com/
c1d5388
---
c1d5388
 drivers/virt/vboxguest/vboxguest_core.c | 20 ++++++++++----------
c1d5388
 drivers/virt/vboxguest/vboxguest_core.h |  9 +++++----
c1d5388
 2 files changed, 15 insertions(+), 14 deletions(-)
c1d5388
c1d5388
diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
c1d5388
index 18ebd7a6af98..aee5eff229f2 100644
c1d5388
--- a/drivers/virt/vboxguest/vboxguest_core.c
c1d5388
+++ b/drivers/virt/vboxguest/vboxguest_core.c
c1d5388
@@ -699,17 +699,17 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
c1d5388
 	mutex_lock(&gdev->session_mutex);
c1d5388
c1d5388
 	/* Apply the changes to the session mask. */
c1d5388
-	previous = session->guest_caps;
c1d5388
-	session->guest_caps |= or_mask;
c1d5388
-	session->guest_caps &= ~not_mask;
c1d5388
+	previous = session->set_guest_caps;
c1d5388
+	session->set_guest_caps |= or_mask;
c1d5388
+	session->set_guest_caps &= ~not_mask;
c1d5388
c1d5388
 	/* If anything actually changed, update the global usage counters. */
c1d5388
-	changed = previous ^ session->guest_caps;
c1d5388
+	changed = previous ^ session->set_guest_caps;
c1d5388
 	if (!changed)
c1d5388
 		goto out;
c1d5388
c1d5388
-	vbg_track_bit_usage(&gdev->guest_caps_tracker, changed, previous);
c1d5388
-	or_mask = gdev->guest_caps_tracker.mask;
c1d5388
+	vbg_track_bit_usage(&gdev->set_guest_caps_tracker, changed, previous);
c1d5388
+	or_mask = gdev->set_guest_caps_tracker.mask;
c1d5388
c1d5388
 	if (gdev->guest_caps_host == or_mask || !req)
c1d5388
 		goto out;
c1d5388
@@ -726,9 +726,9 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
c1d5388
 		if (session_termination)
c1d5388
 			goto out;
c1d5388
c1d5388
-		vbg_track_bit_usage(&gdev->guest_caps_tracker, changed,
c1d5388
-				    session->guest_caps);
c1d5388
-		session->guest_caps = previous;
c1d5388
+		vbg_track_bit_usage(&gdev->set_guest_caps_tracker, changed,
c1d5388
+				    session->set_guest_caps);
c1d5388
+		session->set_guest_caps = previous;
c1d5388
 	}
c1d5388
c1d5388
 out:
c1d5388
@@ -1452,7 +1452,7 @@ static int vbg_ioctl_change_guest_capabilities(struct vbg_dev *gdev,
c1d5388
 	if (ret)
c1d5388
 		return ret;
c1d5388
c1d5388
-	caps->u.out.session_caps = session->guest_caps;
c1d5388
+	caps->u.out.session_caps = session->set_guest_caps;
c1d5388
 	caps->u.out.global_caps = gdev->guest_caps_host;
c1d5388
c1d5388
 	return 0;
c1d5388
diff --git a/drivers/virt/vboxguest/vboxguest_core.h b/drivers/virt/vboxguest/vboxguest_core.h
c1d5388
index 77c3a9c8255d..dc745a033164 100644
c1d5388
--- a/drivers/virt/vboxguest/vboxguest_core.h
c1d5388
+++ b/drivers/virt/vboxguest/vboxguest_core.h
c1d5388
@@ -118,11 +118,12 @@ struct vbg_dev {
c1d5388
 	u32 event_filter_host;
c1d5388
c1d5388
 	/**
c1d5388
-	 * Usage counters for guest capabilities. Indexed by capability bit
c1d5388
+	 * Usage counters for guest capabilities requested through
c1d5388
+	 * vbg_set_session_capabilities(). Indexed by capability bit
c1d5388
 	 * number, one count per session using a capability.
c1d5388
 	 * Protected by session_mutex.
c1d5388
 	 */
c1d5388
-	struct vbg_bit_usage_tracker guest_caps_tracker;
c1d5388
+	struct vbg_bit_usage_tracker set_guest_caps_tracker;
c1d5388
 	/**
c1d5388
 	 * The guest capabilities last reported to the host (or UINT32_MAX).
c1d5388
 	 * Protected by session_mutex.
c1d5388
@@ -164,11 +165,11 @@ struct vbg_session {
c1d5388
 	 */
c1d5388
 	u32 event_filter;
c1d5388
 	/**
c1d5388
-	 * Guest capabilities for this session.
c1d5388
+	 * Guest capabilities set through vbg_set_session_capabilities().
c1d5388
 	 * A capability claimed by any guest session will be reported to the
c1d5388
 	 * host. Protected by vbg_gdev.session_mutex.
c1d5388
 	 */
c1d5388
-	u32 guest_caps;
c1d5388
+	u32 set_guest_caps;
c1d5388
 	/** VMMDEV_REQUESTOR_* flags */
c1d5388
 	u32 requestor;
c1d5388
 	/** Set on CANCEL_ALL_WAITEVENTS, protected by vbg_devevent_spinlock. */
c1d5388
-- 
c1d5388
2.26.2
c1d5388