Message ID | 4a0a27a167669dec734a37f0d3d3826ac131db4d.1589540787.git.lukasstraub2@web.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=uwTg=65=nongnu.org=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 78984138A for <patchwork-qemu-devel@patchwork.kernel.org>; Fri, 15 May 2020 11:14:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 518F4206B6 for <patchwork-qemu-devel@patchwork.kernel.org>; Fri, 15 May 2020 11:14:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=web.de header.i=@web.de header.b="irTauzjl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 518F4206B6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=web.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:47800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1jZYIW-0004o0-B1 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 May 2020 07:14:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <lukasstraub2@web.de>) id 1jZYFx-0001jn-Lv for qemu-devel@nongnu.org; Fri, 15 May 2020 07:11:57 -0400 Received: from mout.web.de ([212.227.15.3]:51545) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <lukasstraub2@web.de>) id 1jZYFw-0008ES-2F for qemu-devel@nongnu.org; Fri, 15 May 2020 07:11:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1589541104; bh=pWY/L7DWs+7R8NUfCp6QCm9+JZ2p1vUInbQcNyL3ZCA=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=irTauzjl8FVe6d7AuecgybIhvkC1i8tY78hm0lvrZipusXvW31Q2ZApWTHNEq8B// nBNMQcoHxCUXiGAsWm36mS1VkcwhzqvzfdCuXXYOj3YY+Ig+sZrjg1oIyaIMDzNNC3 XWk706uekyjZuJBJSvMnYjDnvvtVwtL2UTUAWlDA= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from luklap ([94.134.180.164]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LqoAk-1ivWft3RkQ-00eJUM; Fri, 15 May 2020 13:11:43 +0200 Date: Fri, 15 May 2020 13:11:41 +0200 From: Lukas Straub <lukasstraub2@web.de> To: qemu-devel <qemu-devel@nongnu.org> Subject: [PATCH v5 2/6] chardev/char.c: Use qemu_co_sleep_ns if in coroutine Message-ID: <4a0a27a167669dec734a37f0d3d3826ac131db4d.1589540787.git.lukasstraub2@web.de> In-Reply-To: <cover.1589540787.git.lukasstraub2@web.de> References: <cover.1589540787.git.lukasstraub2@web.de> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/__QCEQPc=wBcBl+1KmXIssA"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Provags-ID: V03:K1:McYHL0e9SZlZmB06/zuVSjXLkTIiftNtRSumu5NPSErgCBw3gJI fczeYLPlCkvsjDwhyY4Dls0LjCzW/6RQixmhbHCfcgmEiUKxgN9pdqVuDfyiIGqh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ghtBu6D5C274BWRnnRsYcUqeFa5nQbNqw9n 7IAeTnNjtM+31weC0aYAh/UojbPlfJV5bdvBY7N4pVhc2O8JH7wYl5bl3ek4VE+q5k9V8EmpN YswrDv0qbJ9H58WbKNHlPEsjxMKILQIrS6dKDVoaNuFAEF/keU8k5iQHfVqzFEwyQpOSMSxpt hJQtoGMmI5aAunHoYGLz8IK3gVYHCT5sZrifew/GURJvHfc7gE6lQP/g1W7k6y4HajeZhroNe 62PTiMGOIdmspiHpUkrhN4U9bd9JgE0NL2vU88QSr+UALoxBYfA0DWIJKjj68Kh13hqfHE2qz GCkXa8HhaZIufMQjc Received-SPF: pass client-ip=212.227.15.3; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/15 05:48:32 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Zhang Chen <chen.zhang@intel.com>, Jason Wang <jasowang@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Li Zhijian <lizhijian@cn.fujitsu.com>, =?utf-8?q?Marc-Andr=C3=A9?= Lureau <marcandre.lureau@redhat.com> Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> |
Series |
colo-compare bugfixes
|
expand
|
diff --git a/chardev/char.c b/chardev/char.c index e77564060d..5c8014199f 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -38,6 +38,7 @@ #include "qemu/module.h" #include "qemu/option.h" #include "qemu/id.h" +#include "qemu/coroutine.h" #include "chardev/char-mux.h" @@ -119,7 +120,11 @@ static int qemu_chr_write_buffer(Chardev *s, retry: res = cc->chr_write(s, buf + *offset, len - *offset); if (res < 0 && errno == EAGAIN && write_all) { - g_usleep(100); + if (qemu_in_coroutine()) { + qemu_co_sleep_ns(QEMU_CLOCK_REALTIME, 100000); + } else { + g_usleep(100); + } goto retry; }