From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2E9A5C47DA2 for ; Tue, 16 Jan 2024 17:25:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPnB5-0007Bm-RI; Tue, 16 Jan 2024 12:24:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPnB4-0007Bd-Jy for qemu-devel@nongnu.org; Tue, 16 Jan 2024 12:24:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPnB2-0004vZ-S5 for qemu-devel@nongnu.org; Tue, 16 Jan 2024 12:24:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705425879; 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: in-reply-to:in-reply-to:references:references; bh=UFTOAtk6nVTZd/lNKdd46mgMTN9oS8Ln9bSuX/IZg+Y=; b=JfkTLOtAnSBGRk92nz5cofglZlIhkSuof1TuCABEf0oTyKIdOXctB9HscQ7F0I4sFubM5/ i8+4U6r48azouK+GytFkxeckMMVDmAWFGT0PqmjLAMqMGXj5oy+Wk7YMjhbfdle/gtUDLU 5uAuAjPU7c101XSee7qeX/p0u4ve8TI= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-609-5xk4iurPPSug-mX_4tDVvg-1; Tue, 16 Jan 2024 12:24:37 -0500 X-MC-Unique: 5xk4iurPPSug-mX_4tDVvg-1 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2cccd597158so89987241fa.2 for ; Tue, 16 Jan 2024 09:24:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705425876; x=1706030676; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UFTOAtk6nVTZd/lNKdd46mgMTN9oS8Ln9bSuX/IZg+Y=; b=amaL3FskiT20Q6jQrXW0sROU80gXphTL24i7c6MzGlh8+IjL5qvKjK1RavQ/BKeK1n xD82X+2Tn1YAX5twFWfMJBcue1HuOQyHXipkGDslzInSikoQ01l+Bzl8OsdO+ER1zp+a r7Z07hwSI/XTLR9v46E8pv2Zs47JEOZbO27ZOrCa1wwCFk44fIrU7szc9CWmdemjn/Cm wR5wJ92kpWw9+KaLJ8GxcedSgfVZDSDRyLzp5xj3TTnbbGnxvy6A0oLS+CzVYXpGrcgE BN/f4KUZqtmO2ZrUAOs9We8oQiKn7v5Z9/KIn4WYZCL+1c3o0bBdOPBHm8D9csZDtBv6 vEsA== X-Gm-Message-State: AOJu0YxRYBYZSW42VREcS5ZVGTxZWkrltgMESHEVI62PqfWmeyhkgMwj FrqU6OPGIKYef/qTZP27JZM2d2IZUzDuFjvGxbu7LOPJcboOIRHKlaGOuUCJeD/puwufIQTNxKq RP0sPtFn6M+INoKOFMUzV8b4BI3OhKkr/uBmd4mOL7md+Aw7LEw== X-Received: by 2002:a2e:9e83:0:b0:2cd:8a63:ac95 with SMTP id f3-20020a2e9e83000000b002cd8a63ac95mr3531545ljk.73.1705425875919; Tue, 16 Jan 2024 09:24:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTmjQEX4J+j2EOyz3+aqSM42v0i6BDhGhRN7nOrQCQWAGaFHNDlAo0JPjdZip320jOmyngtZW/RoeDdr668ek= X-Received: by 2002:a2e:9e83:0:b0:2cd:8a63:ac95 with SMTP id f3-20020a2e9e83000000b002cd8a63ac95mr3531535ljk.73.1705425875493; Tue, 16 Jan 2024 09:24:35 -0800 (PST) MIME-Version: 1.0 References: <20231227071540.4035803-1-peng.ji@smartx.com> <5492018d-8b72-4aea-b33c-bb9f4f6b4f48@linaro.org> In-Reply-To: From: Konstantin Kostiuk Date: Tue, 16 Jan 2024 19:24:24 +0200 Message-ID: Subject: Re: [PATCH] qga-win: Fix guest-get-fsinfo multi-disks collection To: Peng Ji Cc: qemu-devel , Michael Roth , Yan Vugenfirer Content-Type: multipart/alternative; boundary="0000000000007ff2d3060f136795" Received-SPF: pass client-ip=170.10.129.124; envelope-from=kkostiuk@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -38 X-Spam_score: -3.9 X-Spam_bar: --- X-Spam_report: (-3.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.806, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org --0000000000007ff2d3060f136795 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Reviewed-by: Konstantin Kostiuk On Wed, Jan 10, 2024 at 9:42=E2=80=AFAM Peng Ji wrote: > ping ! > please review this patch : https://patchew.org/QEMU/20231227071540.403580= 3-1-peng.ji@smartx.com/ > > thanks > > > > On Fri, Jan 5, 2024 at 9:47=E2=80=AFPM Philippe Mathieu-Daud=C3=A9 > wrote: > >> On 27/12/23 08:15, peng.ji@smartx.com wrote: >> > From: Peng Ji >> > >> > When a volume has more than one disk, all disks cannot be >> > returned correctly because there is not enough malloced memory >> > for disk extents, so before executing DeviceIoControl for the >> > second time, get the correct size of the required memory space >> > to store all disk extents. >> > >> > Signed-off-by: Peng Ji >> >> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2075 >> >> > --- >> > qga/commands-win32.c | 2 ++ >> > 1 file changed, 2 insertions(+) >> > >> > diff --git a/qga/commands-win32.c b/qga/commands-win32.c >> > index 697c65507c..a1015757d8 100644 >> > --- a/qga/commands-win32.c >> > +++ b/qga/commands-win32.c >> > @@ -935,6 +935,8 @@ static GuestDiskAddressList >> *build_guest_disk_info(char *guid, Error **errp) >> > DWORD last_err =3D GetLastError(); >> > if (last_err =3D=3D ERROR_MORE_DATA) { >> > /* Try once more with big enough buffer */ >> > + size =3D sizeof(VOLUME_DISK_EXTENTS) + >> > + (sizeof(DISK_EXTENT) * (extents->NumberOfDiskExtents - >> 1)); >> > g_free(extents); >> > extents =3D g_malloc0(size); >> > if (!DeviceIoControl( >> >> --0000000000007ff2d3060f136795 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>

On Wed, Jan 1= 0, 2024 at 9:42=E2=80=AFAM Peng Ji <peng.ji@smartx.com> wrote:


On Fri, Jan 5, 2024 at 9:47=E2=80=AFPM P= hilippe Mathieu-Daud=C3=A9 <philmd@linaro.org> wrote:
On 27/12/23 08:15, peng.ji@smartx.com wrote:
> From: Peng Ji <peng.ji@smartx.com>
>
> When a volume has more than one disk, all disks cannot be
> returned correctly because there is not enough malloced memory
> for disk extents, so before executing DeviceIoControl for the
> second time, get the correct size of the required memory space
> to store all disk extents.
>
> Signed-off-by: Peng Ji <peng.ji@smartx.com>

Resolves: https://gitlab.com/qemu-project/qemu/-/i= ssues/2075

> ---
>=C2=A0 =C2=A0qga/commands-win32.c | 2 ++
>=C2=A0 =C2=A01 file changed, 2 insertions(+)
>
> diff --git a/qga/commands-win32.c b/qga/commands-win32.c
> index 697c65507c..a1015757d8 100644
> --- a/qga/commands-win32.c
> +++ b/qga/commands-win32.c
> @@ -935,6 +935,8 @@ static GuestDiskAddressList *build_guest_disk_info= (char *guid, Error **errp)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DWORD last_err =3D GetLastErro= r();
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (last_err =3D=3D ERROR_MORE= _DATA) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Try once more= with big enough buffer */
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 size =3D sizeof(VOLUME_DISK= _EXTENTS) +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(sizeof(DISK_E= XTENT) * (extents->NumberOfDiskExtents - 1));
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0g_free(extents);=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0extents =3D g_ma= lloc0(size);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!DeviceIoCon= trol(

--0000000000007ff2d3060f136795--