Skip to contentSkip to conversation

qxl: unbreak after memory API conversion

PATCH In review Alon Levy 2 participants 8 messages Aug 9, 2011 – Aug 10, 2011

lore
Share & tools
lore

Alon Levy

author
#0 lore raw

PATCH 1/2 qxl: unbreak after memory API conversion

Break is only noticable with newer spice-server library (0.8.2 release or 0.9.0 and newer on master branch).

ioport_write's val was changed from uint32_t to uint64_t, this broke two printfs. Use PRId64 instead of %d.

---
 hw/qxl.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
hw/qxl.c +3 -2
index db7ae7a..1d31ccd 100644
@@ -1189,7 +1189,7 @@ async_common:
         }
         d->current_async = orig_io_port;
         qemu_mutex_unlock(&d->async_lock);
-        dprint(d, 2, "start async %d (%d)\n", io_port, val);
+        dprint(d, 2, "start async %d (%"PRId64")\n", io_port, val);
         break;
     default:
         break;
@@ -1305,7 +1305,8 @@ async_common:
         break;
     }
     case QXL_IO_FLUSH_SURFACES_ASYNC:
-        dprint(d, 1, "QXL_IO_FLUSH_SURFACES_ASYNC (%d) (%s, s#=%d, res#=%d)\n",
+        dprint(d, 1, "QXL_IO_FLUSH_SURFACES_ASYNC"
+                     " (%"PRId64") (%s, s#=%d, res#=%d)\n",
                val, qxl_mode_to_string(d->mode), d->guest_surfaces.count,
                d->num_free_res);
         qxl_spice_flush_surfaces_async(d);
Signature · 1 line
1.7.6
author
#1 lore raw

PATCH 2/2 ui/spice-core: report version in 'info spice'

---
 ui/spice-core.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
ui/spice-core.c +4 -0
index 3d77c01..342ed6c 100644
@@ -372,6 +372,10 @@ void do_info_spice_print(Monitor *mon, const QObject *data)
         monitor_printf(mon, "     address: %s:%d [tls]\n", host, port);
     }
     monitor_printf(mon, "        auth: %s\n", qdict_get_str(server, "auth"));
+    monitor_printf(mon, "     version: %d.%d.%d\n",
+                   (SPICE_SERVER_VERSION & 0xff0000) >> 16,
+                   (SPICE_SERVER_VERSION & 0xff00) >> 8,
+                    SPICE_SERVER_VERSION & 0xff);
 
     channels = qdict_get_qlist(server, "channels");
     if (qlist_empty(channels)) {
Signature · 1 line
1.7.6
#2 lore raw

Re: [Qemu-devel] [PATCH 2/2] ui/spice-core: report version in 'info spice'

Quoted 10 lines · Alon Levy
---
  ui/spice-core.c |    4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)
ui/spice-core.c +0 -0
index 3d77c01..342ed6c 100644

ui/spice-core.c void do_info_spice_print(Monitor *mon, const QObject *data) · line 378

Quoted 7 lines
ui/spice-core.c +4 -0
@@ -372,6 +372,10 @@ void do_info_spice_print(Monitor *mon, const QObject *data)
          monitor_printf(mon, "     address: %s:%d [tls]\n", host, port);
      }
      monitor_printf(mon, "        auth: %s\n", qdict_get_str(server, "auth"));
+    monitor_printf(mon, "     version: %d.%d.%d\n",
+                   (SPICE_SERVER_VERSION&  0xff0000)>>  16,
+                   (SPICE_SERVER_VERSION&  0xff00)>>  8,
+                    SPICE_SERVER_VERSION&  0xff);

No. You should should stick this info into the dict in do_info_spice, then just get it from the dict for printing like it is done for auth. This way you'll have the information in the qmp monitor too.

I think it would also be nice to somehow hint this is the spice version qemu was compiled against. The shared library which is actually used might be newer.

cheers,
Gerd

author
#3 lore raw

Re: [Qemu-devel] [PATCH 2/2] ui/spice-core: report version in 'info spice'

Quoted 24 lines · Gerd Hoffmann
Quoted 10 lines · Alon Levy
---
 ui/spice-core.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
ui/spice-core.c +0 -0
index 3d77c01..342ed6c 100644

ui/spice-core.c void do_info_spice_print(Monitor *mon, const QObject *data) · line 378

Quoted 7 lines
ui/spice-core.c +4 -0
@@ -372,6 +372,10 @@ void do_info_spice_print(Monitor *mon, const QObject *data)
         monitor_printf(mon, "     address: %s:%d [tls]\n", host, port);
     }
     monitor_printf(mon, "        auth: %s\n", qdict_get_str(server, "auth"));
+    monitor_printf(mon, "     version: %d.%d.%d\n",
+                   (SPICE_SERVER_VERSION&  0xff0000)>>  16,
+                   (SPICE_SERVER_VERSION&  0xff00)>>  8,
+                    SPICE_SERVER_VERSION&  0xff);

No. You should should stick this info into the dict in do_info_spice, then just get it from the dict for printing like it is done for auth. This way you'll have the information in the qmp monitor too.

Quoted 1 line

I think it would also be nice to somehow hint this is the spice

sent a second patch (fixing the above), but didn't do any hinting. I'll send a third.

Quoted 2 lines

version qemu was compiled against. The shared library which is actually used might be newer.

I thought of this problem but decided it's better to at least have the compiled version (getting the linked against version is not hard, but I'd rather not force to do it at this moment - I guess via dlopen. Which is linux specific - will need yet another wrapper for that api to compile on windows).

Quoted 4 lines

cheers,
Gerd

#4 lore raw

Re: [Qemu-devel] [PATCH 2/2] ui/spice-core: report version in 'info spice'

Hi,

Quoted 2 lines
Quoted 1 line

I think it would also be nice to somehow hint this is the spice

sent a second patch (fixing the above), but didn't do any hinting. I'll send a third.

Saw v2. I would just stick a "version" string into the dict instead of the three values for major, minor and micro.

Quoted 7 lines
Quoted 2 lines

version qemu was compiled against. The shared library which is actually used might be newer.

I thought of this problem but decided it's better to at least have the compiled version (getting the linked against version is not hard, but I'd rather not force to do it at this moment - I guess via dlopen. Which is linux specific - will need yet another wrapper for that api to compile on windows).

The compiled version is perfectly fine, I think it is more useful to have that one as it decides which features qemu is able to use.

If we want report the runtime version too (any reason to do this?) I'd just add a spice_server_get_version() function to the library.

cheers,
Gerd

author
#5 lore raw

Re: [Qemu-devel] [PATCH 2/2] ui/spice-core: report version in 'info spice'

Quoted 8 lines · Gerd Hoffmann

Hi,

Quoted 2 lines
Quoted 1 line

I think it would also be nice to somehow hint this is the spice

sent a second patch (fixing the above), but didn't do any hinting. I'll send a third.

Saw v2. I would just stick a "version" string into the dict instead of the three values for major, minor and micro.

Argh. Sent v3 with the three ints. Do you prefer a single version?

Quoted 11 lines
Quoted 7 lines
Quoted 2 lines

version qemu was compiled against. The shared library which is actually used might be newer.

I thought of this problem but decided it's better to at least have the compiled version (getting the linked against version is not hard, but I'd rather not force to do it at this moment - I guess via dlopen. Which is linux specific - will need yet another wrapper for that api to compile on windows).

The compiled version is perfectly fine, I think it is more useful to have that one as it decides which features qemu is able to use.

Just completeness :) I'm not going to do it right now anyway.

Quoted 6 lines

If we want report the runtime version too (any reason to do this?) I'd just add a spice_server_get_version() function to the library.

cheers,
Gerd

#6 lore raw

Re: [Qemu-devel] [PATCH 2/2] ui/spice-core: report version in 'info spice'

Hi,

Quoted 1 line

Argh. Sent v3 with the three ints. Do you prefer a single version?

Yea, would be great.

thanks,
Gerd

#7 lore raw
In reply to Alon Levy
Quoted 5 lines · Alon Levy

Break is only noticable with newer spice-server library (0.8.2 release or 0.9.0 and newer on master branch).

ioport_write's val was changed from uint32_t to uint64_t, this broke two printfs. Use PRId64 instead of %d.

Added to the spice patch queue.

thanks,
Gerd