mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge tag 'qga-pull-2025-08-29-v2' of https://github.com/kostyanf14/qemu into staging
qga-pull-2025-08-29-v2 # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCgAdFiEEwsLBCepDxjwUI+uE711egWG6hOcFAmi1foEACgkQ711egWG6 # hOf0wA/+JhdZQUYWsdADK30KdAByRGF4ujz6n2c3smaYNxZh9M0fjmwy9TVjA3P9 # f2fLf1/ltgKwd8MVxR8UAE143Oq7mt2Qe+p37ftkMRtBnIyF7KVzlco3d+lH76PL # 4zW8rCbYnhYonGD1mwTAgxHnmrEv91ZqgBH46o+A8vFUUog+QgtHj5y5YIPTTxOi # BK+mkhG7F5nCjjl8MTFyiASRdHeYLV0cYhV+baX/sbnFU92ewojQhUFQwbxlwNH+ # yl5/+K8vlHf1OEMljCGtWabZwm5voj/hUi2apcdJtHycx3J4LOa9XpWknOZrUiJe # ZR7ad1FAmLnoDO3MqRQvQpUDyGDwC4rBhyhcxImGljbxPlRaOV8NRjeOZYuDvb9Z # Gv75dmAwNkLDTvCteMIsyTlavpVemu6sePmbOnFQmfRebl9Qcn5eSDoyoQX3QOp7 # SUZStaY6fLZCFnHOM97Yd5JFn5UuAlw/ZVGQjK5EYnAZX+7s0CbYmx5OSNusMPzt # IW2Z3ydok0KkdbQ0Yhpm2j2nzvQr2gsuquaddcqjZg7i9F30CYbBAGWp91MSpJgx # xS5aURvB1psktFNuA0WtpDkMN8sNnjNMIreh4StXf/tYg5pYi8yHYlRYkeTrxhLl # HHaWfb2nAlZaQPjx6CXFvUKv0W2kAn+12WFzVMcM2IrQ/ESyUyE= # =y5F8 # -----END PGP SIGNATURE----- # gpg: Signature made Mon 01 Sep 2025 01:07:45 PM CEST # gpg: using RSA key C2C2C109EA43C63C1423EB84EF5D5E8161BA84E7 # gpg: Good signature from "Kostiantyn Kostiuk (Upstream PR sign) <kkostiuk@redhat.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: C2C2 C109 EA43 C63C 1423 EB84 EF5D 5E81 61BA 84E7 * tag 'qga-pull-2025-08-29-v2' of https://github.com/kostyanf14/qemu: qga: Fix truncated output handling in guest-exec status reporting qga/installer: Remove QGA VSS if QGA installation failed qga-vss: Write hex value of error in log qga: ignore channel_init() fail if 'retry_path' is set qga: Fix channel initialization check in run_agent_once qga-vss: Remove unused dependencies qga-vss: Replace asserts with condition and report error qga: fix potentially not initialized nr_volumes in qga_vss_fsfreeze() qga: Fix ubsan warning Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -400,10 +400,10 @@ static bool build_guest_fsinfo_for_pci_dev(char const *syspath,
|
||||
Error **errp)
|
||||
{
|
||||
unsigned int pci[4], host, hosts[8], tgt[3];
|
||||
int i, nhosts = 0, pcilen;
|
||||
int i, offset, nhosts = 0, pcilen;
|
||||
GuestPCIAddress *pciaddr = disk->pci_controller;
|
||||
bool has_ata = false, has_host = false, has_tgt = false;
|
||||
char *p, *q, *driver = NULL;
|
||||
char *p, *driver = NULL;
|
||||
bool ret = false;
|
||||
|
||||
p = strstr(syspath, "/devices/pci");
|
||||
@@ -445,13 +445,13 @@ static bool build_guest_fsinfo_for_pci_dev(char const *syspath,
|
||||
|
||||
p = strstr(syspath, "/ata");
|
||||
if (p) {
|
||||
q = p + 4;
|
||||
offset = 4;
|
||||
has_ata = true;
|
||||
} else {
|
||||
p = strstr(syspath, "/host");
|
||||
q = p + 5;
|
||||
offset = 5;
|
||||
}
|
||||
if (p && sscanf(q, "%u", &host) == 1) {
|
||||
if (p && sscanf(p + offset, "%u", &host) == 1) {
|
||||
has_host = true;
|
||||
nhosts = build_hosts(syspath, p, has_ata, hosts,
|
||||
ARRAY_SIZE(hosts), errp);
|
||||
|
||||
+4
-2
@@ -205,13 +205,15 @@ GuestExecStatus *qmp_guest_exec_status(int64_t pid, Error **errp)
|
||||
#endif
|
||||
if (gei->out.length > 0) {
|
||||
ges->out_data = g_base64_encode(gei->out.data, gei->out.length);
|
||||
ges->has_out_truncated = gei->out.truncated;
|
||||
ges->has_out_truncated = true;
|
||||
ges->out_truncated = gei->out.truncated;
|
||||
}
|
||||
g_free(gei->out.data);
|
||||
|
||||
if (gei->err.length > 0) {
|
||||
ges->err_data = g_base64_encode(gei->err.data, gei->err.length);
|
||||
ges->has_err_truncated = gei->err.truncated;
|
||||
ges->has_err_truncated = true;
|
||||
ges->err_truncated = gei->err.truncated;
|
||||
}
|
||||
g_free(gei->err.data);
|
||||
|
||||
|
||||
@@ -151,6 +151,14 @@
|
||||
Return="check"
|
||||
>
|
||||
</CustomAction>
|
||||
<CustomAction Id="UnRegisterCom_Rollback"
|
||||
ExeCommand='"[qemu_ga_directory]qga-vss.dll",DLLCOMUnregister'
|
||||
Execute="rollback"
|
||||
Property="rundll"
|
||||
Impersonate="no"
|
||||
Return="check"
|
||||
>
|
||||
</CustomAction>
|
||||
<?endif?>
|
||||
|
||||
<Feature Id="QEMUFeature" Title="QEMU Guest Agent" Level="1">
|
||||
@@ -174,8 +182,19 @@
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<?ifdef var.InstallVss?>
|
||||
<Custom Action="UnRegisterCom" After="StopServices">Installed</Custom>
|
||||
<Custom Action="RegisterCom" After="InstallServices">NOT REMOVE</Custom>
|
||||
<!-- Use explicit Sequence number to provide an absolute position in the sequence-->
|
||||
<!-- This is needed to set "UnRegisterCom_Rollback" before "RegisterCom" and after "InstallFiles"-->
|
||||
<!-- but, Wix detect this double condition incorrectly -->
|
||||
|
||||
<!-- UnRegisterCom_Rollback (for install rollback): at 5849, right before RegisterCom (5850)-->
|
||||
<!-- Runs only if the installation fails and rolls back-->
|
||||
<Custom Action="UnRegisterCom_Rollback" Sequence="5849">NOT REMOVE</Custom>
|
||||
|
||||
<!-- RegisterCom (for install): at 5850, right after InstallFiles (5849) (old: After="InstallServices")-->
|
||||
<Custom Action="RegisterCom" Sequence="5850">NOT REMOVE</Custom>
|
||||
|
||||
<!-- UnRegisterCom (for uninstall): at 1901, right after StopServices (1900) (old: After="StopServices")-->
|
||||
<Custom Action="UnRegisterCom" Sequence="1901">Installed</Custom>
|
||||
<?endif?>
|
||||
</InstallExecuteSequence>
|
||||
</Product>
|
||||
|
||||
+7
-3
@@ -1512,8 +1512,12 @@ static GAState *initialize_agent(GAConfig *config, int socket_activation)
|
||||
|
||||
if (!channel_init(s, s->config->method, s->config->channel_path,
|
||||
s->socket_activation ? FIRST_SOCKET_ACTIVATION_FD : -1)) {
|
||||
g_critical("failed to initialize guest agent channel");
|
||||
return NULL;
|
||||
if (s->config->retry_path) {
|
||||
g_info("failed to initialize guest agent channel, will retry");
|
||||
} else {
|
||||
g_critical("failed to initialize guest agent channel");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (config->daemonize) {
|
||||
@@ -1563,7 +1567,7 @@ static void cleanup_agent(GAState *s)
|
||||
static int run_agent_once(GAState *s)
|
||||
{
|
||||
if (!s->channel &&
|
||||
channel_init(s, s->config->method, s->config->channel_path,
|
||||
!channel_init(s, s->config->method, s->config->channel_path,
|
||||
s->socket_activation ? FIRST_SOCKET_ACTIVATION_FD : -1)) {
|
||||
g_critical("failed to initialize guest agent channel");
|
||||
return EXIT_FAILURE;
|
||||
|
||||
@@ -157,6 +157,8 @@ void qga_vss_fsfreeze(int *nr_volume, bool freeze,
|
||||
.errp = errp,
|
||||
};
|
||||
|
||||
*nr_volume = 0;
|
||||
|
||||
g_assert(errp); /* requester.cpp requires it */
|
||||
func = (QGAVSSRequesterFunc)GetProcAddress(provider_lib, func_name);
|
||||
if (!func) {
|
||||
|
||||
@@ -13,13 +13,11 @@ qga_vss = shared_module(
|
||||
link_args: link_args,
|
||||
vs_module_defs: 'qga-vss.def',
|
||||
dependencies: [
|
||||
glib,
|
||||
socket,
|
||||
cc.find_library('ole32'),
|
||||
cc.find_library('oleaut32'),
|
||||
cc.find_library('shlwapi'),
|
||||
cc.find_library('uuid'),
|
||||
cc.find_library('intl')
|
||||
cc.find_library('uuid')
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
@@ -28,8 +28,9 @@
|
||||
|
||||
#define err_set(e, err, fmt, ...) { \
|
||||
(e)->error_setg_win32_wrapper((e)->errp, __FILE__, __LINE__, __func__, \
|
||||
err, fmt, ## __VA_ARGS__); \
|
||||
qga_debug(fmt, ## __VA_ARGS__); \
|
||||
err, fmt ": Windows error 0x%lx", \
|
||||
## __VA_ARGS__, err); \
|
||||
qga_debug(fmt ": Windows error 0x%lx", ## __VA_ARGS__, err); \
|
||||
}
|
||||
/* Bad idea, works only when (e)->errp != NULL: */
|
||||
#define err_is_set(e) ((e)->errp && *(e)->errp)
|
||||
@@ -347,7 +348,12 @@ void requester_freeze(int *num_vols, void *mountpoints, ErrorSet *errset)
|
||||
goto out;
|
||||
}
|
||||
|
||||
assert(pCreateVssBackupComponents != NULL);
|
||||
if (!pCreateVssBackupComponents) {
|
||||
err_set(errset, (HRESULT)ERROR_PROC_NOT_FOUND,
|
||||
"CreateVssBackupComponents proc address absent. Did you call requester_init()?");
|
||||
goto out;
|
||||
}
|
||||
|
||||
hr = pCreateVssBackupComponents(&vss_ctx.pVssbc);
|
||||
if (FAILED(hr)) {
|
||||
err_set(errset, hr, "failed to create VSS backup components");
|
||||
@@ -579,8 +585,16 @@ void requester_thaw(int *num_vols, void *mountpints, ErrorSet *errset)
|
||||
/* Tell the provider that the snapshot is finished. */
|
||||
SetEvent(vss_ctx.hEventThaw);
|
||||
|
||||
assert(vss_ctx.pVssbc);
|
||||
assert(vss_ctx.pAsyncSnapshot);
|
||||
if (!vss_ctx.pVssbc) {
|
||||
err_set(errset, (HRESULT)VSS_E_BAD_STATE,
|
||||
"CreateVssBackupComponents is missing. Did you freeze the volumes?");
|
||||
return;
|
||||
}
|
||||
if (!vss_ctx.pAsyncSnapshot) {
|
||||
err_set(errset, (HRESULT)VSS_E_BAD_STATE,
|
||||
"AsyncSnapshot set is missing. Did you freeze the volumes?");
|
||||
return;
|
||||
}
|
||||
|
||||
HRESULT hr = WaitForAsync(vss_ctx.pAsyncSnapshot);
|
||||
switch (hr) {
|
||||
|
||||
Reference in New Issue
Block a user