From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6z3A-0006jD-K3 for qemu-devel@nongnu.org; Tue, 15 Jul 2014 05:29:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X6z31-0000dN-HU for qemu-devel@nongnu.org; Tue, 15 Jul 2014 05:29:28 -0400 Received: from mail-qa0-x236.google.com ([2607:f8b0:400d:c00::236]:64494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6z31-0000dD-Cx for qemu-devel@nongnu.org; Tue, 15 Jul 2014 05:29:19 -0400 Received: by mail-qa0-f54.google.com with SMTP id k15so2896689qaq.13 for ; Tue, 15 Jul 2014 02:29:19 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53C4F46B.4050602@redhat.com> Date: Tue, 15 Jul 2014 11:29:15 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <965a31ed0c51f30c4e3a3a9df5db9c4892ec914e.1405416206.git.amit.shah@redhat.com> In-Reply-To: <965a31ed0c51f30c4e3a3a9df5db9c4892ec914e.1405416206.git.amit.shah@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.1 1/1] virtio-serial-bus: keep port 0 reserved for virtconsole even on unplug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah , qemu list Cc: Amos Kong Il 15/07/2014 11:23, Amit Shah ha scritto: > i = port_id / 32; This can also be moved inside the if. Paolo > - vser->ports_map[i] &= ~(1U << (port_id % 32)); > + if (port_id) { > + /* > + * Don't mark port 0 removed -- we explicitly reserve it for > + * backward compat with older guests, and a device unplug of > + * virtconsole removes the reservation. > + */ > + vser->ports_map[i] &= ~(1U << (port_id % 32)); > + }