mirror of https://github.com/xemu-project/xemu.git
Error reporting patches for 2024-05-27
-----BEGIN PGP SIGNATURE----- iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmZUaB8SHGFybWJydUBy ZWRoYXQuY29tAAoJEDhwtADrkYZTnY0P/jr94u+NI8+Jykh8d/i5gz70dLS6F3oM PstnO9HXByCKeRRmTWesPnzd1idq9ZNnXTmZbriAv6sGduEBfOLyXmMLHj0L10EA tDrmFHQOS+9NcCeJ08SFRIgcxt6X9lUjGsoGXLxAfBZiWMsK18lXl5tTNGCtLQU5 D1lc7byRHdVg+EzfhFqF6nU7UW63vNqtcwBElk1xc2zsU2yqX4pIvImTyRzUGC7h 8au68s3agFP/c98jgpljdI/V5TkgxAPa3OqkFXAjM9SLGi8szRxgLuMaufcOn5XQ F4/89GdhdvLGNFvpeBJyTud3NC0V2vDf7F4HABayHE8azYAu8/7H22SI+lvhnZi4 m6yb2vP/x9+EVZxPoeT1TIY3N7W5wDJg8aIHCrLPtJXgnsBGTzEK6VydCeIjEl8Z Ai6WioKSFP6JhMT2a/6hAtceS2AWRnHhGx+BpaWYsr1FBWqJa4hgC+1IJWX3NI4G urmELw1B2RCOKB7jFusYNnKu67sVkT/eaxj+LcBwEi4XEddpCurqhi32SlpEJzcK JxQ/swGDD9hdx8Y5WPuRnUkPsvJO2uOJc50VSlDkdHg3ZCEgEhHuENOOvXjxtT5I nsgZEDRiUgn42AhhiFwulYUWt2dT/K974ZebEer305ajYaseilUQclATNlRNNVlV t16ViC6cIdCN =tAQ+ -----END PGP SIGNATURE----- Merge tag 'pull-error-2024-05-27' of https://repo.or.cz/qemu/armbru into staging Error reporting patches for 2024-05-27 # -----BEGIN PGP SIGNATURE----- # # iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmZUaB8SHGFybWJydUBy # ZWRoYXQuY29tAAoJEDhwtADrkYZTnY0P/jr94u+NI8+Jykh8d/i5gz70dLS6F3oM # PstnO9HXByCKeRRmTWesPnzd1idq9ZNnXTmZbriAv6sGduEBfOLyXmMLHj0L10EA # tDrmFHQOS+9NcCeJ08SFRIgcxt6X9lUjGsoGXLxAfBZiWMsK18lXl5tTNGCtLQU5 # D1lc7byRHdVg+EzfhFqF6nU7UW63vNqtcwBElk1xc2zsU2yqX4pIvImTyRzUGC7h # 8au68s3agFP/c98jgpljdI/V5TkgxAPa3OqkFXAjM9SLGi8szRxgLuMaufcOn5XQ # F4/89GdhdvLGNFvpeBJyTud3NC0V2vDf7F4HABayHE8azYAu8/7H22SI+lvhnZi4 # m6yb2vP/x9+EVZxPoeT1TIY3N7W5wDJg8aIHCrLPtJXgnsBGTzEK6VydCeIjEl8Z # Ai6WioKSFP6JhMT2a/6hAtceS2AWRnHhGx+BpaWYsr1FBWqJa4hgC+1IJWX3NI4G # urmELw1B2RCOKB7jFusYNnKu67sVkT/eaxj+LcBwEi4XEddpCurqhi32SlpEJzcK # JxQ/swGDD9hdx8Y5WPuRnUkPsvJO2uOJc50VSlDkdHg3ZCEgEhHuENOOvXjxtT5I # nsgZEDRiUgn42AhhiFwulYUWt2dT/K974ZebEer305ajYaseilUQclATNlRNNVlV # t16ViC6cIdCN # =tAQ+ # -----END PGP SIGNATURE----- # gpg: Signature made Mon 27 May 2024 04:01:51 AM PDT # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] * tag 'pull-error-2024-05-27' of https://repo.or.cz/qemu/armbru: qerror: QERR_QGA_COMMAND_FAILED is no longer used, drop qga: Shorten several error messages qga-win32: Improve guest-set-user-password, guest-file-open errors qerror: QERR_IO_ERROR is no longer used, drop migration: Rephrase message on failure to save / load Xen device state cpus: Improve error messages on memsave, pmemsave write error block/vmdk: Improve error messages on extent write error dump/win_dump: Improve error messages on write error block: Improve error message when external snapshot can't flush Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
commit
ad10b4badc
10
block/vmdk.c
10
block/vmdk.c
|
@ -28,7 +28,6 @@
|
||||||
#include "block/block_int.h"
|
#include "block/block_int.h"
|
||||||
#include "sysemu/block-backend.h"
|
#include "sysemu/block-backend.h"
|
||||||
#include "qapi/qmp/qdict.h"
|
#include "qapi/qmp/qdict.h"
|
||||||
#include "qapi/qmp/qerror.h"
|
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
#include "qemu/module.h"
|
#include "qemu/module.h"
|
||||||
#include "qemu/option.h"
|
#include "qemu/option.h"
|
||||||
|
@ -2278,12 +2277,12 @@ vmdk_init_extent(BlockBackend *blk, int64_t filesize, bool flat, bool compress,
|
||||||
/* write all the data */
|
/* write all the data */
|
||||||
ret = blk_co_pwrite(blk, 0, sizeof(magic), &magic, 0);
|
ret = blk_co_pwrite(blk, 0, sizeof(magic), &magic, 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
error_setg(errp, QERR_IO_ERROR);
|
error_setg_errno(errp, -ret, "failed to write VMDK magic");
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
ret = blk_co_pwrite(blk, sizeof(magic), sizeof(header), &header, 0);
|
ret = blk_co_pwrite(blk, sizeof(magic), sizeof(header), &header, 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
error_setg(errp, QERR_IO_ERROR);
|
error_setg_errno(errp, -ret, "failed to write VMDK header");
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2303,7 +2302,7 @@ vmdk_init_extent(BlockBackend *blk, int64_t filesize, bool flat, bool compress,
|
||||||
ret = blk_co_pwrite(blk, le64_to_cpu(header.rgd_offset) * BDRV_SECTOR_SIZE,
|
ret = blk_co_pwrite(blk, le64_to_cpu(header.rgd_offset) * BDRV_SECTOR_SIZE,
|
||||||
gd_buf_size, gd_buf, 0);
|
gd_buf_size, gd_buf, 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
error_setg(errp, QERR_IO_ERROR);
|
error_setg_errno(errp, -ret, "failed to write VMDK grain directory");
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2315,7 +2314,8 @@ vmdk_init_extent(BlockBackend *blk, int64_t filesize, bool flat, bool compress,
|
||||||
ret = blk_co_pwrite(blk, le64_to_cpu(header.gd_offset) * BDRV_SECTOR_SIZE,
|
ret = blk_co_pwrite(blk, le64_to_cpu(header.gd_offset) * BDRV_SECTOR_SIZE,
|
||||||
gd_buf_size, gd_buf, 0);
|
gd_buf_size, gd_buf, 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
error_setg(errp, QERR_IO_ERROR);
|
error_setg_errno(errp, -ret,
|
||||||
|
"failed to write VMDK backup grain directory");
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
|
@ -1406,8 +1406,10 @@ static void external_snapshot_action(TransactionAction *action,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bdrv_is_read_only(state->old_bs)) {
|
if (!bdrv_is_read_only(state->old_bs)) {
|
||||||
if (bdrv_flush(state->old_bs)) {
|
ret = bdrv_flush(state->old_bs);
|
||||||
error_setg(errp, QERR_IO_ERROR);
|
if (ret < 0) {
|
||||||
|
error_setg_errno(errp, -ret, "Write to node '%s' failed",
|
||||||
|
bdrv_get_device_or_node_name(state->old_bs));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#include "sysemu/dump.h"
|
#include "sysemu/dump.h"
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
#include "qapi/qmp/qerror.h"
|
|
||||||
#include "exec/cpu-defs.h"
|
#include "exec/cpu-defs.h"
|
||||||
#include "hw/core/cpu.h"
|
#include "hw/core/cpu.h"
|
||||||
#include "qemu/win_dump_defs.h"
|
#include "qemu/win_dump_defs.h"
|
||||||
|
@ -52,6 +51,7 @@ static size_t write_run(uint64_t base_page, uint64_t page_count,
|
||||||
uint64_t addr = base_page << TARGET_PAGE_BITS;
|
uint64_t addr = base_page << TARGET_PAGE_BITS;
|
||||||
uint64_t size = page_count << TARGET_PAGE_BITS;
|
uint64_t size = page_count << TARGET_PAGE_BITS;
|
||||||
uint64_t len, l;
|
uint64_t len, l;
|
||||||
|
int eno;
|
||||||
size_t total = 0;
|
size_t total = 0;
|
||||||
|
|
||||||
while (size) {
|
while (size) {
|
||||||
|
@ -65,9 +65,10 @@ static size_t write_run(uint64_t base_page, uint64_t page_count,
|
||||||
}
|
}
|
||||||
|
|
||||||
l = qemu_write_full(fd, buf, len);
|
l = qemu_write_full(fd, buf, len);
|
||||||
|
eno = errno;
|
||||||
cpu_physical_memory_unmap(buf, addr, false, len);
|
cpu_physical_memory_unmap(buf, addr, false, len);
|
||||||
if (l != len) {
|
if (l != len) {
|
||||||
error_setg(errp, QERR_IO_ERROR);
|
error_setg_errno(errp, eno, "win-dump: failed to save memory");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -459,7 +460,7 @@ void create_win_dump(DumpState *s, Error **errp)
|
||||||
|
|
||||||
s->written_size = qemu_write_full(s->fd, h, hdr_size);
|
s->written_size = qemu_write_full(s->fd, h, hdr_size);
|
||||||
if (s->written_size != hdr_size) {
|
if (s->written_size != hdr_size) {
|
||||||
error_setg(errp, QERR_IO_ERROR);
|
error_setg_errno(errp, errno, "win-dump: failed to write header");
|
||||||
goto out_restore;
|
goto out_restore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,18 +20,12 @@
|
||||||
#define QERR_INVALID_PARAMETER_VALUE \
|
#define QERR_INVALID_PARAMETER_VALUE \
|
||||||
"Parameter '%s' expects %s"
|
"Parameter '%s' expects %s"
|
||||||
|
|
||||||
#define QERR_IO_ERROR \
|
|
||||||
"An IO error has occurred"
|
|
||||||
|
|
||||||
#define QERR_MISSING_PARAMETER \
|
#define QERR_MISSING_PARAMETER \
|
||||||
"Parameter '%s' is missing"
|
"Parameter '%s' is missing"
|
||||||
|
|
||||||
#define QERR_PROPERTY_VALUE_OUT_OF_RANGE \
|
#define QERR_PROPERTY_VALUE_OUT_OF_RANGE \
|
||||||
"Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ", maximum: %" PRId64 ")"
|
"Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ", maximum: %" PRId64 ")"
|
||||||
|
|
||||||
#define QERR_QGA_COMMAND_FAILED \
|
|
||||||
"Guest agent command failed, error was '%s'"
|
|
||||||
|
|
||||||
#define QERR_UNSUPPORTED \
|
#define QERR_UNSUPPORTED \
|
||||||
"this feature or command is not currently supported"
|
"this feature or command is not currently supported"
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,6 @@
|
||||||
#include "qapi/qapi-commands-migration.h"
|
#include "qapi/qapi-commands-migration.h"
|
||||||
#include "qapi/clone-visitor.h"
|
#include "qapi/clone-visitor.h"
|
||||||
#include "qapi/qapi-builtin-visit.h"
|
#include "qapi/qapi-builtin-visit.h"
|
||||||
#include "qapi/qmp/qerror.h"
|
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
#include "sysemu/cpus.h"
|
#include "sysemu/cpus.h"
|
||||||
#include "exec/memory.h"
|
#include "exec/memory.h"
|
||||||
|
@ -3203,7 +3202,7 @@ void qmp_xen_save_devices_state(const char *filename, bool has_live, bool live,
|
||||||
object_unref(OBJECT(ioc));
|
object_unref(OBJECT(ioc));
|
||||||
ret = qemu_save_device_state(f);
|
ret = qemu_save_device_state(f);
|
||||||
if (ret < 0 || qemu_fclose(f) < 0) {
|
if (ret < 0 || qemu_fclose(f) < 0) {
|
||||||
error_setg(errp, QERR_IO_ERROR);
|
error_setg(errp, "saving Xen device state failed");
|
||||||
} else {
|
} else {
|
||||||
/* libxl calls the QMP command "stop" before calling
|
/* libxl calls the QMP command "stop" before calling
|
||||||
* "xen-save-devices-state" and in case of migration failure, libxl
|
* "xen-save-devices-state" and in case of migration failure, libxl
|
||||||
|
@ -3252,7 +3251,7 @@ void qmp_xen_load_devices_state(const char *filename, Error **errp)
|
||||||
ret = qemu_loadvm_state(f);
|
ret = qemu_loadvm_state(f);
|
||||||
qemu_fclose(f);
|
qemu_fclose(f);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
error_setg(errp, QERR_IO_ERROR);
|
error_setg(errp, "loading Xen device state failed");
|
||||||
}
|
}
|
||||||
migration_incoming_state_destroy();
|
migration_incoming_state_destroy();
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,6 +217,9 @@ int64_t qmp_guest_file_open(const char *path, const char *mode, Error **errp)
|
||||||
|
|
||||||
w_path = g_utf8_to_utf16(path, -1, NULL, NULL, &gerr);
|
w_path = g_utf8_to_utf16(path, -1, NULL, NULL, &gerr);
|
||||||
if (!w_path) {
|
if (!w_path) {
|
||||||
|
error_setg(errp, "can't convert 'path' to UTF-16: %s",
|
||||||
|
gerr->message);
|
||||||
|
g_error_free(gerr);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,10 +247,6 @@ int64_t qmp_guest_file_open(const char *path, const char *mode, Error **errp)
|
||||||
slog("guest-file-open, handle: % " PRId64, fd);
|
slog("guest-file-open, handle: % " PRId64, fd);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (gerr) {
|
|
||||||
error_setg(errp, QERR_QGA_COMMAND_FAILED, gerr->message);
|
|
||||||
g_error_free(gerr);
|
|
||||||
}
|
|
||||||
g_free(w_path);
|
g_free(w_path);
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
@ -279,8 +278,7 @@ static void acquire_privilege(const char *name, Error **errp)
|
||||||
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token))
|
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token))
|
||||||
{
|
{
|
||||||
if (!LookupPrivilegeValue(NULL, name, &priv.Privileges[0].Luid)) {
|
if (!LookupPrivilegeValue(NULL, name, &priv.Privileges[0].Luid)) {
|
||||||
error_setg(errp, QERR_QGA_COMMAND_FAILED,
|
error_setg(errp, "no luid for requested privilege");
|
||||||
"no luid for requested privilege");
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,14 +286,12 @@ static void acquire_privilege(const char *name, Error **errp)
|
||||||
priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
|
priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
|
||||||
|
|
||||||
if (!AdjustTokenPrivileges(token, FALSE, &priv, 0, NULL, 0)) {
|
if (!AdjustTokenPrivileges(token, FALSE, &priv, 0, NULL, 0)) {
|
||||||
error_setg(errp, QERR_QGA_COMMAND_FAILED,
|
error_setg(errp, "unable to acquire requested privilege");
|
||||||
"unable to acquire requested privilege");
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
error_setg(errp, QERR_QGA_COMMAND_FAILED,
|
error_setg(errp, "failed to open privilege token");
|
||||||
"failed to open privilege token");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
@ -309,8 +305,7 @@ static void execute_async(DWORD WINAPI (*func)(LPVOID), LPVOID opaque,
|
||||||
{
|
{
|
||||||
HANDLE thread = CreateThread(NULL, 0, func, opaque, 0, NULL);
|
HANDLE thread = CreateThread(NULL, 0, func, opaque, 0, NULL);
|
||||||
if (!thread) {
|
if (!thread) {
|
||||||
error_setg(errp, QERR_QGA_COMMAND_FAILED,
|
error_setg(errp, "failed to dispatch asynchronous command");
|
||||||
"failed to dispatch asynchronous command");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1419,22 +1414,19 @@ static void check_suspend_mode(GuestSuspendMode mode, Error **errp)
|
||||||
|
|
||||||
ZeroMemory(&sys_pwr_caps, sizeof(sys_pwr_caps));
|
ZeroMemory(&sys_pwr_caps, sizeof(sys_pwr_caps));
|
||||||
if (!GetPwrCapabilities(&sys_pwr_caps)) {
|
if (!GetPwrCapabilities(&sys_pwr_caps)) {
|
||||||
error_setg(errp, QERR_QGA_COMMAND_FAILED,
|
error_setg(errp, "failed to determine guest suspend capabilities");
|
||||||
"failed to determine guest suspend capabilities");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case GUEST_SUSPEND_MODE_DISK:
|
case GUEST_SUSPEND_MODE_DISK:
|
||||||
if (!sys_pwr_caps.SystemS4) {
|
if (!sys_pwr_caps.SystemS4) {
|
||||||
error_setg(errp, QERR_QGA_COMMAND_FAILED,
|
error_setg(errp, "suspend-to-disk not supported by OS");
|
||||||
"suspend-to-disk not supported by OS");
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GUEST_SUSPEND_MODE_RAM:
|
case GUEST_SUSPEND_MODE_RAM:
|
||||||
if (!sys_pwr_caps.SystemS3) {
|
if (!sys_pwr_caps.SystemS3) {
|
||||||
error_setg(errp, QERR_QGA_COMMAND_FAILED,
|
error_setg(errp, "suspend-to-ram not supported by OS");
|
||||||
"suspend-to-ram not supported by OS");
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1946,11 +1938,17 @@ void qmp_guest_set_user_password(const char *username,
|
||||||
|
|
||||||
user = g_utf8_to_utf16(username, -1, NULL, NULL, &gerr);
|
user = g_utf8_to_utf16(username, -1, NULL, NULL, &gerr);
|
||||||
if (!user) {
|
if (!user) {
|
||||||
|
error_setg(errp, "can't convert 'username' to UTF-16: %s",
|
||||||
|
gerr->message);
|
||||||
|
g_error_free(gerr);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
wpass = g_utf8_to_utf16(rawpasswddata, -1, NULL, NULL, &gerr);
|
wpass = g_utf8_to_utf16(rawpasswddata, -1, NULL, NULL, &gerr);
|
||||||
if (!wpass) {
|
if (!wpass) {
|
||||||
|
error_setg(errp, "can't convert 'password' to UTF-16: %s",
|
||||||
|
gerr->message);
|
||||||
|
g_error_free(gerr);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1966,10 +1964,6 @@ void qmp_guest_set_user_password(const char *username,
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (gerr) {
|
|
||||||
error_setg(errp, QERR_QGA_COMMAND_FAILED, gerr->message);
|
|
||||||
g_error_free(gerr);
|
|
||||||
}
|
|
||||||
g_free(user);
|
g_free(user);
|
||||||
g_free(wpass);
|
g_free(wpass);
|
||||||
g_free(rawpasswddata);
|
g_free(rawpasswddata);
|
||||||
|
@ -2174,8 +2168,7 @@ static void ga_get_win_version(RTL_OSVERSIONINFOEXW *info, Error **errp)
|
||||||
HMODULE module = GetModuleHandle("ntdll");
|
HMODULE module = GetModuleHandle("ntdll");
|
||||||
PVOID fun = GetProcAddress(module, "RtlGetVersion");
|
PVOID fun = GetProcAddress(module, "RtlGetVersion");
|
||||||
if (fun == NULL) {
|
if (fun == NULL) {
|
||||||
error_setg(errp, QERR_QGA_COMMAND_FAILED,
|
error_setg(errp, "Failed to get address of RtlGetVersion");
|
||||||
"Failed to get address of RtlGetVersion");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#include "guest-agent-core.h"
|
#include "guest-agent-core.h"
|
||||||
#include "qga-qapi-commands.h"
|
#include "qga-qapi-commands.h"
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "qapi/qmp/qerror.h"
|
|
||||||
#include "qemu/base64.h"
|
#include "qemu/base64.h"
|
||||||
#include "qemu/cutils.h"
|
#include "qemu/cutils.h"
|
||||||
#include "commands-common.h"
|
#include "commands-common.h"
|
||||||
|
@ -475,7 +474,7 @@ GuestExec *qmp_guest_exec(const char *path,
|
||||||
guest_exec_task_setup, &has_merge, &pid, input_data ? &in_fd : NULL,
|
guest_exec_task_setup, &has_merge, &pid, input_data ? &in_fd : NULL,
|
||||||
has_output ? &out_fd : NULL, has_output ? &err_fd : NULL, &gerr);
|
has_output ? &out_fd : NULL, has_output ? &err_fd : NULL, &gerr);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
error_setg(errp, QERR_QGA_COMMAND_FAILED, gerr->message);
|
error_setg(errp, "%s", gerr->message);
|
||||||
g_error_free(gerr);
|
g_error_free(gerr);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -586,8 +585,7 @@ GuestTimezone *qmp_guest_get_timezone(Error **errp)
|
||||||
info = g_new0(GuestTimezone, 1);
|
info = g_new0(GuestTimezone, 1);
|
||||||
tz = g_time_zone_new_local();
|
tz = g_time_zone_new_local();
|
||||||
if (tz == NULL) {
|
if (tz == NULL) {
|
||||||
error_setg(errp, QERR_QGA_COMMAND_FAILED,
|
error_setg(errp, "Couldn't retrieve local timezone");
|
||||||
"Couldn't retrieve local timezone");
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -813,7 +813,8 @@ void qmp_memsave(int64_t addr, int64_t size, const char *filename,
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
if (fwrite(buf, 1, l, f) != l) {
|
if (fwrite(buf, 1, l, f) != l) {
|
||||||
error_setg(errp, QERR_IO_ERROR);
|
error_setg(errp, "writing memory to '%s' failed",
|
||||||
|
filename);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
addr += l;
|
addr += l;
|
||||||
|
@ -843,7 +844,8 @@ void qmp_pmemsave(int64_t addr, int64_t size, const char *filename,
|
||||||
l = size;
|
l = size;
|
||||||
cpu_physical_memory_read(addr, buf, l);
|
cpu_physical_memory_read(addr, buf, l);
|
||||||
if (fwrite(buf, 1, l, f) != l) {
|
if (fwrite(buf, 1, l, f) != l) {
|
||||||
error_setg(errp, QERR_IO_ERROR);
|
error_setg(errp, "writing memory to '%s' failed",
|
||||||
|
filename);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
addr += l;
|
addr += l;
|
||||||
|
|
Loading…
Reference in New Issue