From nobody Sun May 5 16:26:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1572888824; cv=none; d=zoho.com; s=zohoarc; b=PXVORB2XYL5uUomLjjRXsE2YOsL6WIODoXPMo19QK7+IxAJiw3pp9vYx1P440yN0pQGiHiC1l9J3HbKcsCthTU307+T4JN9KEVZjeJIqSAshILS5X1FLs0RSWv1j1ySjabGHwzLpdShW8jW7sd/dqSnuguw+ET+AiajUh6AoS5E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572888824; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=G7LqUjdUFS8Ng+Jk2kahdGoWRlXL6jymTZhgH4Ewo6Q=; b=EMkEdSNBrCG/CnLFaQQL5Apr9eCnBaigX9ZFCjoOhHHTK0hOjbkPUWs7Cn5J4TlYtVhLCKE9fVRyCBgGVFbZg1DFf82OgBm3oCt5D9ACu816qBi6L0mcAMAn5YhCbsi+aXnnt2gdU+u8Cv/PBlB5FYOTAkuaeQsg9JsnLVcH3l0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1572888824822724.5978173159274; Mon, 4 Nov 2019 09:33:44 -0800 (PST) Received: from localhost ([::1]:35754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRgEZ-00054G-Mg for importer@patchew.org; Mon, 04 Nov 2019 12:33:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33414) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRgBT-0002We-6y for qemu-devel@nongnu.org; Mon, 04 Nov 2019 12:30:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iRgBS-0006JW-11 for qemu-devel@nongnu.org; Mon, 04 Nov 2019 12:30:31 -0500 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:38254) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iRgBR-0006JI-Se; Mon, 04 Nov 2019 12:30:29 -0500 Received: by mail-ot1-x341.google.com with SMTP id v24so9820779otp.5; Mon, 04 Nov 2019 09:30:29 -0800 (PST) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id 64sm614386otv.9.2019.11.04.09.30.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Nov 2019 09:30:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=G7LqUjdUFS8Ng+Jk2kahdGoWRlXL6jymTZhgH4Ewo6Q=; b=iT3vhVd6/M9LDBkNhmTHA4oLKT5ndYc/rNBeaWAOvu8Y/RKhdmn+syy3NZOQuH74ej 9FUbvIrcM0EnBBFb8TR7Yrt+NbhzSXwwDaPUq8YIkJBNXMli/rWt6TBcW0XYqBP8tkzX bURwaPCTIuYmcnHp7NEcuGdosKr+ZpwtytRO6WhYv1BuAoj/KROkYV5QEDXcytpW+od8 920f2vbWtg9DLNwyj9X2IQFU/8zSbkIpW6n09LMKH2kkK59uZWwVorZziMpH+yN5DQUl L9tKurV8DeeSuvWJj6Po+xQOl7AOH99g5gzCNqKDYo7BVGuA4hvOTDt42d6YQQiwZuUU 0McQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=G7LqUjdUFS8Ng+Jk2kahdGoWRlXL6jymTZhgH4Ewo6Q=; b=YP37nQmBywOSGny+uC8SOR/8m877jD288JQPDbXSLh2J2a3CQ0NLMqTxAae0ASy13n fFk1vzHbD1LCINK5Dv6gaVvKzB8rR21Y6JAcRRd0+M1eiGuNjfxVKBmBQkAGZ8ajKB/Y wWxisHfp++DQBW0NfFMpfXnoz9VXf5etEY+mcpeKzOWEbUFieOntS7/9LWy6RMX2ZT+f i0zEgGY543ljCnS9v6jY1twp0p7wWazB+/gGA5zH2E9CBpx06OsMBJbcWmoHfE26Ao/b ed3U1a9djrCuic2nWOTDgOajSvi2ky7RX4K0ekdty8kfBrBq6b44vIQf7fuxEgm51mzR uJnA== X-Gm-Message-State: APjAAAVUD6uA74I5AzkgkhR+YJrsi0E8Ehpm/BBZ9H1+jiPW8Ily5MuF wupOgXVwY4KWsAdwrz0W4oSX9slAGNg= X-Google-Smtp-Source: APXvYqxI/WKuAR8AXRVWL3X2mmn0WuPmjZXs0qCA0bXcKlagFkLFNmpZ8DoaN8Pmp5Tw1mpwKc6Itg== X-Received: by 2002:a9d:6c46:: with SMTP id g6mr2483732otq.270.1572888628305; Mon, 04 Nov 2019 09:30:28 -0800 (PST) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PULL 1/2] qga-win: network-get-interfaces command name field bug fix Date: Mon, 4 Nov 2019 11:30:16 -0600 Message-Id: <20191104173017.14324-2-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191104173017.14324-1-mdroth@linux.vnet.ibm.com> References: <20191104173017.14324-1-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::341 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: Bishara AbuHattoum , peter.maydell@linaro.org, qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Bishara AbuHattoum Network interface name is fetched as an encoded WCHAR array, (wide character), then it is decoded using the guest's CP_ACP Windows code page, which is the default code page as configure in the guest's Windows, then it is returned as a byte array, (char array). As stated in the BZ#1733165, when renaming a network interface to a Chinese name and invoking this command, the returned name field has the (\ufffd) value for each Chinese character the name had, this value is an indication that the code page does not have the decoding information for the given character. This bug is a result of using the CP_ACP code page for decoding which is an interchangeable code page, instead CP_UTF8 code page should be used for decoding the network interface's name. https://bugzilla.redhat.com/show_bug.cgi?id=3D1733165 Signed-off-by: Bishara AbuHattoum Cc: qemu-stable@nongnu.org Signed-off-by: Michael Roth --- qga/commands-win32.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 6b67f16faf..64b1c754b0 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -1387,12 +1387,12 @@ static IP_ADAPTER_ADDRESSES *guest_get_adapters_add= resses(Error **errp) static char *guest_wctomb_dup(WCHAR *wstr) { char *str; - size_t i; + size_t str_size; =20 - i =3D wcslen(wstr) + 1; - str =3D g_malloc(i); - WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, - wstr, -1, str, i, NULL, NULL); + str_size =3D WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, = NULL); + /* add 1 to str_size for NULL terminator */ + str =3D g_malloc(str_size + 1); + WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, str_size, NULL, NULL); return str; } =20 --=20 2.17.1 From nobody Sun May 5 16:26:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1572888718; cv=none; d=zoho.com; s=zohoarc; b=BqDjK0JIgGvdOd6UJYsB+zbDj/15fdhwbLYJSyoywunHx1eDtuLlkgOumiKPn18TEa67mZnts3tHXysgiOU3KVq8BpAGqT3VJOJBhqBgwjd4/+q9awlrPr14VvkQOlcN2clLQoLd0G4NLpItw/OUvp2VJA+J6OvPvXai81WntG0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572888718; 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=jNT3t4quzGSS/pxjS5hCboJ6+DmPB/mrE5H6qMsJU9s=; b=EZEbkQKamSf5ThRkjSUmY9LOVBn1DF4lZt7Dh6aPf8KRK0wRqYG9MOny+qo/JJDdeSNWmpOGr8YY0rtcu7WaudDIwwVX8d8PJAhZo9FUgCPtPpgCcyTmxHlUh1c4EYb74bdmLKeuRrOKGw3XdMdncb1c4Kt8ZY9/cLvxxmZO5s4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1572888718890287.2519372522539; Mon, 4 Nov 2019 09:31:58 -0800 (PST) Received: from localhost ([::1]:35738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRgCo-0003SH-3s for importer@patchew.org; Mon, 04 Nov 2019 12:31:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33430) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRgBV-0002Xa-0G for qemu-devel@nongnu.org; Mon, 04 Nov 2019 12:30:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iRgBT-0006ND-UW for qemu-devel@nongnu.org; Mon, 04 Nov 2019 12:30:32 -0500 Received: from mail-ot1-x334.google.com ([2607:f8b0:4864:20::334]:40131) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iRgBT-0006Mf-QE for qemu-devel@nongnu.org; Mon, 04 Nov 2019 12:30:31 -0500 Received: by mail-ot1-x334.google.com with SMTP id m15so6345326otq.7 for ; Mon, 04 Nov 2019 09:30:31 -0800 (PST) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id c83sm3895064oia.54.2019.11.04.09.30.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Nov 2019 09:30:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jNT3t4quzGSS/pxjS5hCboJ6+DmPB/mrE5H6qMsJU9s=; b=YJtshmSoDPLi9X1toaro1EUfnMTXkRB68f+b8OJuCDTtKuLfJtG3uOZxr9LbJAOkJD KQZAWv6xkCjN22/Y17RJk+BGJ7lAWyjIXmkEGLtvO25OFE8PseUzsmmtx/Hca2MnBNsX ZWNub58uhNQf9PU/tbOnAExgHXa3lUY+Wi5/oHQSOh7LODcseQXXNfp1WwMr12k5Tm7Y Sikk3HwudosCcG3S8f/ftQKVmrBkmhrdctb9d0S+iyNco27TM4LfxlmW+gfwznB6ne8x /sReKwqRY0SzYdrenaQNCZTDfors0MjNFo/S45ImKCIQxPp/FeKo6gCjrG6HsQAImvSB HSeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=jNT3t4quzGSS/pxjS5hCboJ6+DmPB/mrE5H6qMsJU9s=; b=aNb1/SKzR5nXRyb2yg1LjpF74MzmhwWHB8zTD6bxASNMtQUrL8yfJAys3wkE/kOSvW ReftbVoIzEPn4Hv+GX02bJvF2FFmQ8JR1e1dMkaZT9zI+/PHdQInEn4W3cf29csYRA40 gHw5NtJQkXJXT1nbN0ypX8CzgcqM8xwuLQkTK1pRzLEWirkyIyOdJcrgXgn5irGKD7VZ QJ5YuBHHQZQdRfbWA2rsso2xH7raPrJDyBtsm3LAaX28e5F6n4HoMyPE+Lhc52k95x+S yJmeQFe/adS9GLccMx34CC9/mdVGlkX+vm1FaKkIg5P1HlsuNv0f5u0DLT/7+XK7ES+/ YnhA== X-Gm-Message-State: APjAAAUQ1kboDHjAvvru3LhCe1x8HxGNX9w1G7jV65L+kGMbuIPVqmvP Y3KRaEOxcGC5C9WM+K4WRlAl0SYfRao= X-Google-Smtp-Source: APXvYqyVyRvGNx7H+3wFwu7p7hi7Ei24yOsyxZ3sqW3wf9cHrwq/+1ovRvH0+AOMR787yCbPT29eJg== X-Received: by 2002:a9d:5f0f:: with SMTP id f15mr18308402oti.251.1572888630362; Mon, 04 Nov 2019 09:30:30 -0800 (PST) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PULL 2/2] qga: Add "guest-get-memory-block-info" to blacklist Date: Mon, 4 Nov 2019 11:30:17 -0600 Message-Id: <20191104173017.14324-3-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191104173017.14324-1-mdroth@linux.vnet.ibm.com> References: <20191104173017.14324-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::334 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: peter.maydell@linaro.org, Basil Salman Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Basil Salman Memory block commands are only supported for linux with sysfs, "guest-get-memory-block-info" was not in blacklist for other cases. Reported on: https://bugzilla.redhat.com/show_bug.cgi?id=3D1751431 Signed-off-by: Basil Salman Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Michael Roth --- qga/commands-posix.c | 3 ++- qga/commands-win32.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index dfc05f5b8a..1c1a165dae 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -2730,7 +2730,8 @@ GList *ga_command_blacklist_init(GList *blacklist) "guest-suspend-hybrid", "guest-network-get-interfaces", "guest-get-vcpus", "guest-set-vcpus", "guest-get-memory-blocks", "guest-set-memory-blocks", - "guest-get-memory-block-size", NULL}; + "guest-get-memory-block-size", "guest-get-memory-block-info", + NULL}; char **p =3D (char **)list; =20 while (*p) { diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 64b1c754b0..55ba5b263a 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -1894,7 +1894,7 @@ GList *ga_command_blacklist_init(GList *blacklist) "guest-suspend-hybrid", "guest-set-vcpus", "guest-get-memory-blocks", "guest-set-memory-blocks", - "guest-get-memory-block-size", + "guest-get-memory-block-size", "guest-get-memory-block-info", NULL}; char **p =3D (char **)list_unsupported; =20 --=20 2.17.1