qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: qemu-devel@nongnu.org
Cc: "Denis V . Lunev" <den@openvz.org>,
	Denis Plotnikov <den-plotnikov@yandex-team.ru>,
	Yan Vugenfirer <yvugenfi@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: [PATCH 1/1] qxl: add subsystem_vendor_id property
Date: Wed, 28 Sep 2022 17:52:44 +0200	[thread overview]
Message-ID: <20220928155244.1837455-1-den@openvz.org> (raw)

This property is needed for WHQL/inboxing of Windows drivers. We do need
to get drivers to be separated by the hypervisor vendors and that should
be done as PCI subvendor ID.

This patch adds PCI subsystem vendor ID to QXL device to match that
convention.

The original version of this code has been written by Denis Plotnikov
while he has been working in Virtuozzo.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Denis Plotnikov <den-plotnikov@yandex-team.ru>
CC: Yan Vugenfirer <yvugenfi@redhat.com>
CC: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/display/qxl.c | 4 ++++
 hw/display/qxl.h | 1 +
 2 files changed, 5 insertions(+)

diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 5b10f697f1..ec117aa90f 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -2204,6 +2204,8 @@ static void qxl_realize_common(PCIQXLDevice *qxl, Error **errp)
 
     qxl->update_area_bh = qemu_bh_new(qxl_render_update_area_bh, qxl);
     qxl->ssd.cursor_bh = qemu_bh_new(qemu_spice_cursor_refresh_bh, &qxl->ssd);
+
+    pci_set_word(&config[PCI_SUBSYSTEM_VENDOR_ID], qxl->subsystem_vendor_id);
 }
 
 static void qxl_realize_primary(PCIDevice *dev, Error **errp)
@@ -2469,6 +2471,8 @@ static Property qxl_properties[] = {
         DEFINE_PROP_UINT32("xres", PCIQXLDevice, xres, 0),
         DEFINE_PROP_UINT32("yres", PCIQXLDevice, yres, 0),
         DEFINE_PROP_BOOL("global-vmstate", PCIQXLDevice, vga.global_vmstate, false),
+        DEFINE_PROP_UINT16("subsystem-vendor-id", PCIQXLDevice,
+                            subsystem_vendor_id, PCI_VENDOR_ID_REDHAT_QUMRANET),
         DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/display/qxl.h b/hw/display/qxl.h
index e74de9579d..111edbf0dc 100644
--- a/hw/display/qxl.h
+++ b/hw/display/qxl.h
@@ -126,6 +126,7 @@ struct PCIQXLDevice {
     int                num_dirty_rects;
     QXLRect            dirty[QXL_NUM_DIRTY_RECTS];
     QEMUBH            *update_area_bh;
+    uint16_t           subsystem_vendor_id;
 };
 
 #define TYPE_PCI_QXL "pci-qxl"
-- 
2.34.1



             reply	other threads:[~2022-09-28 16:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 15:52 Denis V. Lunev [this message]
2022-09-29  7:37 ` [PATCH 1/1] qxl: add subsystem_vendor_id property Gerd Hoffmann
2022-10-04  5:41   ` Denis V. Lunev
2022-10-04  8:00     ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220928155244.1837455-1-den@openvz.org \
    --to=den@openvz.org \
    --cc=den-plotnikov@yandex-team.ru \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yvugenfi@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).