From b625a652b7992ee3dc2a55a4a322fc489d4af313 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: <707b9b97153063374d2530e72c49b1499fc21af9.1367947969.git.minovotn@redhat.com> References: <707b9b97153063374d2530e72c49b1499fc21af9.1367947969.git.minovotn@redhat.com> From: Michal Novotny Date: Tue, 7 May 2013 18:37:52 +0200 Subject: [PATCH 040/114] Revert "qemu-ga: qmp_guest_fsfreeze_*(): get rid of sprintf() + error_set()" This reverts commit ecc3a6b2b6c927dad5bc67e8e38827c6428ff990. Reverting as asked by Laszlo in message <51892739.2030807@redhat.com> because of the ordering issue (most likely) related to supersed testing. Signed-off-by: Michal Novotny --- qga/commands-posix.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 8994e96..b03d596 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -430,6 +430,7 @@ int64_t qmp_guest_fsfreeze_freeze(Error **err) struct FsMount *mount; Error *local_err = NULL; int fd; + char err_msg[512]; slog("guest-fsfreeze called"); @@ -446,7 +447,9 @@ int64_t qmp_guest_fsfreeze_freeze(Error **err) QTAILQ_FOREACH(mount, &mounts, next) { fd = qemu_open(mount->dirname, O_RDONLY); if (fd == -1) { - error_setg_errno(err, errno, "failed to open %s", mount->dirname); + sprintf(err_msg, "failed to open %s, %s", mount->dirname, + strerror(errno)); + error_set(err, QERR_QGA_COMMAND_FAILED, err_msg); goto error; } @@ -462,8 +465,9 @@ int64_t qmp_guest_fsfreeze_freeze(Error **err) ret = ioctl(fd, FIFREEZE); if (ret == -1) { if (errno != EOPNOTSUPP) { - error_setg_errno(err, errno, "failed to freeze %s", - mount->dirname); + sprintf(err_msg, "failed to freeze %s, %s", + mount->dirname, strerror(errno)); + error_set(err, QERR_QGA_COMMAND_FAILED, err_msg); close(fd); goto error; } -- 1.7.11.7