* [PATCH] qga-win: Fix guest-get-fsinfo multi-disks collection
@ 2023-12-27 6:32 peng.ji
0 siblings, 0 replies; 5+ messages in thread
From: peng.ji @ 2023-12-27 6:32 UTC (permalink / raw)
To: qemu-devel; +Cc: Konstantin Kostiuk, Michael Roth, Peng Ji
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>
---
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 = GetLastError();
if (last_err == ERROR_MORE_DATA) {
/* Try once more with big enough buffer */
+ size = sizeof(VOLUME_DISK_EXTENTS) +
+ (sizeof(DISK_EXTENT) * (extents->NumberOfDiskExtents - 1));
g_free(extents);
extents = g_malloc0(size);
if (!DeviceIoControl(
--
2.27.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] qga-win: Fix guest-get-fsinfo multi-disks collection
@ 2023-12-27 7:15 peng.ji
2024-01-05 13:47 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 5+ messages in thread
From: peng.ji @ 2023-12-27 7:15 UTC (permalink / raw)
To: qemu-devel; +Cc: Konstantin Kostiuk, Michael Roth, Yan Vugenfirer, Peng Ji
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>
---
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 = GetLastError();
if (last_err == ERROR_MORE_DATA) {
/* Try once more with big enough buffer */
+ size = sizeof(VOLUME_DISK_EXTENTS) +
+ (sizeof(DISK_EXTENT) * (extents->NumberOfDiskExtents - 1));
g_free(extents);
extents = g_malloc0(size);
if (!DeviceIoControl(
--
2.27.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] qga-win: Fix guest-get-fsinfo multi-disks collection
2023-12-27 7:15 [PATCH] qga-win: Fix guest-get-fsinfo multi-disks collection peng.ji
@ 2024-01-05 13:47 ` Philippe Mathieu-Daudé
2024-01-10 7:42 ` Peng Ji
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-05 13:47 UTC (permalink / raw)
To: peng.ji, qemu-devel; +Cc: Konstantin Kostiuk, Michael Roth, Yan Vugenfirer
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/-/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 = GetLastError();
> if (last_err == ERROR_MORE_DATA) {
> /* Try once more with big enough buffer */
> + size = sizeof(VOLUME_DISK_EXTENTS) +
> + (sizeof(DISK_EXTENT) * (extents->NumberOfDiskExtents - 1));
> g_free(extents);
> extents = g_malloc0(size);
> if (!DeviceIoControl(
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] qga-win: Fix guest-get-fsinfo multi-disks collection
2024-01-05 13:47 ` Philippe Mathieu-Daudé
@ 2024-01-10 7:42 ` Peng Ji
2024-01-16 17:24 ` Konstantin Kostiuk
0 siblings, 1 reply; 5+ messages in thread
From: Peng Ji @ 2024-01-10 7:42 UTC (permalink / raw)
Cc: qemu-devel, Konstantin Kostiuk, Michael Roth, Yan Vugenfirer
[-- Attachment #1: Type: text/plain, Size: 1514 bytes --]
ping !
please review this patch :
https://patchew.org/QEMU/20231227071540.4035803-1-peng.ji@smartx.com/
thanks
On Fri, Jan 5, 2024 at 9:47 PM Philippe Mathieu-Daudé <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/-/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 = GetLastError();
> > if (last_err == ERROR_MORE_DATA) {
> > /* Try once more with big enough buffer */
> > + size = sizeof(VOLUME_DISK_EXTENTS) +
> > + (sizeof(DISK_EXTENT) * (extents->NumberOfDiskExtents -
> 1));
> > g_free(extents);
> > extents = g_malloc0(size);
> > if (!DeviceIoControl(
>
>
[-- Attachment #2: Type: text/html, Size: 2822 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] qga-win: Fix guest-get-fsinfo multi-disks collection
2024-01-10 7:42 ` Peng Ji
@ 2024-01-16 17:24 ` Konstantin Kostiuk
0 siblings, 0 replies; 5+ messages in thread
From: Konstantin Kostiuk @ 2024-01-16 17:24 UTC (permalink / raw)
To: Peng Ji; +Cc: qemu-devel, Michael Roth, Yan Vugenfirer
[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
On Wed, Jan 10, 2024 at 9:42 AM Peng Ji <peng.ji@smartx.com> wrote:
> ping !
> please review this patch : https://patchew.org/QEMU/20231227071540.4035803-1-peng.ji@smartx.com/
>
> thanks
>
>
>
> On Fri, Jan 5, 2024 at 9:47 PM Philippe Mathieu-Daudé <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/-/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 = GetLastError();
>> > if (last_err == ERROR_MORE_DATA) {
>> > /* Try once more with big enough buffer */
>> > + size = sizeof(VOLUME_DISK_EXTENTS) +
>> > + (sizeof(DISK_EXTENT) * (extents->NumberOfDiskExtents -
>> 1));
>> > g_free(extents);
>> > extents = g_malloc0(size);
>> > if (!DeviceIoControl(
>>
>>
[-- Attachment #2: Type: text/html, Size: 3345 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-01-16 17:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-27 7:15 [PATCH] qga-win: Fix guest-get-fsinfo multi-disks collection peng.ji
2024-01-05 13:47 ` Philippe Mathieu-Daudé
2024-01-10 7:42 ` Peng Ji
2024-01-16 17:24 ` Konstantin Kostiuk
-- strict thread matches above, loose matches on Subject: below --
2023-12-27 6:32 peng.ji
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).