Rebase qemu-ga to version 8.0

Set version to 106.0.0

Resolves: RHEL-385 - Rebase mingw-qemu-ga-win to QEMU 8.0
Resolves: RHEL-408 - Add provides, obsoletes for mingw-qemu-ga-win

Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
This commit is contained in:
Konstantin Kostiuk 2023-04-23 13:50:01 +03:00
parent 93dff1df22
commit d41246c7f8
7 changed files with 19 additions and 244 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
/qemu-7.0.0
/qemu-7.1.0.tar.bz2
/qemu-7.1.0
/qemu-8.0.0.tar.bz2

View File

@ -13,7 +13,7 @@ index 91ff57278e..586de296f5 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-7.1.0
+105.0.4
-8.0.0
+106.0.0
--
2.17.2

View File

@ -1,27 +0,0 @@
From c84142bfb7021a09c862127dbcd67c7f659d7c40 Mon Sep 17 00:00:00 2001
From: Konstantin Kostiuk <kkostiuk@redhat.com>
Date: Wed, 8 Feb 2023 17:23:18 +0200
Subject: [PATCH 1/2] qga/win: Remove change action from MSI installer
resolves: rhbz#2167436
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
---
qga/installer/qemu-ga.wxs | 1 +
1 file changed, 1 insertion(+)
diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs
index 51340f7ecc..feb629ec47 100644
--- a/qga/installer/qemu-ga.wxs
+++ b/qga/installer/qemu-ga.wxs
@@ -31,6 +31,7 @@
/>
<Media Id="1" Cabinet="qemu_ga.$(var.QEMU_GA_VERSION).cab" EmbedCab="yes" />
<Property Id="WHSLogo">1</Property>
+ <Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
<MajorUpgrade
DowngradeErrorMessage="Error: A newer version of QEMU guest agent is already installed."
/>
--
2.25.1

View File

@ -1,117 +0,0 @@
From git@z Thu Jan 1 00:00:00 1970
Subject: [PATCH 1/2] qga:/qga-win: adding a empty PCI address creation function
From: Kfir Manor <kfir@daynix.com>
Date: Sun, 20 Nov 2022 16:00:43 +0200
Message-Id: <20221120140044.752503-2-kfir@daynix.com>
To: qemu-devel@nongnu.org, Konstantin Kostiuk <kkostiuk@redhat.com>, Michael Roth <michael.roth@amd.com>
Cc: Yan Vugenfirer <yan@daynix.com>
In-Reply-To: <20221120140044.752503-1-kfir@daynix.com>
References: <20221120140044.752503-1-kfir@daynix.com>
List-Id: <qemu-devel.nongnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Refactoring code to avoid duplication of creating an empty PCI address code.
Signed-off-by: Kfir Manor <kfir@daynix.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
qga/commands-win32.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index ec9f55b453..a645480496 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -599,6 +599,18 @@ static void get_pci_address_for_device(GuestPCIAddress *pci,
}
}
+static GuestPCIAddress *get_empty_pci_address(void)
+{
+ GuestPCIAddress *pci = NULL;
+
+ pci = g_malloc0(sizeof(*pci));
+ pci->domain = -1;
+ pci->slot = -1;
+ pci->function = -1;
+ pci->bus = -1;
+ return pci;
+}
+
static GuestPCIAddress *get_pci_info(int number, Error **errp)
{
HDEVINFO dev_info = INVALID_HANDLE_VALUE;
@@ -608,13 +620,7 @@ static GuestPCIAddress *get_pci_info(int number, Error **errp)
SP_DEVICE_INTERFACE_DATA dev_iface_data;
HANDLE dev_file;
int i;
- GuestPCIAddress *pci = NULL;
-
- pci = g_malloc0(sizeof(*pci));
- pci->domain = -1;
- pci->slot = -1;
- pci->function = -1;
- pci->bus = -1;
+ GuestPCIAddress *pci = get_empty_pci_address();
dev_info = SetupDiGetClassDevs(&GUID_DEVINTERFACE_DISK, 0, 0,
DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
--
2.38.1
From git@z Thu Jan 1 00:00:00 1970
Subject: [PATCH 2/2] qga:/qga-win: skip getting pci info for USB disks
From: Kfir Manor <kfir@daynix.com>
Date: Sun, 20 Nov 2022 16:00:44 +0200
Message-Id: <20221120140044.752503-3-kfir@daynix.com>
To: qemu-devel@nongnu.org, Konstantin Kostiuk <kkostiuk@redhat.com>, Michael Roth <michael.roth@amd.com>
Cc: Yan Vugenfirer <yan@daynix.com>
In-Reply-To: <20221120140044.752503-1-kfir@daynix.com>
References: <20221120140044.752503-1-kfir@daynix.com>
List-Id: <qemu-devel.nongnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Skip getting PCI info from disks type USB and give them an empty PCI address instead.
Signed-off-by: Kfir Manor <kfir@daynix.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
qga/commands-win32.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index a645480496..14c43b3de5 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -878,10 +878,14 @@ static void get_single_disk_info(int disk_number,
* if that doesn't hold since that suggests some other unexpected
* breakage
*/
- disk->pci_controller = get_pci_info(disk_number, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- goto err_close;
+ if (disk->bus_type == GUEST_DISK_BUS_TYPE_USB) {
+ disk->pci_controller = get_empty_pci_address();
+ } else {
+ disk->pci_controller = get_pci_info(disk_number, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ goto err_close;
+ }
}
if (disk->bus_type == GUEST_DISK_BUS_TYPE_SCSI
|| disk->bus_type == GUEST_DISK_BUS_TYPE_IDE
--
2.38.1

View File

@ -1,85 +0,0 @@
From 66d7a1b76c052cdf45d30074b6f1dacc456827d1 Mon Sep 17 00:00:00 2001
From: Konstantin Kostiuk <kkostiuk@redhat.com>
Date: Mon, 13 Feb 2023 17:45:51 +0200
Subject: [PATCH 2/2] qga/win32: Use rundll for VSS installation
Add specific an entry points for rundll which is
just a wrapper for COMRegister/COMUnregister functions.
resolves: rhbz#2167436
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
---
qga/installer/qemu-ga.wxs | 10 +++++-----
qga/vss-win32/install.cpp | 9 +++++++++
qga/vss-win32/qga-vss.def | 2 ++
3 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs
index feb629ec47..46ae9e7a13 100644
--- a/qga/installer/qemu-ga.wxs
+++ b/qga/installer/qemu-ga.wxs
@@ -127,22 +127,22 @@
</Directory>
</Directory>
- <Property Id="cmd" Value="cmd.exe"/>
+ <Property Id="rundll" Value="rundll32.exe"/>
<Property Id="REINSTALLMODE" Value="amus"/>
<?ifdef var.InstallVss?>
<CustomAction Id="RegisterCom"
- ExeCommand='/c "[qemu_ga_directory]qemu-ga.exe" -s vss-install'
+ ExeCommand='"[qemu_ga_directory]qga-vss.dll",DLLCOMRegister'
Execute="deferred"
- Property="cmd"
+ Property="rundll"
Impersonate="no"
Return="check"
>
</CustomAction>
<CustomAction Id="UnRegisterCom"
- ExeCommand='/c "[qemu_ga_directory]qemu-ga.exe" -s vss-uninstall'
+ ExeCommand='"[qemu_ga_directory]qga-vss.dll",DLLCOMUnregister'
Execute="deferred"
- Property="cmd"
+ Property="rundll"
Impersonate="no"
Return="check"
>
diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
index b57508fbe0..68662a6dfc 100644
--- a/qga/vss-win32/install.cpp
+++ b/qga/vss-win32/install.cpp
@@ -357,6 +357,15 @@ out:
return hr;
}
+STDAPI_(void) CALLBACK DLLCOMRegister(HWND, HINSTANCE, LPSTR, int)
+{
+ COMRegister();
+}
+
+STDAPI_(void) CALLBACK DLLCOMUnregister(HWND, HINSTANCE, LPSTR, int)
+{
+ COMUnregister();
+}
static BOOL CreateRegistryKey(LPCTSTR key, LPCTSTR value, LPCTSTR data)
{
diff --git a/qga/vss-win32/qga-vss.def b/qga/vss-win32/qga-vss.def
index 927782c31b..ee97a81427 100644
--- a/qga/vss-win32/qga-vss.def
+++ b/qga/vss-win32/qga-vss.def
@@ -1,6 +1,8 @@
LIBRARY "QGA-PROVIDER.DLL"
EXPORTS
+ DLLCOMRegister
+ DLLCOMUnregister
COMRegister PRIVATE
COMUnregister PRIVATE
DllCanUnloadNow PRIVATE
--
2.25.1

View File

@ -1,12 +1,12 @@
%{?mingw_package_header}
%define with_vss 1
%define qemu_version 7.1.0
%define qemu_version 8.0.0
%define ga_manufacturer "RedHat"
%define ga_distro "RHEL"
Name: mingw-qemu-ga-win
Version: 105.0.4
Version: 106.0.0
Release: 1%{?dist}
Summary: Qemus Guest agent for Windows
@ -19,9 +19,6 @@ Requires(postun): systemd-units
Source0: http://wiki.qemu.org/download/qemu-%{qemu_version}.tar.bz2
Patch0001: 0001-Change-Version.patch
Patch0002: 0002-qga-win-usb-support.patch
Patch0003: 0001-qga-win-Remove-change-action-from-MSI-installer.patch
Patch0004: 0002-qga-win32-Use-rundll-for-VSS-installation.patch
BuildArch: noarch
@ -30,6 +27,8 @@ Provides: bundled(mingw-gcc-c++)
Provides: bundled(mingw-gettext)
Provides: bundled(mingw-glib2)
Provides: bundled(mingw-pcre)
Provides: qemu-ga-win = %{version}
Obsoletes: qemu-ga-win < 105.0.0
# based on https://gitlab.com/qemu-project/qemu/-/blob/v7.1.0/qga/installer/qemu-ga.wxs
BuildRequires: libtool
@ -65,9 +64,6 @@ This package does not need to be installed on the host OS.
%prep
%setup -q -n qemu-%{qemu_version}
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
%patch0004 -p1
%build
@ -81,9 +77,10 @@ export QEMU_GA_VERSION="%{version}"
%{mingw32_env}
./configure \
--disable-docs \
--disable-zlib-test \
--target-list=x86_64-softmmu \
--disable-system \
--disable-user \
--cross-prefix=i686-w64-mingw32- \
--enable-guest-agent \
--enable-guest-agent-msi \
%if %{with_vss}
--enable-qga-vss \
@ -100,9 +97,10 @@ cp build/qga/qemu-ga-i386.msi $RPM_BUILD_ROOT%{mingw32_bindir}
%{mingw64_env}
./configure \
--disable-docs \
--disable-zlib-test \
--target-list=x86_64-softmmu \
--disable-system \
--disable-user \
--cross-prefix=x86_64-w64-mingw32- \
--enable-guest-agent \
--enable-guest-agent-msi \
%if %{with_vss}
--enable-qga-vss \
@ -122,6 +120,11 @@ cp build/qga/qemu-ga-x86_64.msi $RPM_BUILD_ROOT%{mingw64_bindir}
%{mingw64_bindir}/qemu-ga*
%changelog
* Sun Apr 23 2023 Konstantin Kostiuk <kkostiuk@redhat.com> 106.0.0
- Set version to 106.0.0
- RHEL-408 - Add provides, obsoletes for mingw-qemu-ga-win
- RHEL-385 - Rebase mingw-qemu-ga-win to QEMU 8.0
* Wed Feb 15 2023 Konstantin Kostiuk <kkostiuk@redhat.com> 105.0.4
- Set version to 105.0.4
- BZ#2167436

View File

@ -1 +1 @@
SHA512 (qemu-7.1.0.tar.bz2) = 0bc22ebecf857e354f59e4856d9b24a0886d3b1e48121a4e8753e2f0bcc9fb1038c703a73dcef3a21baea48ef34c31af6f300430caa118e84cbc91fedd99b8b2
SHA512 (qemu-8.0.0.tar.bz2) = 296f33d8c781813f1ec2ed0f2ef7b6ab62704b4616363b26fa5268c12cbd176c7f10a58be76a125d143c837e1e6a8adac1e9567bd8a7516973b71cbe1e9ff4b7