From nobody Fri Nov 14 00:48:07 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583758289; cv=none; d=zohomail.com; s=zohoarc; b=lZd/uMO9HvmY/32VnbFVw9MqGvFFcejBE/UKD73yEQCvfRDNPnIFpqP1UlxeTveRuD8upB+dQNUXc39xeYpSxMOM5J8biWsuquBBfQrxhmEEiTpemQmMdL0rx0ibrwv8c/JmyHabI2EFk7mt9Fx0gAXRWk4/C29WKH5QonhRlvo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583758289; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Pa8QNbeLcCahskW5w7Cch3+nbAdBehrY2rXYQPR64YA=; b=hIH+5deZbT33fkFrCfYriDgSLbik697HzUq1AkslxC/WQ7DlGTa/Z9G9SLuml1w+xPOFprzCqJSEUEUNGUIi+gqargjeCq4hW0gKjB7qulFkcVfWm48JWLCBlEQOJJ4fkkf8/H5b+CmBU6EzPqULbwabO6/CruSfuQ8Silbo8Qg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583758289719669.0849435199653; Mon, 9 Mar 2020 05:51:29 -0700 (PDT) Received: from localhost ([::1]:42672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBHsW-0000y8-Ke for importer@patchew.org; Mon, 09 Mar 2020 08:51:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34090) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBHne-0003Ky-39 for qemu-devel@nongnu.org; Mon, 09 Mar 2020 08:46:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jBHnc-0003j1-Ns for qemu-devel@nongnu.org; Mon, 09 Mar 2020 08:46:26 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:24201 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jBHnc-0003gq-JF for qemu-devel@nongnu.org; Mon, 09 Mar 2020 08:46:24 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-350-yJ2975WcP_S90FApG6NlaQ-1; Mon, 09 Mar 2020 08:46:21 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8C92F801F75 for ; Mon, 9 Mar 2020 12:46:20 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-34.ams2.redhat.com [10.36.116.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A65C28FBE0; Mon, 9 Mar 2020 12:46:17 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3087D11385F4; Mon, 9 Mar 2020 13:46:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583757983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Pa8QNbeLcCahskW5w7Cch3+nbAdBehrY2rXYQPR64YA=; b=ikJnUv4XieNpfkxpOYKAVtdQpfn3ngCqZuiYrUZuXLcr9jbdcP/Aq6OEeAMgjv8KZiR09e w/eyD9J+hC28yFefRXn6R0CTy9gyV3olW2tOnnEL6Xvyy5a9wblvRPtuK+ykMLPjPUEGQs xnyuOsUt1zIb8GpqQa9qKO6ztixUXkE= X-MC-Unique: yJ2975WcP_S90FApG6NlaQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 2/4] util/osdep: Improve error report by calling error_setg_win32() Date: Mon, 9 Mar 2020 13:46:14 +0100 Message-Id: <20200309124616.4372-3-armbru@redhat.com> In-Reply-To: <20200309124616.4372-1-armbru@redhat.com> References: <20200309124616.4372-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Use error_setg_win32() which adds a hint similar to strerror(errno)). Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200228100726.8414-3-philmd@redhat.com> Signed-off-by: Markus Armbruster --- util/osdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/osdep.c b/util/osdep.c index f7d06050f7..4829c07ff6 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -82,8 +82,8 @@ static int qemu_mprotect__osdep(void *addr, size_t size, = int prot) DWORD old_protect; =20 if (!VirtualProtect(addr, size, prot, &old_protect)) { - error_report("%s: VirtualProtect failed with error code %ld", - __func__, GetLastError()); + g_autofree gchar *emsg =3D g_win32_error_message(GetLastError()); + error_report("%s: VirtualProtect failed: %s", __func__, emsg); return -1; } return 0; --=20 2.21.1