Skip to contentSkip to conversation

qemu-ga patches

GIT PULL Konstantin Kostiuk 7 participants 19 messages May 23, 2022 – Jun 3, 2022

lore
Share & tools
lore
#0 lore raw

The following changes since commit 3757b0d08b399c609954cf57f273b1167e5d7a8d:

Merge tag 'pull-request-2022-05-18' of https://gitlab.com/thuth/qemu into staging (2022-05-20 08:04:30 -0700)

are available in the Git repository at:

[email protected]:kostyanf14/qemu.git tags/qga-win32-pull-2022-05-23

for you to fetch changes up to cb69e5d06bb8ba4929f277daa87160bf2f54c51e:

trivial: qga: Log version on start (2022-05-23 22:27:15 +0300)

----------------------------------------------------------------
qga-win32-pull-2022-05-23

----------------------------------------------------------------
Konstantin Kostiuk (2):
qga-win32: Add support for NVME but type
trivial: qga: Log version on start

luzhipeng (1):
qga: add guest-get-diskstats command for Linux guests

 qga/commands-posix.c | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 qga/commands-win32.c |  11 +++++++++++
 qga/main.c           |   2 ++
 qga/qapi-schema.json |  86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 222 insertions(+)

--
2.25.1

#1 lore raw

[PULL 3/3] trivial: qga: Log version on start

Message-Id: <[email protected]>

---
 qga/main.c | 2 ++
 1 file changed, 2 insertions(+)
qga/main.c +2 -0
index 3b9546c185..c373fec3ee 100644
@@ -1271,6 +1271,8 @@ static GAState *initialize_agent(GAConfig *config, int socket_activation)
     g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR);
     ga_enable_logging(s);
 
+    g_debug("Guest agent version %s started", QEMU_FULL_VERSION);
+
 #ifdef _WIN32
     /* On win32 the state directory is application specific (be it the default
      * or a user override). We got past the command line parsing; let's create
Signature · 1 line
2.25.1
#2 lore raw

[PULL 2/3] qga-win32: Add support for NVME but type

In reply to Konstantin Kostiuk

Bus type spaces (Indicates a storage spaces bus) is not supported, so return it as unknown.

Message-Id: <[email protected]>

---
 qga/commands-win32.c | 5 +++++
 1 file changed, 5 insertions(+)
qga/commands-win32.c +5 -0
index dcdeb76a68..36f94c0f9c 100644
@@ -490,6 +490,11 @@ static GuestDiskBusType win2qemu[] = {
 #if (_WIN32_WINNT >= 0x0601)
     [BusTypeVirtual] = GUEST_DISK_BUS_TYPE_VIRTUAL,
     [BusTypeFileBackedVirtual] = GUEST_DISK_BUS_TYPE_FILE_BACKED_VIRTUAL,
+    /*
+     * BusTypeSpaces currently is not suported
+     */
+    [BusTypeSpaces] = GUEST_DISK_BUS_TYPE_UNKNOWN,
+    [BusTypeNvme] = GUEST_DISK_BUS_TYPE_NVME,
 #endif
 };
 
Signature · 1 line
2.25.1
#3 lore raw

Re: [PULL 2/3] qga-win32: Add support for NVME but type

Quoted 17 lines · Konstantin Kostiuk

Bus type spaces (Indicates a storage spaces bus) is not supported, so return it as unknown.

Message-Id: <[email protected]>

---
  qga/commands-win32.c | 5 +++++
  1 file changed, 5 insertions(+)
qga/commands-win32.c +0 -0
index dcdeb76a68..36f94c0f9c 100644
@@ -490,6 +490,11 @@ static GuestDiskBusType win2qemu[] = {
  #if (_WIN32_WINNT >= 0x0601)

qga/commands-win32.c static GuestDiskBusType win2qemu[] = { · line 500

Quoted 10 lines
qga/commands-win32.c +5 -0
      [BusTypeVirtual] = GUEST_DISK_BUS_TYPE_VIRTUAL,
      [BusTypeFileBackedVirtual] = GUEST_DISK_BUS_TYPE_FILE_BACKED_VIRTUAL,
+    /*
+     * BusTypeSpaces currently is not suported
+     */
+    [BusTypeSpaces] = GUEST_DISK_BUS_TYPE_UNKNOWN,
+    [BusTypeNvme] = GUEST_DISK_BUS_TYPE_NVME,
  #endif
  };
 

Build fails:

../qga/commands-win32.c:496:6: error: 'BusTypeSpaces' undeclared here (not in a function); did you mean 'BusTypeSas'?

  496 |     [BusTypeSpaces] = GUEST_DISK_BUS_TYPE_UNKNOWN,
      |      ^~~~~~~~~~~~~
      |      BusTypeSas
../qga/commands-win32.c:496:6: error: array index in initializer not of integer type
../qga/commands-win32.c:496:6: note: (near initialization for 'win2qemu')
../qga/commands-win32.c:497:6: error: 'BusTypeNvme' undeclared here (not in a function); did you mean 'BusTypeMmc'?
  497 |     [BusTypeNvme] = GUEST_DISK_BUS_TYPE_NVME,
      |      ^~~~~~~~~~~
      |      BusTypeMmc

../qga/commands-win32.c:497:6: error: array index in initializer not of integer type ../qga/commands-win32.c:497:6: note: (near initialization for 'win2qemu')

r~

#4 lore raw

Re: [PULL 2/3] qga-win32: Add support for NVME but type

Thanks for the report. I will think about how to fix the build with old mingw-headers.
BusTypeNvme and BusTypeSpaces were added to mingw-headers v 9.0.0

Quoted 56 lines · Richard Henderson
Quoted 16 lines · Konstantin Kostiuk

Bus type spaces (Indicates a storage spaces bus) is not supported, so return it as unknown.

Message-Id: <[email protected]>

---
  qga/commands-win32.c | 5 +++++
  1 file changed, 5 insertions(+)
qga/commands-win32.c +0 -0
index dcdeb76a68..36f94c0f9c 100644

qga/commands-win32.c static GuestDiskBusType win2qemu[] = { · line 492

Quoted 3 lines
qga/commands-win32.c +0 -0
@@ -490,6 +490,11 @@ static GuestDiskBusType win2qemu[] = {
  #if (_WIN32_WINNT >= 0x0601)
      [BusTypeVirtual] = GUEST_DISK_BUS_TYPE_VIRTUAL,
      [BusTypeFileBackedVirtual] =

GUEST_DISK_BUS_TYPE_FILE_BACKED_VIRTUAL,

qga/commands-win32.c static GuestDiskBusType win2qemu[] = { · line 500

Quoted 8 lines
qga/commands-win32.c +5 -0
+    /*
+     * BusTypeSpaces currently is not suported
+     */
+    [BusTypeSpaces] = GUEST_DISK_BUS_TYPE_UNKNOWN,
+    [BusTypeNvme] = GUEST_DISK_BUS_TYPE_NVME,
  #endif
  };
 

Build fails:

../qga/commands-win32.c:496:6: error: 'BusTypeSpaces' undeclared here (not in a function);
did you mean 'BusTypeSas'?

   496 |     [BusTypeSpaces] = GUEST_DISK_BUS_TYPE_UNKNOWN,
       |      ^~~~~~~~~~~~~
       |      BusTypeSas

../qga/commands-win32.c:496:6: error: array index in initializer not of integer type
../qga/commands-win32.c:496:6: note: (near initialization for 'win2qemu') ../qga/commands-win32.c:497:6: error: 'BusTypeNvme' undeclared here (not in a function);
did you mean 'BusTypeMmc'?

   497 |     [BusTypeNvme] = GUEST_DISK_BUS_TYPE_NVME,
       |      ^~~~~~~~~~~
       |      BusTypeMmc

../qga/commands-win32.c:497:6: error: array index in initializer not of integer type
../qga/commands-win32.c:497:6: note: (near initialization for 'win2qemu')

r~

#5 lore raw

Re: [PULL 2/3] qga-win32: Add support for NVME but type

Hi Richard and Marc-André

I looked into the compilation problem and have 2 solutions:
1. We can add some conditions to the win2qemu definition and skip NVME support when old mingw-headers are used.
2. We can bump the version of the Fedora docker image to 36 or 37 that is used for cross-compilation tests.

I think the second option is more valuable because we remove pregenerated qga-vss.tlb file and now we can check VSS build only at Fedora 37.

What do you think?

Best Regards,
Konstantin Kostiuk.

Quoted 64 lines · Konstantin Kostiuk

Thanks for the report. I will think about how to fix the build with old mingw-headers.
BusTypeNvme and BusTypeSpaces were added to mingw-headers v 9.0.0

Quoted 56 lines · Richard Henderson
Quoted 16 lines · Konstantin Kostiuk

Bus type spaces (Indicates a storage spaces bus) is not supported, so return it as unknown.

Message-Id: <[email protected]>

---
  qga/commands-win32.c | 5 +++++
  1 file changed, 5 insertions(+)
qga/commands-win32.c +0 -0
index dcdeb76a68..36f94c0f9c 100644

qga/commands-win32.c static GuestDiskBusType win2qemu[] = { · line 492

Quoted 3 lines
qga/commands-win32.c +0 -0
@@ -490,6 +490,11 @@ static GuestDiskBusType win2qemu[] = {
  #if (_WIN32_WINNT >= 0x0601)
      [BusTypeVirtual] = GUEST_DISK_BUS_TYPE_VIRTUAL,
      [BusTypeFileBackedVirtual] =

GUEST_DISK_BUS_TYPE_FILE_BACKED_VIRTUAL,

qga/commands-win32.c static GuestDiskBusType win2qemu[] = { · line 500

Quoted 8 lines
qga/commands-win32.c +5 -0
+    /*
+     * BusTypeSpaces currently is not suported
+     */
+    [BusTypeSpaces] = GUEST_DISK_BUS_TYPE_UNKNOWN,
+    [BusTypeNvme] = GUEST_DISK_BUS_TYPE_NVME,
  #endif
  };
 

Build fails:

../qga/commands-win32.c:496:6: error: 'BusTypeSpaces' undeclared here (not in a function);
did you mean 'BusTypeSas'?

   496 |     [BusTypeSpaces] = GUEST_DISK_BUS_TYPE_UNKNOWN,
       |      ^~~~~~~~~~~~~
       |      BusTypeSas

../qga/commands-win32.c:496:6: error: array index in initializer not of integer type
../qga/commands-win32.c:496:6: note: (near initialization for 'win2qemu') ../qga/commands-win32.c:497:6: error: 'BusTypeNvme' undeclared here (not in a function);
did you mean 'BusTypeMmc'?

   497 |     [BusTypeNvme] = GUEST_DISK_BUS_TYPE_NVME,
       |      ^~~~~~~~~~~
       |      BusTypeMmc

../qga/commands-win32.c:497:6: error: array index in initializer not of integer type
../qga/commands-win32.c:497:6: note: (near initialization for 'win2qemu')

r~

#6 lore raw

Re: [PULL 2/3] qga-win32: Add support for NVME but type

Hi

Quoted 9 lines · Konstantin Kostiuk

Hi Richard and Marc-André

I looked into the compilation problem and have 2 solutions:
1. We can add some conditions to the win2qemu definition and skip NVME support when old mingw-headers are used.
2. We can bump the version of the Fedora docker image to 36 or 37 that is used for cross-compilation tests.

Quoted 5 lines

I think the second option is more valuable because we remove pregenerated qga-vss.tlb file and now we can check VSS build only at Fedora 37.

What do you think?

I'd try to do both: fix compilation with older headers, and bump our CI to f36. I don't know if our windows build environment has strict requirements like the unix/distro (build on old-stable for 2y). The resulting win32 build is often shipped with all the dependencies (like the installer from Stefan Weil). But there are also rolling "native" distros, like msys2...

#7 lore raw

Re: [PULL 2/3] qga-win32: Add support for NVME but type

Quoted 16 lines · Marc-André Lureau

Hi

Quoted 13 lines · Konstantin Kostiuk

Hi Richard and Marc-André

I looked into the compilation problem and have 2 solutions:
1. We can add some conditions to the win2qemu definition and skip NVME support when old mingw-headers are used.
2. We can bump the version of the Fedora docker image to 36 or 37 that is used for cross-compilation tests.

I think the second option is more valuable because we remove pregenerated qga-vss.tlb file and now we can check VSS build only at Fedora 37.

Quoted 5 lines
Quoted 1 line

What do you think?

I'd try to do both: fix compilation with older headers, and bump our CI to f36. I don't know if our windows build environment has strict requirements like the unix/distro (build on old-stable for 2y).

See https://www.qemu.org/docs/master/about/build-platforms.html#windows :

"The project supports building QEMU with current versions of the MinGW toolchain, either hosted on Linux (Debian/Fedora) or via MSYS2 on Windows."

Since Fedora 35 is still a supported build host, I think you should make sure that it works with the MinGW toolchain from that distro, too.

Thomas

#8 lore raw

Re: [PULL 2/3] qga-win32: Add support for NVME but type

Quoted 24 lines · Thomas Huth
Quoted 3 lines · Marc-André Lureau

Hi

On Tue, May 24, 2022 at 12:02 PM Konstantin Kostiuk <[email protected]>

Quoted 13 lines · wrote:
Quoted 13 lines

Hi Richard and Marc-André

I looked into the compilation problem and have 2 solutions:
1. We can add some conditions to the win2qemu definition and skip NVME support when old mingw-headers are used.
2. We can bump the version of the Fedora docker image to 36 or 37 that is used for cross-compilation tests.

I think the second option is more valuable because we remove pregenerated qga-vss.tlb file and now we can check VSS build only at Fedora 37.

Quoted 5 lines
Quoted 1 line

What do you think?

I'd try to do both: fix compilation with older headers, and bump our CI to f36. I don't know if our windows build environment has strict requirements like the unix/distro (build on old-stable for 2y).

Quoted 8 lines

See https://www.qemu.org/docs/master/about/build-platforms.html#windows :

"The project supports building QEMU with current versions of the MinGW toolchain, either hosted on Linux (Debian/Fedora) or via MSYS2 on Windows."

Since Fedora 35 is still a supported build host, I think you should make sure that it works with the MinGW toolchain from that distro, too.

Currently, CI uses Fedora 33 which is already EOL. Fedora 35 has updated mingw-headers and the current version of code compiles without any errors. So if we want to support only Fedora 35+, we can just bump the CI docker image.

Quoted 4 lines

Thomas

#9 lore raw

Re: [PULL 2/3] qga-win32: Add support for NVME but type

Quoted 36 lines · Konstantin Kostiuk

On Tue, May 24, 2022 at 1:24 PM Thomas Huth <[email protected] <mailto:[email protected]>> wrote:

On 24/05/2022 12.14, Marc-André Lureau wrote:
> Hi
>
> On Tue, May 24, 2022 at 12:02 PM Konstantin Kostiuk
<[email protected] <mailto:[email protected]>> wrote:
>>
>> Hi Richard and Marc-André
>>
>> I looked into the compilation problem and have 2 solutions:
>> 1. We can add some conditions to the win2qemu definition and >> skip NVME support when old mingw-headers are used.
>> 2. We can bump the version of the Fedora docker image to 36 or 37 >> that is used for cross-compilation tests.
>>
>> I think the second option is more valuable because we remove >> pregenerated qga-vss.tlb file and now we can check VSS build only >> at Fedora 37.
>>
>> What do you think?
>
> I'd try to do both: fix compilation with older headers, and bump our > CI to f36. I don't know if our windows build environment has strict > requirements like the unix/distro (build on old-stable for 2y).

See https://www.qemu.org/docs/master/about/build-platforms.html#windows
<https://www.qemu.org/docs/master/about/build-platforms.html#windows> :

"The project supports building QEMU with current versions of the MinGW toolchain, either hosted on Linux (Debian/Fedora) or via MSYS2 on Windows."

Quoted 7 lines

Since Fedora 35 is still a supported build host, I think you should make sure that it works with the MinGW toolchain from that distro, too.

Currently, CI uses Fedora 33 which is already EOL. Fedora 35 has updated mingw-headers and the current version of code compiles without any errors. So if we want to support only Fedora 35+, we can just bump the CI docker image.

Ah, right, I was looking at the wrong file. So yes, in that case, please simply update the docker image.

What about Debian (since this is mentioned on the support page, too)? I think we don't have to worry about Debian 10 anymore, since Debian 10 will already be EOL once we release QEMU 7.1 ... but what about Debian 11? Do the MinGW packages there contain the updated headers, too?

Thomas

#10 lore raw

Re: [PULL 2/3] qga-win32: Add support for NVME but type

Quoted 55 lines · Thomas Huth
Quoted 20 lines · Konstantin Kostiuk

On Tue, May 24, 2022 at 1:24 PM Thomas Huth <[email protected] <mailto:[email protected]>> wrote:

On 24/05/2022 12.14, Marc-André Lureau wrote:
> Hi
>
> On Tue, May 24, 2022 at 12:02 PM Konstantin Kostiuk
<[email protected] <mailto:[email protected]>> wrote:
>>
>> Hi Richard and Marc-André
>>
>> I looked into the compilation problem and have 2 solutions:
>> 1. We can add some conditions to the win2qemu definition and >> skip NVME support when old mingw-headers are used.
>> 2. We can bump the version of the Fedora docker image to 36 or 37 >> that is used for cross-compilation tests.

Quoted 8 lines

>>
>> I think the second option is more valuable because we remove >> pregenerated qga-vss.tlb file and now we can check VSS build only >> at Fedora 37.
>>
>> What do you think?
>
> I'd try to do both: fix compilation with older headers, and bump

our

Quoted 1 line

> CI to f36. I don't know if our windows build environment has

strict

Quoted 3 lines

> requirements like the unix/distro (build on old-stable for 2y).

See

https://www.qemu.org/docs/master/about/build-platforms.html#windows

Quoted 1 line

<https://www.qemu.org/docs/master/about/build-platforms.html#windows>

:

Quoted 2 lines

"The project supports building QEMU with current versions of the

MinGW

Quoted 1 line

toolchain, either hosted on Linux (Debian/Fedora) or via MSYS2 on

Windows."

Quoted 2 lines

Since Fedora 35 is still a supported build host, I think you should

make

Quoted 5 lines

sure that it works with the MinGW toolchain from that distro, too.

Currently, CI uses Fedora 33 which is already EOL. Fedora 35 has updated mingw-headers and the current version of code compiles without any

errors.

Quoted 1 line

So if we want to support only Fedora 35+, we can just bump the CI docker

image.

Quoted 9 lines

Ah, right, I was looking at the wrong file. So yes, in that case, please simply update the docker image.

What about Debian (since this is mentioned on the support page, too)? I think we don't have to worry about Debian 10 anymore, since Debian 10 will already be EOL once we release QEMU 7.1 ... but what about Debian 11? Do the
MinGW packages there contain the updated headers, too?

As I know we do not test cross-compilation at Debian. Debian does not have even mingw-glib2. Debian only has the mingw-gcc toolkit.

Quoted 4 lines

Thomas

#11 lore raw

Re: [PULL 2/3] qga-win32: Add support for NVME but type

Quoted 73 lines · Konstantin Kostiuk

On Tue, May 24, 2022 at 4:13 PM Thomas Huth <[email protected] <mailto:[email protected]>> wrote:

On 24/05/2022 15.00, Konstantin Kostiuk wrote:
>
>
>
>
> On Tue, May 24, 2022 at 1:24 PM Thomas Huth <[email protected]
<mailto:[email protected]>
> <mailto:[email protected] <mailto:[email protected]>>> wrote:
>
>     On 24/05/2022 12.14, Marc-André Lureau wrote:
>      > Hi
>      >
>      > On Tue, May 24, 2022 at 12:02 PM Konstantin Kostiuk
>     <[email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>>> wrote:
>      >>
>      >> Hi Richard and Marc-André
>      >>
>      >> I looked into the compilation problem and have 2 solutions:
>      >> 1. We can add some conditions to the win2qemu definition and >      >> skip NVME support when old mingw-headers are used.
>      >> 2. We can bump the version of the Fedora docker image to 36 or 37 >      >> that is used for cross-compilation tests.
>      >>
>      >> I think the second option is more valuable because we remove >      >> pregenerated qga-vss.tlb file and now we can check VSS build only >      >> at Fedora 37.
>      >>
>      >> What do you think?
>      >
>      > I'd try to do both: fix compilation with older headers, and
bump our
>      > CI to f36. I don't know if our windows build environment has
strict
>      > requirements like the unix/distro (build on old-stable for 2y). >
>     See
https://www.qemu.org/docs/master/about/build-platforms.html#windows
<https://www.qemu.org/docs/master/about/build-platforms.html#windows>
>
 <https://www.qemu.org/docs/master/about/build-platforms.html#windows
<https://www.qemu.org/docs/master/about/build-platforms.html#windows>> :
>
>     "The project supports building QEMU with current versions of the
MinGW
>     toolchain, either hosted on Linux (Debian/Fedora) or via MSYS2 on
Windows."
>
>     Since Fedora 35 is still a supported build host, I think you
should make
>     sure that it works with the MinGW toolchain from that distro, too. >
>
> Currently, CI uses Fedora 33 which is already EOL. Fedora 35 has updated > mingw-headers and the current version of code compiles without any
errors.
> So if we want to support only Fedora 35+, we can just bump the CI
docker image.

Ah, right, I was looking at the wrong file. So yes, in that case, please simply update the docker image.

What about Debian (since this is mentioned on the support page, too)? I think we don't have to worry about Debian 10 anymore, since Debian 10 will already be EOL once we release QEMU 7.1 ... but what about Debian 11? Do the
MinGW packages there contain the updated headers, too?

Quoted 2 lines

As I know we do not test cross-compilation at Debian. Debian does not have even mingw-glib2. Debian only has the mingw-gcc toolkit.

Oh, interesting! Then I wonder why Debian is mentioned there ... seems like it has been added here:

https://git.qemu.org/?p=qemu.git;a=commitdiff;h=e6e80fcfd6c47823

Daniel, do you remember whether we supported Debian for MinGW cross-compilation in the past?

Thomas

#12 lore raw

Re: [PULL 2/3] qga-win32: Add support for NVME but type

Quoted 73 lines · Thomas Huth
Quoted 72 lines · Konstantin Kostiuk

On Tue, May 24, 2022 at 4:13 PM Thomas Huth <[email protected] <mailto:[email protected]>> wrote:

    On 24/05/2022 15.00, Konstantin Kostiuk wrote:
     >
     >
     >
     >
     > On Tue, May 24, 2022 at 1:24 PM Thomas Huth <[email protected] <mailto:[email protected]>
     > <mailto:[email protected] <mailto:[email protected]>>> wrote:
     >
     >     On 24/05/2022 12.14, Marc-André Lureau wrote:
     >      > Hi
     >      >
     >      > On Tue, May 24, 2022 at 12:02 PM Konstantin Kostiuk
     >     <[email protected] <mailto:[email protected]> <mailto:[email protected] <mailto:[email protected]>>> wrote:
     >      >>
     >      >> Hi Richard and Marc-André
     >      >>
     >      >> I looked into the compilation problem and have 2 solutions:
     >      >> 1. We can add some conditions to the win2qemu definition and >      >> skip NVME support when old mingw-headers are used.
     >      >> 2. We can bump the version of the Fedora docker image to 36 or 37 >      >> that is used for cross-compilation tests.
     >      >>
     >      >> I think the second option is more valuable because we remove >      >> pregenerated qga-vss.tlb file and now we can check VSS build only >      >> at Fedora 37.
     >      >>
     >      >> What do you think?
     >      >
     >      > I'd try to do both: fix compilation with older headers, and bump our
     >      > CI to f36. I don't know if our windows build environment has strict
     >      > requirements like the unix/distro (build on old-stable for 2y). >
     >     See
    https://www.qemu.org/docs/master/about/build-platforms.html#windows
    <https://www.qemu.org/docs/master/about/build-platforms.html#windows>
     >  <https://www.qemu.org/docs/master/about/build-platforms.html#windows
    <https://www.qemu.org/docs/master/about/build-platforms.html#windows>> :
     >
     >     "The project supports building QEMU with current versions of the MinGW
     >     toolchain, either hosted on Linux (Debian/Fedora) or via MSYS2 on Windows."
     >
     >     Since Fedora 35 is still a supported build host, I think you should make
     >     sure that it works with the MinGW toolchain from that distro, too. >
     >
     > Currently, CI uses Fedora 33 which is already EOL. Fedora 35 has updated > mingw-headers and the current version of code compiles without any errors.
     > So if we want to support only Fedora 35+, we can just bump the CI docker image.

    Ah, right, I was looking at the wrong file. So yes, in that case, please simply update the docker image.

    What about Debian (since this is mentioned on the support page, too)? I think we don't have to worry about Debian 10 anymore, since Debian 10 will already be EOL once we release QEMU 7.1 ... but what about Debian 11? Do the
    MinGW packages there contain the updated headers, too?

Quoted 8 lines
Quoted 2 lines

As I know we do not test cross-compilation at Debian. Debian does not have even mingw-glib2. Debian only has the mingw-gcc toolkit.

Oh, interesting! Then I wonder why Debian is mentioned there ... seems like it has been added here:

 https://git.qemu.org/?p=qemu.git;a=commitdiff;h=e6e80fcfd6c47823

Daniel, do you remember whether we supported Debian for MinGW cross-compilation in the past?

Ah, well, stupid me, we did use it, and I was even the one who once removed the container:

https://git.qemu.org/?p=qemu.git;a=commitdiff;h=e3755276d1f54

... but since this was using a third party repository, I think we don't have to worry about this here anymore.

Thomas

#13 lore raw

Re: [PULL 2/3] qga-win32: Add support for NVME but type

In reply to Thomas Huth
Quoted 78 lines · Thomas Huth
Quoted 74 lines · Konstantin Kostiuk

On Tue, May 24, 2022 at 4:13 PM Thomas Huth <[email protected] <mailto:[email protected]>> wrote:

On 24/05/2022 15.00, Konstantin Kostiuk wrote:
>
>
>
>
> On Tue, May 24, 2022 at 1:24 PM Thomas Huth <[email protected]
<mailto:[email protected]>
> <mailto:[email protected] <mailto:[email protected]>>> wrote:
>
>     On 24/05/2022 12.14, Marc-André Lureau wrote:
>      > Hi
>      >
>      > On Tue, May 24, 2022 at 12:02 PM Konstantin Kostiuk
>     <[email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>>> wrote:
>      >>
>      >> Hi Richard and Marc-André
>      >>
>      >> I looked into the compilation problem and have 2 solutions:
>      >> 1. We can add some conditions to the win2qemu definition and >      >> skip NVME support when old mingw-headers are used.
>      >> 2. We can bump the version of the Fedora docker image to 36 or 37 >      >> that is used for cross-compilation tests.
>      >>
>      >> I think the second option is more valuable because we remove >      >> pregenerated qga-vss.tlb file and now we can check VSS build only >      >> at Fedora 37.
>      >>
>      >> What do you think?
>      >
>      > I'd try to do both: fix compilation with older headers, and
bump our
>      > CI to f36. I don't know if our windows build environment has
strict
>      > requirements like the unix/distro (build on old-stable for 2y). >
>     See
https://www.qemu.org/docs/master/about/build-platforms.html#windows
<https://www.qemu.org/docs/master/about/build-platforms.html#windows>
>
 <https://www.qemu.org/docs/master/about/build-platforms.html#windows
<https://www.qemu.org/docs/master/about/build-platforms.html#windows>> :
>
>     "The project supports building QEMU with current versions of the
MinGW
>     toolchain, either hosted on Linux (Debian/Fedora) or via MSYS2 on
Windows."
>
>     Since Fedora 35 is still a supported build host, I think you
should make
>     sure that it works with the MinGW toolchain from that distro, too. >
>
> Currently, CI uses Fedora 33 which is already EOL. Fedora 35 has updated > mingw-headers and the current version of code compiles without any
errors.
> So if we want to support only Fedora 35+, we can just bump the CI
docker image.

Ah, right, I was looking at the wrong file. So yes, in that case, please simply update the docker image.

What about Debian (since this is mentioned on the support page, too)? I think we don't have to worry about Debian 10 anymore, since Debian 10 will already be EOL once we release QEMU 7.1 ... but what about Debian 11? Do the
MinGW packages there contain the updated headers, too?

Quoted 2 lines

As I know we do not test cross-compilation at Debian. Debian does not have even mingw-glib2. Debian only has the mingw-gcc toolkit.

Quoted 7 lines

Oh, interesting! Then I wonder why Debian is mentioned there ... seems like it has been added here:

https://git.qemu.org/?p=qemu.git;a=commitdiff;h=e6e80fcfd6c47823

Daniel, do you remember whether we supported Debian for MinGW cross-compilation in the past?

At one time we used to have Debian with the 3rd party 'mxe' builds of mingw added. It broke periodically and we deleted it in the end. It wasn't adding value over what Fedora mingw could provide as both more or less tracked the same versions of software in their mingw packages.

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#14 lore raw

Debian MinGW cross compilation (was: Re: [PULL 2/3] qga-win32: Add support for NVME but type)

Quoted 1 line · Daniel P. Berrangé

On Tue, May 24, 2022 at 03:28:37PM +0200, Thomas Huth wrote:

...

Quoted 9 lines
Quoted 3 lines

Daniel, do you remember whether we supported Debian for MinGW cross-compilation in the past?

At one time we used to have Debian with the 3rd party 'mxe' builds of mingw added. It broke periodically and we deleted it in the end. It wasn't adding value over what Fedora mingw could provide as both more or less tracked the same versions of software in their mingw packages.

I wonder whether anybody still tried to compile with this mxe repo in recent times...?
Should we adjust our support statement and just mention Fedora there? Otherwise we should maybe explicitly mention MXE there next to "Debian", too, so that people don't get the impression that QEMU can be compiled with a vanilla MinGW installation on Debian?

Thomas

#15 lore raw

Re: Debian MinGW cross compilation (was: Re: [PULL 2/3] qga-win32: Add support for NVME but type)

Am 03.06.22 um 14:56 schrieb Thomas Huth:

Quoted 13 lines · Daniel P. Berrangé
Quoted 1 line · Thomas Huth

...

Quoted 9 lines
Quoted 3 lines

Daniel, do you remember whether we supported Debian for MinGW cross-compilation in the past?

At one time we used to have Debian with the 3rd party 'mxe' builds of mingw added. It broke periodically and we deleted it in the end. It wasn't adding value over what Fedora mingw could provide as both more or less tracked the same versions of software in their mingw packages.

Quoted 4 lines

I wonder whether anybody still tried to compile with this mxe repo in recent times...?
Should we adjust our support statement and just mention Fedora there? Otherwise we should maybe explicitly mention MXE there next to "Debian", too, so that people don't get the impression that QEMU can be compiled with a vanilla MinGW installation on Debian?

 Thomas

My QEMU for Windows builds are all done on Debian. They use the cross tools which are provided in the normal Debian distribution. I don't use the (few) cross libraries from Debian.

Until end of last year, I added library packages from Cygwin (plus a few self compiled libraries, for example for braille support). See https://qemu.weilnetz.de/debian/.

In 2022 I switched to using the library packages from msys (I still have to write some documentation for that).

Stefan

#16 lore raw

Re: Debian MinGW cross compilation (was: Re: [PULL 2/3] qga-win32: Add support for NVME but type)

Quoted 18 lines · Stefan Weil

Am 03.06.22 um 14:56 schrieb Thomas Huth:

Quoted 16 lines · Daniel P. Berrangé
Quoted 1 line · Thomas Huth

...

Quoted 9 lines
Quoted 3 lines

Daniel, do you remember whether we supported Debian for MinGW cross-compilation in the past?

At one time we used to have Debian with the 3rd party 'mxe' builds of mingw added. It broke periodically and we deleted it in the end. It wasn't adding value over what Fedora mingw could provide as both more or less tracked the same versions of software in their mingw packages.

I wonder whether anybody still tried to compile with this mxe repo in recent times...?
Should we adjust our support statement and just mention Fedora there? Otherwise we should maybe explicitly mention MXE there next to "Debian", too, so that people don't get the impression that QEMU can be compiled with a vanilla MinGW installation on Debian?

Quoted 8 lines
Quoted 1 line

 Thomas

My QEMU for Windows builds are all done on Debian. They use the cross tools which are provided in the normal Debian distribution. I don't use the (few) cross libraries from Debian.

Until end of last year, I added library packages from Cygwin (plus a few self compiled libraries, for example for braille support). See https://qemu.weilnetz.de/debian/.

In 2022 I switched to using the library packages from msys (I still have to write some documentation for that).

Ok, thanks for the info. Seems like there are multiple ways to get the missing packages for the MinGW installation on Debian, so let's simply keep the support statement in the current shape.

Thomas

#17 lore raw

Re: [PULL 2/3] qga-win32: Add support for NVME but type

In reply to Konstantin Kostiuk
Quoted 3 lines · Konstantin Kostiuk

Thanks for the report. I will think about how to fix the build with old mingw-headers. BusTypeNvme and BusTypeSpaces were added to mingw-headers v 9.0.0

If you need to respin anyway you could fix the typo in the patch subject (s/but/bus/ I assume) :-)

-- PMM

#18 lore raw

[PULL 1/3] qga: add guest-get-diskstats command for Linux guests

In reply to Konstantin Kostiuk

From: luzhipeng <[email protected]>

Add a new 'guest-get-diskstats' command for report disk io statistics for Linux guests. This can be useful for getting io flow or handling IO fault, no need to enter guests.

Message-Id: <[email protected]>

---
 qga/commands-posix.c | 123 +++++++++++++++++++++++++++++++++++++++++++
 qga/commands-win32.c |   6 +++
 qga/qapi-schema.json |  86 ++++++++++++++++++++++++++++++
 3 files changed, 215 insertions(+)
qga/commands-posix.c +123 -0
index 69f209af87..12b50b7124 100644
@@ -2783,6 +2783,122 @@ GuestMemoryBlockInfo *qmp_guest_get_memory_block_info(Error **errp)
     return info;
 }
 
+#define MAX_NAME_LEN 128
+static GuestDiskStatsInfoList *guest_get_diskstats(Error **errp)
+{
+#ifdef CONFIG_LINUX
+    GuestDiskStatsInfoList *head = NULL, **tail = &head;
+    const char *diskstats = "/proc/diskstats";
+    FILE *fp;
+    size_t n;
+    char *line = NULL;
+
+    fp = fopen(diskstats, "r");
+    if (fp  == NULL) {
+        error_setg_errno(errp, errno, "open(\"%s\")", diskstats);
+        return NULL;
+    }
+
+    while (getline(&line, &n, fp) != -1) {
+        g_autofree GuestDiskStatsInfo *diskstatinfo = NULL;
+        g_autofree GuestDiskStats *diskstat = NULL;
+        char dev_name[MAX_NAME_LEN];
+        unsigned int ios_pgr, tot_ticks, rq_ticks, wr_ticks, dc_ticks, fl_ticks;
+        unsigned long rd_ios, rd_merges_or_rd_sec, rd_ticks_or_wr_sec, wr_ios;
+        unsigned long wr_merges, rd_sec_or_wr_ios, wr_sec;
+        unsigned long dc_ios, dc_merges, dc_sec, fl_ios;
+        unsigned int major, minor;
+        int i;
+
+        i = sscanf(line, "%u %u %s %lu %lu %lu"
+                   "%lu %lu %lu %lu %u %u %u %u"
+                   "%lu %lu %lu %u %lu %u",
+                   &major, &minor, dev_name,
+                   &rd_ios, &rd_merges_or_rd_sec, &rd_sec_or_wr_ios,
+                   &rd_ticks_or_wr_sec, &wr_ios, &wr_merges, &wr_sec,
+                   &wr_ticks, &ios_pgr, &tot_ticks, &rq_ticks,
+                   &dc_ios, &dc_merges, &dc_sec, &dc_ticks,
+                   &fl_ios, &fl_ticks);
+
+        if (i < 7) {
+            continue;
+        }
+
+        diskstatinfo = g_new0(GuestDiskStatsInfo, 1);
+        diskstatinfo->name = g_strdup(dev_name);
+        diskstatinfo->major = major;
+        diskstatinfo->minor = minor;
+
+        diskstat = g_new0(GuestDiskStats, 1);
+        if (i == 7) {
+            diskstat->has_read_ios = true;
+            diskstat->read_ios = rd_ios;
+            diskstat->has_read_sectors = true;
+            diskstat->read_sectors = rd_merges_or_rd_sec;
+            diskstat->has_write_ios = true;
+            diskstat->write_ios = rd_sec_or_wr_ios;
+            diskstat->has_write_sectors = true;
+            diskstat->write_sectors = rd_ticks_or_wr_sec;
+        }
+        if (i >= 14) {
+            diskstat->has_read_ios = true;
+            diskstat->read_ios = rd_ios;
+            diskstat->has_read_sectors = true;
+            diskstat->read_sectors = rd_sec_or_wr_ios;
+            diskstat->has_read_merges = true;
+            diskstat->read_merges = rd_merges_or_rd_sec;
+            diskstat->has_read_ticks = true;
+            diskstat->read_ticks = rd_ticks_or_wr_sec;
+            diskstat->has_write_ios = true;
+            diskstat->write_ios = wr_ios;
+            diskstat->has_write_sectors = true;
+            diskstat->write_sectors = wr_sec;
+            diskstat->has_write_merges = true;
+            diskstat->write_merges = wr_merges;
+            diskstat->has_write_ticks = true;
+            diskstat->write_ticks = wr_ticks;
+            diskstat->has_ios_pgr = true;
+            diskstat->ios_pgr = ios_pgr;
+            diskstat->has_total_ticks = true;
+            diskstat->total_ticks = tot_ticks;
+            diskstat->has_weight_ticks = true;
+            diskstat->weight_ticks = rq_ticks;
+        }
+        if (i >= 18) {
+            diskstat->has_discard_ios = true;
+            diskstat->discard_ios = dc_ios;
+            diskstat->has_discard_merges = true;
+            diskstat->discard_merges = dc_merges;
+            diskstat->has_discard_sectors = true;
+            diskstat->discard_sectors = dc_sec;
+            diskstat->has_discard_ticks = true;
+            diskstat->discard_ticks = dc_ticks;
+        }
+        if (i >= 20) {
+            diskstat->has_flush_ios = true;
+            diskstat->flush_ios = fl_ios;
+            diskstat->has_flush_ticks = true;
+            diskstat->flush_ticks = fl_ticks;
+        }
+
+        diskstatinfo->stats = g_steal_pointer(&diskstat);
+        QAPI_LIST_APPEND(tail, diskstatinfo);
+        diskstatinfo = NULL;
+    }
+    free(line);
+    fclose(fp);
+    return head;
+#else
+    g_debug("disk stats reporting available only for Linux");
+    return NULL;
+#endif
+}
+
+GuestDiskStatsInfoList *qmp_guest_get_diskstats(Error **errp)
+{
+    return guest_get_diskstats(errp);
+}
+
 #else /* defined(__linux__) */
 
 void qmp_guest_suspend_disk(Error **errp)
@@ -3131,6 +3247,13 @@ GuestDiskInfoList *qmp_guest_get_disks(Error **errp)
     return NULL;
 }
 
+GuestDiskStatsInfoList *qmp_guest_get_diskstats(Error **errp)
+{
+    error_setg(errp, QERR_UNSUPPORTED);
+    return NULL;
+}
+
+
 #endif /* CONFIG_FSFREEZE */
 
 #if !defined(CONFIG_FSTRIM)
qga/commands-win32.c +6 -0
index d56b5fd2a7..dcdeb76a68 100644
@@ -2532,3 +2532,9 @@ char *qga_get_host_name(Error **errp)
 
     return g_utf16_to_utf8(tmp, size, NULL, NULL, NULL);
 }
+
+GuestDiskStatsInfoList *qmp_guest_get_diskstats(Error **errp)
+{
+    error_setg(errp, QERR_UNSUPPORTED);
+    return NULL;
+}
qga/qapi-schema.json +86 -0

89 lines not on this page · raw message

Signature · 1 line
2.25.1