* [PATCH v2 1/1] qga-win: Add support of Windows Server 2025 in get-osinfo command
2024-02-22 2:53 [PATCH v2 0/1] update the array size Dehan Meng
@ 2024-02-22 2:53 ` Dehan Meng
0 siblings, 0 replies; 4+ messages in thread
From: Dehan Meng @ 2024-02-22 2:53 UTC (permalink / raw)
To: qemu-devel; +Cc: demeng, kkostiuk, michael.roth
Add support of Windows Server 2025 in get-osinfo command
Signed-off-by: Dehan Meng <demeng@redhat.com>
---
qga/commands-win32.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 697c65507c..b37fa7b5ba 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -2150,10 +2150,11 @@ typedef struct _ga_win_10_0_t {
char const *version_id;
} ga_win_10_0_t;
-static ga_win_10_0_t const WIN_10_0_SERVER_VERSION_MATRIX[4] = {
+static ga_win_10_0_t const WIN_10_0_SERVER_VERSION_MATRIX[5] = {
{14393, "Microsoft Windows Server 2016", "2016"},
{17763, "Microsoft Windows Server 2019", "2019"},
{20344, "Microsoft Windows Server 2022", "2022"},
+ {26040, "MIcrosoft Windows Server 2025", "2025"},
{0, 0}
};
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 0/1] update the array size
@ 2024-02-22 2:54 Dehan Meng
2024-02-22 2:54 ` [PATCH v2 1/1] qga-win: Add support of Windows Server 2025 in get-osinfo command Dehan Meng
0 siblings, 1 reply; 4+ messages in thread
From: Dehan Meng @ 2024-02-22 2:54 UTC (permalink / raw)
To: qemu-devel; +Cc: demeng, kkostiuk, michael.roth
v1 -> v2
update the array size "WIN_10_0_SERVER_VERSION_MATRIX" in case
array out of range elements.
Dehan Meng (1):
qga-win: Add support of Windows Server 2025 in get-osinfo command
qga/commands-win32.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--
2.35.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/1] qga-win: Add support of Windows Server 2025 in get-osinfo command
2024-02-22 2:54 [PATCH v2 0/1] update the array size Dehan Meng
@ 2024-02-22 2:54 ` Dehan Meng
2024-02-22 8:08 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 4+ messages in thread
From: Dehan Meng @ 2024-02-22 2:54 UTC (permalink / raw)
To: qemu-devel; +Cc: demeng, kkostiuk, michael.roth
Add support of Windows Server 2025 in get-osinfo command
Signed-off-by: Dehan Meng <demeng@redhat.com>
---
qga/commands-win32.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 697c65507c..b37fa7b5ba 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -2150,10 +2150,11 @@ typedef struct _ga_win_10_0_t {
char const *version_id;
} ga_win_10_0_t;
-static ga_win_10_0_t const WIN_10_0_SERVER_VERSION_MATRIX[4] = {
+static ga_win_10_0_t const WIN_10_0_SERVER_VERSION_MATRIX[5] = {
{14393, "Microsoft Windows Server 2016", "2016"},
{17763, "Microsoft Windows Server 2019", "2019"},
{20344, "Microsoft Windows Server 2022", "2022"},
+ {26040, "MIcrosoft Windows Server 2025", "2025"},
{0, 0}
};
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/1] qga-win: Add support of Windows Server 2025 in get-osinfo command
2024-02-22 2:54 ` [PATCH v2 1/1] qga-win: Add support of Windows Server 2025 in get-osinfo command Dehan Meng
@ 2024-02-22 8:08 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-22 8:08 UTC (permalink / raw)
To: Dehan Meng, qemu-devel; +Cc: kkostiuk, michael.roth
Hi Dehan,
On 22/2/24 03:54, Dehan Meng wrote:
> Add support of Windows Server 2025 in get-osinfo command
>
> Signed-off-by: Dehan Meng <demeng@redhat.com>
> ---
> qga/commands-win32.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/qga/commands-win32.c b/qga/commands-win32.c
> index 697c65507c..b37fa7b5ba 100644
> --- a/qga/commands-win32.c
> +++ b/qga/commands-win32.c
> @@ -2150,10 +2150,11 @@ typedef struct _ga_win_10_0_t {
> char const *version_id;
> } ga_win_10_0_t;
>
> -static ga_win_10_0_t const WIN_10_0_SERVER_VERSION_MATRIX[4] = {
> +static ga_win_10_0_t const WIN_10_0_SERVER_VERSION_MATRIX[5] = {
These arrays are NULL-terminated, they are iterated until
the NULL value is found:
while (table->version != NULL) {
So setting their size isn't really useful.
> {14393, "Microsoft Windows Server 2016", "2016"},
> {17763, "Microsoft Windows Server 2019", "2019"},
> {20344, "Microsoft Windows Server 2022", "2022"},
> + {26040, "MIcrosoft Windows Server 2025", "2025"},
> {0, 0}
> };
>
IMO this can be simplified in a preliminary patch as (untested):
-- >8 --
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index a1015757d8..c14c5cc4eb 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -2126,3 +2126,3 @@ typedef struct _ga_matrix_lookup_t {
-static ga_matrix_lookup_t const WIN_VERSION_MATRIX[2][7] = {
+static const ga_matrix_lookup_t WIN_VERSION_MATRIX[2][] = {
{
@@ -2135,3 +2135,3 @@ static ga_matrix_lookup_t const
WIN_VERSION_MATRIX[2][7] = {
{ 6, 3, "Microsoft Windows 8.1", "8.1"},
- { 0, 0, 0}
+ { }
},{
@@ -2143,4 +2143,3 @@ static ga_matrix_lookup_t const
WIN_VERSION_MATRIX[2][7] = {
{ 6, 3, "Microsoft Windows Server 2012 R2", "2012r2"},
- { 0, 0, 0},
- { 0, 0, 0}
+ { },
}
@@ -2154,3 +2153,3 @@ typedef struct _ga_win_10_0_t {
-static ga_win_10_0_t const WIN_10_0_SERVER_VERSION_MATRIX[4] = {
+static const ga_win_10_0_t WIN_10_0_SERVER_VERSION_MATRIX[] = {
{14393, "Microsoft Windows Server 2016", "2016"},
@@ -2158,9 +2157,9 @@ static ga_win_10_0_t const
WIN_10_0_SERVER_VERSION_MATRIX[4] = {
{20344, "Microsoft Windows Server 2022", "2022"},
- {0, 0}
+ { }
};
-static ga_win_10_0_t const WIN_10_0_CLIENT_VERSION_MATRIX[3] = {
+static const ga_win_10_0_t WIN_10_0_CLIENT_VERSION_MATRIX[] = {
{10240, "Microsoft Windows 10", "10"},
{22000, "Microsoft Windows 11", "11"},
- {0, 0}
+ { }
};
---
Then your patch becomes a one-line one.
Regard,
Phil.
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-02-22 8:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-22 2:54 [PATCH v2 0/1] update the array size Dehan Meng
2024-02-22 2:54 ` [PATCH v2 1/1] qga-win: Add support of Windows Server 2025 in get-osinfo command Dehan Meng
2024-02-22 8:08 ` Philippe Mathieu-Daudé
-- strict thread matches above, loose matches on Subject: below --
2024-02-22 2:53 [PATCH v2 0/1] update the array size Dehan Meng
2024-02-22 2:53 ` [PATCH v2 1/1] qga-win: Add support of Windows Server 2025 in get-osinfo command Dehan Meng
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).