qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/2] spice: fix coverity defect, add unix address support
@ 2015-01-22 11:18 Gerd Hoffmann
  2015-01-22 11:18 ` [Qemu-devel] [PULL 1/2] spice: " Gerd Hoffmann
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2015-01-22 11:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

  Hi,

Here comes the spice patch queue, featuring a coverity fix and
support for unix sockets.

please pull,
  Gerd

The following changes since commit 699eae17b841e6784dc3864bf357e26bff1e9dfe:

  Merge remote-tracking branch 'remotes/pmaydell/tags/pull-misc-20150120' into staging (2015-01-20 16:19:58 +0000)

are available in the git repository at:


  git://anongit.freedesktop.org/spice/qemu tags/pull-spice-20150122-1

for you to fetch changes up to 51a090991449c7d3c6d428eda18b4f30a36e2c1b:

  spice: fix coverity reported defect in display code (2015-01-22 11:18:41 +0100)

----------------------------------------------------------------
spice: fix coverity defect, add unix address support

----------------------------------------------------------------
Gerd Hoffmann (1):
      spice: fix coverity reported defect in display code

Marc-André Lureau (1):
      spice: add unix address support

 qemu-options.hx    | 3 ++-
 ui/spice-core.c    | 9 +++++++++
 ui/spice-display.c | 6 +++---
 3 files changed, 14 insertions(+), 4 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 1/2] spice: add unix address support
  2015-01-22 11:18 [Qemu-devel] [PULL 0/2] spice: fix coverity defect, add unix address support Gerd Hoffmann
@ 2015-01-22 11:18 ` Gerd Hoffmann
  2015-01-22 11:18 ` [Qemu-devel] [PULL 2/2] spice: fix coverity reported defect in display code Gerd Hoffmann
  2015-01-22 17:41 ` [Qemu-devel] [PULL 0/2] spice: fix coverity defect, add unix address support Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2015-01-22 11:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Gerd Hoffmann, Anthony Liguori

From: Marc-André Lureau <marcandre.lureau@gmail.com>

Teach qemu to set up a Spice server with a UNIX socket using the
following arguments -spice unix,addr=path.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 qemu-options.hx | 3 ++-
 ui/spice-core.c | 9 +++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 10b9568..85ca3ad 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -953,7 +953,7 @@ DEF("spice", HAS_ARG, QEMU_OPTION_spice,
     "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
     "       [,x509-key-file=<file>][,x509-key-password=<file>]\n"
     "       [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n"
-    "       [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6]\n"
+    "       [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6|unix]\n"
     "       [,tls-ciphers=<list>]\n"
     "       [,tls-channel=[main|display|cursor|inputs|record|playback]]\n"
     "       [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n"
@@ -982,6 +982,7 @@ Set the IP address spice is listening on.  Default is any address.
 
 @item ipv4
 @item ipv6
+@item unix
 Force using the specified IP version.
 
 @item password=<secret>
diff --git a/ui/spice-core.c b/ui/spice-core.c
index fe705c1..c8f7f18 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -436,6 +436,11 @@ static QemuOptsList qemu_spice_opts = {
         },{
             .name = "ipv6",
             .type = QEMU_OPT_BOOL,
+#ifdef SPICE_ADDR_FLAG_UNIX_ONLY
+        },{
+            .name = "unix",
+            .type = QEMU_OPT_BOOL,
+#endif
         },{
             .name = "password",
             .type = QEMU_OPT_STRING,
@@ -708,6 +713,10 @@ void qemu_spice_init(void)
         addr_flags |= SPICE_ADDR_FLAG_IPV4_ONLY;
     } else if (qemu_opt_get_bool(opts, "ipv6", 0)) {
         addr_flags |= SPICE_ADDR_FLAG_IPV6_ONLY;
+#ifdef SPICE_ADDR_FLAG_UNIX_ONLY
+    } else if (qemu_opt_get_bool(opts, "unix", 0)) {
+        addr_flags |= SPICE_ADDR_FLAG_UNIX_ONLY;
+#endif
     }
 
     spice_server = spice_server_new();
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 2/2] spice: fix coverity reported defect in display code
  2015-01-22 11:18 [Qemu-devel] [PULL 0/2] spice: fix coverity defect, add unix address support Gerd Hoffmann
  2015-01-22 11:18 ` [Qemu-devel] [PULL 1/2] spice: " Gerd Hoffmann
@ 2015-01-22 11:18 ` Gerd Hoffmann
  2015-01-22 17:41 ` [Qemu-devel] [PULL 0/2] spice: fix coverity defect, add unix address support Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2015-01-22 11:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Gerd Hoffmann, Anthony Liguori

Report:

1. Condition surface, taking false branch
406    if (surface && ssd->surface &&
407        surface_width(surface) == pixman_image_get_width(ssd->surface) &&
408        surface_height(surface) == pixman_image_get_height(ssd->surface)) {
409        /* no-resize fast path: just swap backing store */
...

10. alias_transfer: Assigning: ssd->ds = surface.
440    ssd->ds = surface;

11. var_deref_op: Dereferencing null pointer ssd->ds.
CID 1264334 (#1 of 1): Dereference after null check (FORWARD_NULL)
441    ssd->surface = pixman_image_ref(ssd->ds->image);

Fix:

Move code block dereferencing ssd->ds into the already existing
if (ssd->ds) { ... } block.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/spice-display.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ui/spice-display.c b/ui/spice-display.c
index 8c87212..1644185 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -438,9 +438,6 @@ void qemu_spice_display_switch(SimpleSpiceDisplay *ssd,
     qemu_mutex_lock(&ssd->lock);
     need_destroy = (ssd->ds != NULL);
     ssd->ds = surface;
-    ssd->surface = pixman_image_ref(ssd->ds->image);
-    ssd->mirror  = qemu_pixman_mirror_create(ssd->ds->format,
-                                             ssd->ds->image);
     while ((update = QTAILQ_FIRST(&ssd->updates)) != NULL) {
         QTAILQ_REMOVE(&ssd->updates, update, next);
         qemu_spice_destroy_update(ssd, update);
@@ -450,6 +447,9 @@ void qemu_spice_display_switch(SimpleSpiceDisplay *ssd,
         qemu_spice_destroy_host_primary(ssd);
     }
     if (ssd->ds) {
+        ssd->surface = pixman_image_ref(ssd->ds->image);
+        ssd->mirror  = qemu_pixman_mirror_create(ssd->ds->format,
+                                                 ssd->ds->image);
         qemu_spice_create_host_primary(ssd);
     }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PULL 0/2] spice: fix coverity defect, add unix address support
  2015-01-22 11:18 [Qemu-devel] [PULL 0/2] spice: fix coverity defect, add unix address support Gerd Hoffmann
  2015-01-22 11:18 ` [Qemu-devel] [PULL 1/2] spice: " Gerd Hoffmann
  2015-01-22 11:18 ` [Qemu-devel] [PULL 2/2] spice: fix coverity reported defect in display code Gerd Hoffmann
@ 2015-01-22 17:41 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2015-01-22 17:41 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: QEMU Developers

On 22 January 2015 at 11:18, Gerd Hoffmann <kraxel@redhat.com> wrote:
>   Hi,
>
> Here comes the spice patch queue, featuring a coverity fix and
> support for unix sockets.
>
> please pull,
>   Gerd
>
> The following changes since commit 699eae17b841e6784dc3864bf357e26bff1e9dfe:
>
>   Merge remote-tracking branch 'remotes/pmaydell/tags/pull-misc-20150120' into staging (2015-01-20 16:19:58 +0000)
>
> are available in the git repository at:
>
>
>   git://anongit.freedesktop.org/spice/qemu tags/pull-spice-20150122-1
>
> for you to fetch changes up to 51a090991449c7d3c6d428eda18b4f30a36e2c1b:
>
>   spice: fix coverity reported defect in display code (2015-01-22 11:18:41 +0100)
>
> ----------------------------------------------------------------
> spice: fix coverity defect, add unix address support
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-22 17:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-22 11:18 [Qemu-devel] [PULL 0/2] spice: fix coverity defect, add unix address support Gerd Hoffmann
2015-01-22 11:18 ` [Qemu-devel] [PULL 1/2] spice: " Gerd Hoffmann
2015-01-22 11:18 ` [Qemu-devel] [PULL 2/2] spice: fix coverity reported defect in display code Gerd Hoffmann
2015-01-22 17:41 ` [Qemu-devel] [PULL 0/2] spice: fix coverity defect, add unix address support Peter Maydell

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).