Skip to content

Commit

Permalink
Update Podman and patches
Browse files Browse the repository at this point in the history
  • Loading branch information
arixmkii committed Apr 19, 2024
1 parent d885bda commit c1b9283
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 67 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/prepare-podman-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: workflow_dispatch

env:
PODMAN_GITURL: https://github.com/containers/podman.git
PODMAN_SHA: f3276e77aea34a175b0fce108313aaff8614e5ad
PODMAN_SHA: db93e2cf2b8a6f9a8721cb7cfb8bc81ce29e0ac8

jobs:
build:
Expand Down Expand Up @@ -58,7 +58,8 @@ jobs:
git remote add origin $PODMAN_GITURL
git fetch --depth 1 origin $PODMAN_SHA
git checkout FETCH_HEAD
patch --binary -l -p 1 < ../patches/podman/0001-Implement-QEMU-Podman-machine-on-Windows.patch
patch --binary -l -p 1 < ../patches/podman/0001-Enable-compilation-for-Windows-on-parts-of-QEMU-mach.patch
patch --binary -l -p 1 < ../patches/podman/0002-Implement-QEMU-Podman-machine-on-Windows.patch
- name: "🛠️ Build Podman"
working-directory: podman-release
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
From e7b676dfafa1704ad00317e23db93b79614660f1 Mon Sep 17 00:00:00 2001
From: Arthur Sengileyev <[email protected]>
Date: Fri, 19 Apr 2024 16:38:38 +0300
Subject: [PATCH] Enable compilation for Windows on parts of QEMU machine
provider

Signed-off-by: Arthur Sengileyev <[email protected]>
---
pkg/machine/qemu/machine.go | 2 +-
pkg/machine/qemu/options_windows_amd64.go | 2 +-
pkg/machine/qemu/stubber.go | 2 +-
pkg/machine/vmconfigs/config_windows.go | 10 +++++++++-
4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go
index 2595eb54f..1373663c3 100644
--- a/pkg/machine/qemu/machine.go
+++ b/pkg/machine/qemu/machine.go
@@ -1,4 +1,4 @@
-//go:build linux || freebsd
+//go:build linux || freebsd || windows

package qemu

diff --git a/pkg/machine/qemu/options_windows_amd64.go b/pkg/machine/qemu/options_windows_amd64.go
index 1a929a5f3..6e0ba0271 100644
--- a/pkg/machine/qemu/options_windows_amd64.go
+++ b/pkg/machine/qemu/options_windows_amd64.go
@@ -1,4 +1,4 @@
-//go:build tempoff
+//go:build windows && amd64

package qemu

diff --git a/pkg/machine/qemu/stubber.go b/pkg/machine/qemu/stubber.go
index dbd762a0d..21b3c7283 100644
--- a/pkg/machine/qemu/stubber.go
+++ b/pkg/machine/qemu/stubber.go
@@ -1,4 +1,4 @@
-//go:build linux || freebsd
+//go:build linux || freebsd || windows

package qemu

diff --git a/pkg/machine/vmconfigs/config_windows.go b/pkg/machine/vmconfigs/config_windows.go
index 0562490c7..f732226f6 100644
--- a/pkg/machine/vmconfigs/config_windows.go
+++ b/pkg/machine/vmconfigs/config_windows.go
@@ -1,7 +1,9 @@
package vmconfigs

import (
+ "github.com/containers/podman/v5/pkg/machine/define"
"github.com/containers/podman/v5/pkg/machine/hyperv/vsock"
+ "github.com/containers/podman/v5/pkg/machine/qemu/command"
)

type HyperVConfig struct {
@@ -17,8 +19,14 @@ type WSLConfig struct {
UserModeNetworking bool
}

+type QEMUConfig struct {
+ // QMPMonitor is the qemu monitor object for sending commands
+ QMPMonitor command.Monitor
+ // QEMUPidPath is where to write the PID for QEMU when running
+ QEMUPidPath *define.VMFile
+}
+
// Stubs
-type QEMUConfig struct{}
type AppleHVConfig struct{}

func getHostUID() int {
--
2.44.0

Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ Signed-off-by: Arthur Sengileyev <[email protected]>
pkg/machine/provider/platform_windows.go | 2 ++
pkg/machine/provider/platform_windows_amd64.go | 10 ++++++++++
pkg/machine/provider/platform_windows_arm64.go | 12 ++++++++++++
pkg/machine/qemu/machine.go | 2 +-
pkg/machine/qemu/options_windows_amd64.go | 2 +-
pkg/machine/qemu/stubber.go | 2 +-
pkg/machine/vmconfigs/config_windows.go | 10 +++++++++-
9 files changed, 50 insertions(+), 4 deletions(-)
5 files changed, 38 insertions(+)
create mode 100644 pkg/machine/provider/platform_windows_amd64.go
create mode 100644 pkg/machine/provider/platform_windows_arm64.go

Expand Down Expand Up @@ -101,66 +97,6 @@ index 000000000..ded7ad7b1
+func getQemuProvider() (vmconfigs.VMProvider, error) {
+ return nil, fmt.Errorf("unsupported virtualization provider: `%s`", define.QemuVirt.String())
+}
diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go
index 2595eb54f..1373663c3 100644
--- a/pkg/machine/qemu/machine.go
+++ b/pkg/machine/qemu/machine.go
@@ -1,4 +1,4 @@
-//go:build linux || freebsd
+//go:build linux || freebsd || windows

package qemu

diff --git a/pkg/machine/qemu/options_windows_amd64.go b/pkg/machine/qemu/options_windows_amd64.go
index 1a929a5f3..6e0ba0271 100644
--- a/pkg/machine/qemu/options_windows_amd64.go
+++ b/pkg/machine/qemu/options_windows_amd64.go
@@ -1,4 +1,4 @@
-//go:build tempoff
+//go:build windows && amd64

package qemu

diff --git a/pkg/machine/qemu/stubber.go b/pkg/machine/qemu/stubber.go
index dbd762a0d..21b3c7283 100644
--- a/pkg/machine/qemu/stubber.go
+++ b/pkg/machine/qemu/stubber.go
@@ -1,4 +1,4 @@
-//go:build linux || freebsd
+//go:build linux || freebsd || windows

package qemu

diff --git a/pkg/machine/vmconfigs/config_windows.go b/pkg/machine/vmconfigs/config_windows.go
index 0562490c7..f732226f6 100644
--- a/pkg/machine/vmconfigs/config_windows.go
+++ b/pkg/machine/vmconfigs/config_windows.go
@@ -1,7 +1,9 @@
package vmconfigs

import (
+ "github.com/containers/podman/v5/pkg/machine/define"
"github.com/containers/podman/v5/pkg/machine/hyperv/vsock"
+ "github.com/containers/podman/v5/pkg/machine/qemu/command"
)

type HyperVConfig struct {
@@ -17,8 +19,14 @@ type WSLConfig struct {
UserModeNetworking bool
}

+type QEMUConfig struct {
+ // QMPMonitor is the qemu monitor object for sending commands
+ QMPMonitor command.Monitor
+ // QEMUPidPath is where to write the PID for QEMU when running
+ QEMUPidPath *define.VMFile
+}
+
// Stubs
-type QEMUConfig struct{}
type AppleHVConfig struct{}

func getHostUID() int {
--
2.44.0

0 comments on commit c1b9283

Please sign in to comment.