Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qemu: update to 9.1.3 #25980

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions utils/qemu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=qemu
PKG_VERSION:=9.1.2
PKG_VERSION:=9.1.3
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=19fd9d7535a54d6e044e186402aa3b3b1bdfa87c392ec8884855592c8510c96f
PKG_HASH:=480a77a0ed13a9b39415f639aa020b4eb0d7cc5a52569510dfd830b3af1bac89
PKG_SOURCE_URL:=https://download.qemu.org/
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE tcg/LICENSE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
From 80ec6872aceb18c68b1cf5b6f8acd6ad667cbd4f Mon Sep 17 00:00:00 2001
From: Yousong Zhou <[email protected]>
Date: Thu, 17 Dec 2020 15:55:55 +0800
Subject: [PATCH] qga: invoke separate applets for guest-shutdown modes

/sbin/shutdown is not available on OpenWrt by default

Origin: "main/qemu: fix shutdown from guest agent"
https://gitlab.alpinelinux.org/alpine/aports/commit/76b81b486480fd9c3294cd420bcf2df01c27790d
Origin: community/qemu: fix qemu-guest-agent patch
https://gitlab.alpinelinux.org/alpine/aports/-/blob/b720d51ec844d4754dd5b29084350aa1f5c9a74d/community/qemu/guest-agent-shutdown.patch
---
qga/commands-posix.c | 5 +++++
1 file changed, 5 insertions(+)

--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -217,6 +217,7 @@ out:
void qmp_guest_shutdown(const char *mode, Error **errp)
{
@@ -219,43 +219,21 @@ void qmp_guest_shutdown(const char *mode
const char *shutdown_flag;
+ const char *fallback_cmd = NULL;
Error *local_err = NULL;

#ifdef CONFIG_SOLARIS
@@ -236,10 +237,13 @@ void qmp_guest_shutdown(const char *mode
-#ifdef CONFIG_SOLARIS
- const char *powerdown_flag = "-i5";
- const char *halt_flag = "-i0";
- const char *reboot_flag = "-i6";
-#elif defined(CONFIG_BSD)
- const char *powerdown_flag = "-p";
- const char *halt_flag = "-h";
- const char *reboot_flag = "-r";
-#else
- const char *powerdown_flag = "-P";
- const char *halt_flag = "-H";
- const char *reboot_flag = "-r";
-#endif
+ const char *argv[] = {NULL, NULL};

slog("guest-shutdown called, mode: %s", mode);
if (!mode || strcmp(mode, "powerdown") == 0) {
shutdown_flag = powerdown_flag;
+ fallback_cmd = "/sbin/poweroff";
- shutdown_flag = powerdown_flag;
+ argv[0] = "poweroff";
} else if (strcmp(mode, "halt") == 0) {
shutdown_flag = halt_flag;
+ fallback_cmd = "/sbin/halt";
- shutdown_flag = halt_flag;
+ argv[0] = "halt";
} else if (strcmp(mode, "reboot") == 0) {
shutdown_flag = reboot_flag;
+ fallback_cmd = "/sbin/reboot";
- shutdown_flag = reboot_flag;
+ argv[0] = "reboot";
} else {
error_setg(errp,
"mode is invalid (valid values are: halt|powerdown|reboot");
@@ -258,8 +262,12 @@ void qmp_guest_shutdown(const char *mode
return;
}

- const char *argv[] = {"/sbin/shutdown",
-#ifdef CONFIG_SOLARIS
- shutdown_flag, "-g0", "-y",
-#elif defined(CONFIG_BSD)
- shutdown_flag, "+0",
-#else
- "-h", shutdown_flag, "+0",
-#endif
- "hypervisor initiated shutdown", (char *) NULL};
-
ga_run_command(argv, NULL, "shutdown", &local_err);
if (local_err) {
- error_propagate(errp, local_err);
- return;
+ const char *fallback_argv[] = {fallback_cmd, (char *) NULL};
+ ga_run_command(fallback_argv, NULL, fallback_cmd, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
}

/* succeeded */
error_propagate(errp, local_err);
Loading