* [PATCH 0/3] kvm-userspace build and compat fixes
@ 2009-01-23 18:41 Eduardo Habkost
2009-01-23 18:41 ` [PATCH 1/3] kvm: qemu: don't fail building when pc-bios dir is empty Eduardo Habkost
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Eduardo Habkost @ 2009-01-23 18:41 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm, Eduardo Habkost
Hi, Avi,
These are some build and compat fixes for kvm-userspace. They also apply
to the maint/2.6.29 branch.
--
Eduardo
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] kvm: qemu: don't fail building when pc-bios dir is empty
2009-01-23 18:41 [PATCH 0/3] kvm-userspace build and compat fixes Eduardo Habkost
@ 2009-01-23 18:41 ` Eduardo Habkost
2009-01-26 14:46 ` Marcelo Tosatti
2009-01-23 18:41 ` [PATCH 2/3] Use native anon_inodes on RHEL5 if available Eduardo Habkost
2009-01-23 18:41 ` [PATCH 3/3] compat code fixes for RHEL5 kernels Eduardo Habkost
2 siblings, 1 reply; 7+ messages in thread
From: Eduardo Habkost @ 2009-01-23 18:41 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm, Eduardo Habkost
The '[ -f "$file" ] && install' command will make the return code
of the command to be non-zero, making 'make' abort. Use shell 'if'
construct instead.
This patch also applies to the maint/2.6.29 branch.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
qemu/Makefile | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/qemu/Makefile b/qemu/Makefile
index 648b849..fe675a9 100644
--- a/qemu/Makefile
+++ b/qemu/Makefile
@@ -242,8 +242,9 @@ endif
ifneq ($(BLOBS),)
mkdir -p "$(DESTDIR)$(datadir)"
set -e; for x in $(BLOBS); do \
- [ -f $(SRC_PATH)/pc-bios/$$x ] && \
- $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
+ if [ -f $(SRC_PATH)/pc-bios/$$x ];then \
+ $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
+ fi \
done
endif
ifndef CONFIG_WIN32
--
1.6.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] Use native anon_inodes on RHEL5 if available
2009-01-23 18:41 [PATCH 0/3] kvm-userspace build and compat fixes Eduardo Habkost
2009-01-23 18:41 ` [PATCH 1/3] kvm: qemu: don't fail building when pc-bios dir is empty Eduardo Habkost
@ 2009-01-23 18:41 ` Eduardo Habkost
2009-01-23 18:41 ` [PATCH 3/3] compat code fixes for RHEL5 kernels Eduardo Habkost
2 siblings, 0 replies; 7+ messages in thread
From: Eduardo Habkost @ 2009-01-23 18:41 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm, Eduardo Habkost
Seom RHEL5 kernel versions include anon_inodes. Detect this case and
use the native anon_inodes implementation when available.
This patch also applies to the maint/2.6.29 branch.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
kernel/anon_inodes.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/kernel/anon_inodes.c b/kernel/anon_inodes.c
index 510303f..135adae 100644
--- a/kernel/anon_inodes.c
+++ b/kernel/anon_inodes.c
@@ -21,7 +21,14 @@
#include <asm/uaccess.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+/* anon_inodes on RHEL >= 5.2 is equivalent to 2.6.27 version */
+#ifdef RHEL_RELEASE_CODE
+# if (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(5,2)) && defined(CONFIG_ANON_INODES)
+# define RHEL_ANON_INODES
+# endif
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) && !defined(RHEL_ANON_INODES)
static struct vfsmount *anon_inode_mnt __read_mostly;
static struct inode *anon_inode_inode;
@@ -228,7 +235,7 @@ void kvm_exit_anon_inodes(void)
#undef anon_inode_getfd
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26) && !defined(RHEL_ANON_INODES)
int kvm_anon_inode_getfd(const char *name,
const struct file_operations *fops,
@@ -245,7 +252,7 @@ int kvm_anon_inode_getfd(const char *name,
return fd;
}
-#elif LINUX_VERSION_CODE == KERNEL_VERSION(2,6,26)
+#elif LINUX_VERSION_CODE == KERNEL_VERSION(2,6,26) && !defined(RHEL_ANON_INODES)
int kvm_anon_inode_getfd(const char *name,
const struct file_operations *fops,
--
1.6.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] compat code fixes for RHEL5 kernels
2009-01-23 18:41 [PATCH 0/3] kvm-userspace build and compat fixes Eduardo Habkost
2009-01-23 18:41 ` [PATCH 1/3] kvm: qemu: don't fail building when pc-bios dir is empty Eduardo Habkost
2009-01-23 18:41 ` [PATCH 2/3] Use native anon_inodes on RHEL5 if available Eduardo Habkost
@ 2009-01-23 18:41 ` Eduardo Habkost
2 siblings, 0 replies; 7+ messages in thread
From: Eduardo Habkost @ 2009-01-23 18:41 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm, Andrea Arcangeli, Eduardo Habkost
From: Andrea Arcangeli <aarcange@redhat.com>
Compat code for some RHEL5 kernel versions.
This patch also applies to the maint/2.6.29 branch.
[ehabkost: changed pagefault_* to check for RHEL < 5.2 instead of RHEL <= 5.2]
[ehabkost: changed __aligned to check for RHEL <= 5.2 && !defined(__aligned)]
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
kernel/external-module-compat-comm.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/kernel/external-module-compat-comm.h b/kernel/external-module-compat-comm.h
index 981dc96..7f4d591 100644
--- a/kernel/external-module-compat-comm.h
+++ b/kernel/external-module-compat-comm.h
@@ -250,6 +250,7 @@ static inline void blahblah(void)
/* pagefault_enable(), page_fault_disable() - 2.6.20 */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,2)
static inline void pagefault_disable(void)
{
@@ -276,6 +277,9 @@ static inline void pagefault_enable(void)
preempt_check_resched();
}
+#else
+#include <linux/uaccess.h>
+#endif
#endif
/* vm ops ->fault() was introduced in 2.6.23. */
@@ -405,8 +409,10 @@ static inline ktime_t ktime_get(void)
/* __aligned arrived in 2.6.21 */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)
+#if !defined(RHEL_RELEASE_CODE) || (RHEL_RELEASE_CODE <= RHEL_RELEASE_VERSION(5,2) && !defined(__aligned))
#define __aligned(x) __attribute__((__aligned__(x)))
#endif
+#endif
#include <linux/mm.h>
--
1.6.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] kvm: qemu: don't fail building when pc-bios dir is empty
2009-01-23 18:41 ` [PATCH 1/3] kvm: qemu: don't fail building when pc-bios dir is empty Eduardo Habkost
@ 2009-01-26 14:46 ` Marcelo Tosatti
2009-01-26 15:57 ` Eduardo Habkost
0 siblings, 1 reply; 7+ messages in thread
From: Marcelo Tosatti @ 2009-01-26 14:46 UTC (permalink / raw)
To: Eduardo Habkost; +Cc: Avi Kivity, kvm
On Fri, Jan 23, 2009 at 04:41:33PM -0200, Eduardo Habkost wrote:
> The '[ -f "$file" ] && install' command will make the return code
> of the command to be non-zero, making 'make' abort. Use shell 'if'
> construct instead.
>
> This patch also applies to the maint/2.6.29 branch.
Hi Eduardo,
Can you send this one to qemu upstream please?
Applied the other two.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] kvm: qemu: don't fail building when pc-bios dir is empty
2009-01-26 14:46 ` Marcelo Tosatti
@ 2009-01-26 15:57 ` Eduardo Habkost
2009-01-26 16:12 ` Marcelo Tosatti
0 siblings, 1 reply; 7+ messages in thread
From: Eduardo Habkost @ 2009-01-26 15:57 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: Avi Kivity, kvm
On Mon, Jan 26, 2009 at 12:46:36PM -0200, Marcelo Tosatti wrote:
> On Fri, Jan 23, 2009 at 04:41:33PM -0200, Eduardo Habkost wrote:
> > The '[ -f "$file" ] && install' command will make the return code
> > of the command to be non-zero, making 'make' abort. Use shell 'if'
> > construct instead.
> >
> > This patch also applies to the maint/2.6.29 branch.
>
> Hi Eduardo,
>
> Can you send this one to qemu upstream please?
qemu upstream doesn't have the '[ -f "$file" ]' conditional, so the fix
applies only to the kvm tree.
Maybe we could have the conditional (after fixing it) on qemu upstream,
but I am not sure about that.
--
Eduardo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] kvm: qemu: don't fail building when pc-bios dir is empty
2009-01-26 15:57 ` Eduardo Habkost
@ 2009-01-26 16:12 ` Marcelo Tosatti
0 siblings, 0 replies; 7+ messages in thread
From: Marcelo Tosatti @ 2009-01-26 16:12 UTC (permalink / raw)
To: Eduardo Habkost; +Cc: Avi Kivity, kvm
On Mon, Jan 26, 2009 at 01:57:34PM -0200, Eduardo Habkost wrote:
> qemu upstream doesn't have the '[ -f "$file" ]' conditional, so the fix
> applies only to the kvm tree.
>
> Maybe we could have the conditional (after fixing it) on qemu upstream,
> but I am not sure about that.
Oh, sorry. Applied.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-01-26 16:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-23 18:41 [PATCH 0/3] kvm-userspace build and compat fixes Eduardo Habkost
2009-01-23 18:41 ` [PATCH 1/3] kvm: qemu: don't fail building when pc-bios dir is empty Eduardo Habkost
2009-01-26 14:46 ` Marcelo Tosatti
2009-01-26 15:57 ` Eduardo Habkost
2009-01-26 16:12 ` Marcelo Tosatti
2009-01-23 18:41 ` [PATCH 2/3] Use native anon_inodes on RHEL5 if available Eduardo Habkost
2009-01-23 18:41 ` [PATCH 3/3] compat code fixes for RHEL5 kernels Eduardo Habkost
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox