[fedora-virt-maint] rpms/libvirt/F-12 libvirt-fix-qemu-restore-from-raw1.patch, NONE, 1.1 libvirt-fix-qemu-restore-from-raw2.patch, NONE, 1.1 libvirt.spec, 1.190, 1.191 libvirt-fix-qemu-restore-from-raw.patch, 1.1, NONE
Mark McLoughlin
markmc at fedoraproject.org
Tue Oct 13 15:43:51 UTC 2009
- Previous message (by thread): [fedora-virt-maint] rpms/libvirt/devel libvirt-fix-qemu-restore-from-raw1.patch, NONE, 1.1 libvirt-fix-qemu-restore-from-raw2.patch, NONE, 1.1 libvirt.spec, 1.190, 1.191 libvirt-fix-qemu-restore-from-raw.patch, 1.1, NONE
- Next message (by thread): [fedora-virt-maint] rpms/libvirt/devel .cvsignore, 1.47, 1.48 libvirt.spec, 1.191, 1.192 sources, 1.49, 1.50 libvirt-change-logrotate-config-to-weekly.patch, 1.1, NONE libvirt-disable-audio-backend.patch, 1.1, NONE libvirt-fix-device-detach-typo1.patch, 1.1, NONE libvirt-fix-device-detach-typo2.patch, 1.1, NONE libvirt-fix-device-detach-typo3.patch, 1.1, NONE libvirt-fix-drv-supports-feature-bogus-error.patch, 1.2, NONE libvirt-fix-libvirtd-leak-in-error-reply.patch, 1.1, NONE libvirt-fix-net-hotunplug-double-free.patch, 1.4, NONE libvirt-fix-pci-hostdev-hotunplug-leak.patch, 1.4, NONE libvirt-fix-qemu-raw-format-save.patch, 1.2, NONE libvirt-fix-qemu-restore-from-raw1.patch, 1.1, NONE libvirt-fix-qemu-restore-from-raw2.patch, 1.1, NONE libvirt-fix-usb-device-passthrough.patch, 1.2, NONE libvirt-logrotate-create-lxc-uml-dirs.patch, 1.1, NONE libvirt-svirt-relabel-qcow2-backing-files.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: markmc
Update of /cvs/pkgs/rpms/libvirt/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv7604
Modified Files:
libvirt.spec
Added Files:
libvirt-fix-qemu-restore-from-raw1.patch
libvirt-fix-qemu-restore-from-raw2.patch
Removed Files:
libvirt-fix-qemu-restore-from-raw.patch
Log Message:
Add the second patch for #523158
libvirt-fix-qemu-restore-from-raw1.patch:
qemu_driver.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- NEW FILE libvirt-fix-qemu-restore-from-raw1.patch ---
>From 0b846a30468a6b4586407f020ccde7bb51afaf98 Mon Sep 17 00:00:00 2001
From: Daniel P. Berrange <berrange at redhat.com>
Date: Mon, 12 Oct 2009 20:03:50 +0100
Subject: [PATCH] Fix QEMU restore from file in raw format
The logic for running the decompression programs was broken in
commit f238709304f9f6c57204cdd943e542cbae38fa5f, so that for
non-raw formats the decompression program was never run, and
for raw formats, it tried to exec an argv[] with initial NULL
in the program name.
* src/qemu/qemu_driver.c: Fix logic in runing decompression program
(cherry picked from commit 74b379cbd5ba9f472a3a2d5710e497966b1a3a37)
Fedora-patch: libvirt-fix-qemu-restore-from-raw1.patch
---
src/qemu_driver.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 550a59c..0ce403c 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -4541,9 +4541,8 @@ static int qemudDomainRestore(virConnectPtr conn,
goto cleanup;
}
- if (header.compressed != QEMUD_SAVE_FORMAT_RAW)
+ if (header.compressed != QEMUD_SAVE_FORMAT_RAW) {
intermediate_argv[0] = prog;
- else {
intermediatefd = fd;
fd = -1;
if (virExec(conn, intermediate_argv, NULL, NULL,
--
1.6.2.5
libvirt-fix-qemu-restore-from-raw2.patch:
util.c | 46 ++++++++++++----------------------------------
1 file changed, 12 insertions(+), 34 deletions(-)
--- NEW FILE libvirt-fix-qemu-restore-from-raw2.patch ---
>From 57d7cc602d14c6b50e2826e427a5de124e479f95 Mon Sep 17 00:00:00 2001
From: Daniel P. Berrange <berrange at redhat.com>
Date: Mon, 12 Oct 2009 20:32:33 +0100
Subject: [PATCH] Fix virFileReadLimFD/virFileReadAll to handle EINTR
The fread_file_lim() function uses fread() but never handles
EINTR results, causing unexpected failures when reading QEMU
help arg info. It was unneccessarily using FILE * instead
of plain UNIX file handles, which prevented use of saferead()
* src/util/util.c: Switch fread_file_lim over to use saferead
instead of fread, remove FILE * use, and rename
(cherry picked from commit 11a36d956cb8a5e439e535bff3e0cfce50a64bca)
Fedora-patch: libvirt-fix-qemu-restore-from-raw2.patch
---
src/util.c | 45 ++++++++++++---------------------------------
1 files changed, 12 insertions(+), 33 deletions(-)
diff --git a/src/util.c b/src/util.c
index 1878e33..7bc3a66 100644
--- a/src/util.c
+++ b/src/util.c
@@ -887,7 +887,7 @@ virExec(virConnectPtr conn,
number of bytes. If the length of the input is <= max_len, and
upon error while reading that data, it works just like fread_file. */
static char *
-fread_file_lim (FILE *stream, size_t max_len, size_t *length)
+saferead_lim (int fd, size_t max_len, size_t *length)
{
char *buf = NULL;
size_t alloc = 0;
@@ -895,8 +895,8 @@ fread_file_lim (FILE *stream, size_t max_len, size_t *length)
int save_errno;
for (;;) {
- size_t count;
- size_t requested;
+ int count;
+ int requested;
if (size + BUFSIZ + 1 > alloc) {
alloc += alloc / 2;
@@ -912,12 +912,12 @@ fread_file_lim (FILE *stream, size_t max_len, size_t *length)
/* Ensure that (size + requested <= max_len); */
requested = MIN (size < max_len ? max_len - size : 0,
alloc - size - 1);
- count = fread (buf + size, 1, requested, stream);
+ count = saferead (fd, buf + size, requested);
size += count;
if (count != requested || requested == 0) {
save_errno = errno;
- if (ferror (stream))
+ if (count < 0)
break;
buf[size] = '\0';
*length = size;
@@ -930,12 +930,12 @@ fread_file_lim (FILE *stream, size_t max_len, size_t *length)
return NULL;
}
-/* A wrapper around fread_file_lim that maps a failure due to
+/* A wrapper around saferead_lim that maps a failure due to
exceeding the maximum size limitation to EOVERFLOW. */
-static int virFileReadLimFP(FILE *fp, int maxlen, char **buf)
+int virFileReadLimFD(int fd, int maxlen, char **buf)
{
size_t len;
- char *s = fread_file_lim (fp, maxlen+1, &len);
+ char *s = saferead_lim (fd, maxlen+1, &len);
if (s == NULL)
return -1;
if (len > maxlen || (int)len != len) {
@@ -949,37 +949,16 @@ static int virFileReadLimFP(FILE *fp, int maxlen, char **buf)
return len;
}
-/* Like virFileReadLimFP, but use a file descriptor rather than a FILE*. */
-int virFileReadLimFD(int fd_arg, int maxlen, char **buf)
-{
- int fd = dup (fd_arg);
- if (fd >= 0) {
- FILE *fp = fdopen (fd, "r");
- if (fp) {
- int len = virFileReadLimFP (fp, maxlen, buf);
- int saved_errno = errno;
- fclose (fp);
- errno = saved_errno;
- return len;
- } else {
- int saved_errno = errno;
- close (fd);
- errno = saved_errno;
- }
- }
- return -1;
-}
-
int virFileReadAll(const char *path, int maxlen, char **buf)
{
- FILE *fh = fopen(path, "r");
- if (fh == NULL) {
+ int fd = open(path, O_RDONLY);
+ if (fd < 0) {
virReportSystemError(NULL, errno, _("Failed to open file '%s'"), path);
return -1;
}
- int len = virFileReadLimFP (fh, maxlen, buf);
- fclose(fh);
+ int len = virFileReadLimFD(fd, maxlen, buf);
+ close(fd);
if (len < 0) {
virReportSystemError(NULL, errno, _("Failed to read file '%s'"), path);
return -1;
--
1.6.2.5
Index: libvirt.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libvirt/F-12/libvirt.spec,v
retrieving revision 1.190
retrieving revision 1.191
diff -u -p -r1.190 -r1.191
--- libvirt.spec 13 Oct 2009 15:34:19 -0000 1.190
+++ libvirt.spec 13 Oct 2009 15:43:51 -0000 1.191
@@ -188,7 +188,8 @@ Patch12: libvirt-fix-device-detach-typo3
Patch13: libvirt-fix-libvirtd-leak-in-error-reply.patch
# Fix restore of qemu guest using raw save format (#523158)
-Patch14: libvirt-fix-qemu-restore-from-raw.patch
+Patch14: libvirt-fix-qemu-restore-from-raw1.patch
+Patch15: libvirt-fix-qemu-restore-from-raw2.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://libvirt.org/
@@ -419,6 +420,7 @@ of recent versions of Linux (and other O
%patch12 -p1
%patch13 -p1
%patch14 -p1
+%patch15 -p1
%build
# Needed for libvirt-logrotate-create-lxc-uml-dirs.patch
--- libvirt-fix-qemu-restore-from-raw.patch DELETED ---
- Previous message (by thread): [fedora-virt-maint] rpms/libvirt/devel libvirt-fix-qemu-restore-from-raw1.patch, NONE, 1.1 libvirt-fix-qemu-restore-from-raw2.patch, NONE, 1.1 libvirt.spec, 1.190, 1.191 libvirt-fix-qemu-restore-from-raw.patch, 1.1, NONE
- Next message (by thread): [fedora-virt-maint] rpms/libvirt/devel .cvsignore, 1.47, 1.48 libvirt.spec, 1.191, 1.192 sources, 1.49, 1.50 libvirt-change-logrotate-config-to-weekly.patch, 1.1, NONE libvirt-disable-audio-backend.patch, 1.1, NONE libvirt-fix-device-detach-typo1.patch, 1.1, NONE libvirt-fix-device-detach-typo2.patch, 1.1, NONE libvirt-fix-device-detach-typo3.patch, 1.1, NONE libvirt-fix-drv-supports-feature-bogus-error.patch, 1.2, NONE libvirt-fix-libvirtd-leak-in-error-reply.patch, 1.1, NONE libvirt-fix-net-hotunplug-double-free.patch, 1.4, NONE libvirt-fix-pci-hostdev-hotunplug-leak.patch, 1.4, NONE libvirt-fix-qemu-raw-format-save.patch, 1.2, NONE libvirt-fix-qemu-restore-from-raw1.patch, 1.1, NONE libvirt-fix-qemu-restore-from-raw2.patch, 1.1, NONE libvirt-fix-usb-device-passthrough.patch, 1.2, NONE libvirt-logrotate-create-lxc-uml-dirs.patch, 1.1, NONE libvirt-svirt-relabel-qcow2-backing-files.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Fedora-virt-maint
mailing list