From: Alon Levy <alevy@redhat.com>
To: qemu-devel@nongnu.org
Cc: kraxel@redhat.com
Subject: [Qemu-devel] [RFC 1/2] hw/qxl: ignore guest from guestbug until reset
Date: Mon, 21 May 2012 12:04:47 +0300 [thread overview]
Message-ID: <1337591088-18667-1-git-send-email-alevy@redhat.com> (raw)
reset only by a guest QXL_IO_RESET
Signed-off-by: Alon Levy <alevy@redhat.com>
---
hw/qxl.c | 9 ++++++++-
hw/qxl.h | 2 ++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/hw/qxl.c b/hw/qxl.c
index 6c11e70..a9a7778 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -141,6 +141,7 @@ static void qxl_ring_set_dirty(PCIQXLDevice *qxl);
void qxl_guest_bug(PCIQXLDevice *qxl, const char *msg, ...)
{
qxl_send_events(qxl, QXL_INTERRUPT_ERROR);
+ qxl->guest_bug = 1;
if (qxl->guestdebug) {
va_list ap;
va_start(ap, msg);
@@ -571,7 +572,7 @@ static int interface_get_command(QXLInstance *sin, struct QXLCommandExt *ext)
case QXL_MODE_NATIVE:
case QXL_MODE_UNDEFINED:
ring = &qxl->ram->cmd_ring;
- if (SPICE_RING_IS_EMPTY(ring)) {
+ if (qxl->guest_bug || SPICE_RING_IS_EMPTY(ring)) {
return false;
}
SPICE_RING_CONS_ITEM(qxl, ring, cmd);
@@ -1291,6 +1292,10 @@ static void ioport_write(void *opaque, target_phys_addr_t addr,
qxl_async_io async = QXL_SYNC;
uint32_t orig_io_port = io_port;
+ if (d->guest_bug && !io_port == QXL_IO_RESET) {
+ return;
+ }
+
switch (io_port) {
case QXL_IO_RESET:
case QXL_IO_SET_MODE:
@@ -1399,6 +1404,7 @@ async_common:
}
break;
case QXL_IO_RESET:
+ d->guest_bug = 0;
qxl_hard_reset(d, 0);
break;
case QXL_IO_MEMSLOT_ADD:
@@ -1742,6 +1748,7 @@ static int qxl_init_common(PCIQXLDevice *qxl)
qemu_mutex_init(&qxl->track_lock);
qemu_mutex_init(&qxl->async_lock);
qxl->current_async = QXL_UNDEFINED_IO;
+ qxl->guest_bug = 0;
switch (qxl->revision) {
case 1: /* spice 0.4 -- qxl-1 */
diff --git a/hw/qxl.h b/hw/qxl.h
index ec0cb1a..4e14643 100644
--- a/hw/qxl.h
+++ b/hw/qxl.h
@@ -35,6 +35,8 @@ typedef struct PCIQXLDevice {
uint32_t cmdlog;
uint32_t revision;
+ uint32_t guest_bug;
+
enum qxl_mode mode;
uint32_t cmdflags;
int generation;
--
1.7.10.1
next reply other threads:[~2012-05-21 9:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-21 9:04 Alon Levy [this message]
2012-05-21 9:04 ` [Qemu-devel] [RFC 2/2] hmp/qxl: info spice: add qxl0_mode & qxl0_guest_bug Alon Levy
2012-05-21 9:22 ` Gerd Hoffmann
2012-05-21 11:35 ` Alon Levy
2012-05-21 11:55 ` Gerd Hoffmann
2012-05-21 9:12 ` [Qemu-devel] [RFC 1/2] hw/qxl: ignore guest from guestbug until reset Gerd Hoffmann
2012-05-21 11:33 ` Alon Levy
2012-05-23 12:01 ` [Qemu-devel] [PATCH] " 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=1337591088-18667-1-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).