From patchwork Fri Feb 22 07:53:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1046615 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 445Nsg1GCDz9s9y for ; Fri, 22 Feb 2019 18:54:43 +1100 (AEDT) Received: from localhost ([127.0.0.1]:45915 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gx5fK-0006zy-Md for incoming@patchwork.ozlabs.org; Fri, 22 Feb 2019 02:54:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gx5eO-0006xw-J5 for qemu-devel@nongnu.org; Fri, 22 Feb 2019 02:53:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gx5eN-0001Za-8z for qemu-devel@nongnu.org; Fri, 22 Feb 2019 02:53:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54446) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gx5eM-0001MV-D8 for qemu-devel@nongnu.org; Fri, 22 Feb 2019 02:53:39 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7D7D9A7EF for ; Fri, 22 Feb 2019 07:53:29 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-228.ams2.redhat.com [10.36.116.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3853760BE6; Fri, 22 Feb 2019 07:53:29 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 715AE16E15; Fri, 22 Feb 2019 08:53:26 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 22 Feb 2019 08:53:20 +0100 Message-Id: <20190222075326.9850-10-kraxel@redhat.com> In-Reply-To: <20190222075326.9850-1-kraxel@redhat.com> References: <20190222075326.9850-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 22 Feb 2019 07:53:29 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 09/15] spice: do not stop spice if VM is paused X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Gerd Hoffmann , Markus Armbruster , =?utf-8?q?Marc-Andr=C3=A9_Lure?= =?utf-8?q?au?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau spice_server_vm_start/stop() was added to help migration state (commit f5bb039c6d97ef3e664094eab3c9a4dc1824ed73). However, a paused VM could keep running the spice server. This will allow a Spice client to keep sending commands to a spice chardev. This allows to stop/cont a VM from a Spice monitor port. Character devices (vdagent/usb/smartcard/..) should not read from Spice when the VM is paused. Signed-off-by: Marc-André Lureau Tested-by: Victor Toso Message-id: 20190221110703.5775-6-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann --- ui/spice-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/spice-core.c b/ui/spice-core.c index 1cc996027719..4d384974ca34 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -628,7 +628,7 @@ static void vm_change_state_handler(void *opaque, int running, { if (running) { qemu_spice_display_start(); - } else { + } else if (state != RUN_STATE_PAUSED) { qemu_spice_display_stop(); } }