From: Alon Levy <alevy@redhat.com>
To: qemu-devel@nongnu.org
Cc: kraxel@redhat.com
Subject: [Qemu-devel] [PATCH 2/3] hw/qxl: add support for QXL_IO_CAPABILITIES_SET
Date: Tue, 11 Sep 2012 09:56:09 +0300 [thread overview]
Message-ID: <1347346570-2469-2-git-send-email-alevy@redhat.com> (raw)
In-Reply-To: <1347346570-2469-1-git-send-email-alevy@redhat.com>
Guest set capabilities are written to the spice server via
spice_qxl_guest_capabilities_set, provided the compiled against
spice server is new enough to provide this symbol.
QXL device revision will be raised in a later patch to advertise this
support to the guest.
Signed-off-by: Alon Levy <alevy@redhat.com>
---
configure | 7 +++++++
hw/qxl.c | 24 ++++++++++++++++++++++++
trace-events | 1 +
3 files changed, 32 insertions(+)
diff --git a/configure b/configure
index 30be784..d0e3eb1 100755
--- a/configure
+++ b/configure
@@ -2709,6 +2709,9 @@ EOF
if $pkg_config --atleast-version=0.12.0 spice-protocol >/dev/null 2>&1; then
spice_qxl_io_monitors_config_async="yes"
fi
+ if $pkg_config --atleast-version=0.12.2 spice-protocol >/dev/null 2>&1; then
+ spice_qxl_io_client_monitors_config="yes"
+ fi
else
if test "$spice" = "yes" ; then
feature_not_found "spice"
@@ -3456,6 +3459,10 @@ if test "$spice_qxl_io_monitors_config_async" = "yes" ; then
echo "CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC=y" >> $config_host_mak
fi
+if test "$spice_qxl_io_client_monitors_config" = "yes" ; then
+ echo "CONFIG_QXL_IO_CLIENT_MONITORS_CONFIG=y" >> $config_host_mak
+fi
+
if test "$smartcard" = "yes" ; then
echo "CONFIG_SMARTCARD=y" >> $config_host_mak
fi
diff --git a/hw/qxl.c b/hw/qxl.c
index 94eb3c8..583a2d9 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -32,6 +32,10 @@
#define QXL_IO_MONITORS_CONFIG_ASYNC (QXL_IO_FLUSH_RELEASE + 1)
#endif
+#ifndef CONFIG_QXL_IO_CLIENT_MONITORS_CONFIG
+#define QXL_IO_CAPABILITIES_SET (QXL_IO_FLUSH_RELEASE + 2)
+#endif
+
/*
* NOTE: SPICE_RING_PROD_ITEM accesses memory on the pci bar and as
* such can be changed by the guest, so to avoid a guest trigerrable
@@ -289,6 +293,21 @@ static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl, int replay)
#endif
}
+static void qxl_spice_guest_capabilities_set(PCIQXLDevice *qxl)
+{
+#if SPICE_SERVER_VERSION >= 0x000b05 && \
+ defined(CONFIG_QXL_IO_CLIENT_MONITORS_CONFIG)
+ uint8_t guest_capabilities[sizeof(qxl->ram->guest_capabilities)];
+
+ trace_qxl_io_capabilities_set(qxl->id, sizeof(qxl->ram->guest_capabilities),
+ qxl->ram->guest_capabilities);
+ memcpy(guest_capabilities, qxl->ram->guest_capabilities,
+ sizeof(guest_capabilities));
+ spice_qxl_guest_capabilities_set(&qxl->ssd.qxl, sizeof(guest_capabilities),
+ guest_capabilities);
+#endif
+}
+
void qxl_spice_reset_image_cache(PCIQXLDevice *qxl)
{
trace_qxl_spice_reset_image_cache(qxl->id);
@@ -576,6 +595,7 @@ static const char *io_port_to_string(uint32_t io_port)
[QXL_IO_FLUSH_SURFACES_ASYNC] = "QXL_IO_FLUSH_SURFACES_ASYNC",
[QXL_IO_FLUSH_RELEASE] = "QXL_IO_FLUSH_RELEASE",
[QXL_IO_MONITORS_CONFIG_ASYNC] = "QXL_IO_MONITORS_CONFIG_ASYNC",
+ [QXL_IO_CAPABILITIES_SET] = "QXL_IO_CAPABILITIES_SET",
};
if (io_port >= ARRAY_SIZE(io_port_to_string)) {
@@ -1398,6 +1418,7 @@ static void ioport_write(void *opaque, target_phys_addr_t addr,
case QXL_IO_LOG:
case QXL_IO_MEMSLOT_ADD_ASYNC:
case QXL_IO_CREATE_PRIMARY_ASYNC:
+ case QXL_IO_CAPABILITIES_SET:
break;
default:
if (d->mode != QXL_MODE_VGA) {
@@ -1580,6 +1601,9 @@ async_common:
case QXL_IO_MONITORS_CONFIG_ASYNC:
qxl_spice_monitors_config_async(d, 0);
break;
+ case QXL_IO_CAPABILITIES_SET:
+ qxl_spice_guest_capabilities_set(d);
+ break;
default:
qxl_set_guest_bug(d, "%s: unexpected ioport=0x%x\n", __func__, io_port);
}
diff --git a/trace-events b/trace-events
index 42dfb93..7a35f62 100644
--- a/trace-events
+++ b/trace-events
@@ -927,6 +927,7 @@ qxl_io_destroy_primary_ignored(int qid, const char *mode) "%d %s"
qxl_io_read_unexpected(int qid) "%d"
qxl_io_unexpected_vga_mode(int qid, uint64_t addr, uint64_t val, const char *desc) "%d 0x%"PRIx64"=%"PRIu64" (%s)"
qxl_io_write(int qid, const char *mode, uint64_t addr, uint64_t val, unsigned size, int async) "%d %s addr=%"PRIu64 " val=%"PRIu64" size=%u async=%d"
+qxl_io_capabilities_set(int qid, int caps_size, uint8_t *caps) "%d %d %p"
qxl_memslot_add_guest(int qid, uint32_t slot_id, uint64_t guest_start, uint64_t guest_end) "%d %u: guest phys 0x%"PRIx64 " - 0x%" PRIx64
qxl_post_load(int qid, const char *mode) "%d %s"
qxl_pre_load(int qid) "%d"
--
1.7.12
next prev parent reply other threads:[~2012-09-11 6:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-11 6:56 [Qemu-devel] [PATCH 1/3] hw/qxl: tracing fixes Alon Levy
2012-09-11 6:56 ` Alon Levy [this message]
2012-09-11 6:56 ` [Qemu-devel] [PATCH 3/3] hw/qxl: support client monitor configuration via device Alon Levy
2012-09-11 8:45 ` Gerd Hoffmann
2012-09-11 9:35 ` Alon Levy
2012-09-11 11:05 ` Gerd Hoffmann
2012-09-11 11:29 ` Alon Levy
2012-09-11 12:10 ` Gerd Hoffmann
2012-09-11 11:43 ` Hans de Goede
2012-09-11 12:03 ` Alon Levy
2012-09-11 12:10 ` Alon Levy
2012-09-11 12:16 ` Hans de Goede
2012-09-11 12:23 ` Gerd Hoffmann
2012-09-11 12:37 ` Alon Levy
2012-09-11 13:03 ` Gerd Hoffmann
2012-09-11 13:05 ` Alon Levy
2012-09-11 13:24 ` Hans de Goede
2012-09-11 13:55 ` Alon Levy
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=1347346570-2469-2-git-send-email-alevy@redhat.com \
--to=alevy@redhat.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).