* [Qemu-devel] [PATCH 02/02] linux-user : add vmsplice system call
@ 2009-05-24 8:05 vibi sreenivasan
2009-05-24 18:21 ` Martin Mohring
0 siblings, 1 reply; 4+ messages in thread
From: vibi sreenivasan @ 2009-05-24 8:05 UTC (permalink / raw)
To: qemu-devel
linux-user : add vmsplice system call
Signed-off-by: vibi sreenivasan <vibi_sreenivasan@cms.com>
---
linux-user/syscall.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index dc726ad..bb32f84 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6598,6 +6598,20 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
break;
#endif
+#ifdef TARGET_NR_vmsplice
+ case TARGET_NR_vmsplice:
+ {
+ int count = arg3;
+ struct iovec *vec;
+
+ vec = alloca(count * sizeof(struct iovec));
+ if (lock_iovec(VERIFY_READ, vec, arg2, count, 1) < 0)
+ goto efault;
+ ret = get_errno(vmsplice(arg1, vec, count, arg4));
+ unlock_iovec(vec, arg2, count, 0);
+ }
+ break;
+#endif
default:
unimplemented:
gemu_log("qemu: Unsupported syscall: %d\n", num);
--
1.6.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 02/02] linux-user : add vmsplice system call
2009-05-24 8:05 [Qemu-devel] [PATCH 02/02] linux-user : add vmsplice system call vibi sreenivasan
@ 2009-05-24 18:21 ` Martin Mohring
2009-05-25 6:13 ` vibi sreenivasan
0 siblings, 1 reply; 4+ messages in thread
From: Martin Mohring @ 2009-05-24 18:21 UTC (permalink / raw)
To: vibi_sreenivasan; +Cc: Riku Voipio, qemu-devel
Hi,
fine that you provide missing syscalls for user mode one after the other.
I have one remark: if the host os kernel is too old to provide the
syscalls, they should be #if'ed out (tee, vmsplice & co).
Or even emulate the syscall - which can be quite hard.
I put together the new user linux patches together with riku, seems the
main qemu staff likes more to make qemu system mode stuff.
Regards, Martin
vibi sreenivasan wrote:
> linux-user : add vmsplice system call
>
> Signed-off-by: vibi sreenivasan <vibi_sreenivasan@cms.com>
>
> ---
> linux-user/syscall.c | 14 ++++++++++++++
> 1 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index dc726ad..bb32f84 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -6598,6 +6598,20 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
> break;
> #endif
>
> +#ifdef TARGET_NR_vmsplice
> + case TARGET_NR_vmsplice:
> + {
> + int count = arg3;
> + struct iovec *vec;
> +
> + vec = alloca(count * sizeof(struct iovec));
> + if (lock_iovec(VERIFY_READ, vec, arg2, count, 1) < 0)
> + goto efault;
> + ret = get_errno(vmsplice(arg1, vec, count, arg4));
> + unlock_iovec(vec, arg2, count, 0);
> + }
> + break;
> +#endif
> default:
> unimplemented:
> gemu_log("qemu: Unsupported syscall: %d\n", num);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 02/02] linux-user : add vmsplice system call
2009-05-24 18:21 ` Martin Mohring
@ 2009-05-25 6:13 ` vibi sreenivasan
2009-05-25 14:04 ` Riku Voipio
0 siblings, 1 reply; 4+ messages in thread
From: vibi sreenivasan @ 2009-05-25 6:13 UTC (permalink / raw)
To: Martin Mohring; +Cc: Riku Voipio, qemu-devel
hi,
Thanks for your comment.
> fine that you provide missing syscalls for user mode one after the other.
>
> I have one remark: if the host os kernel is too old to provide the
> syscalls, they should be #if'ed out (tee, vmsplice & co).
if the host kernel is too old , i think it will return -1 & set errno to
ENOSYS.
So isnt that same as putting #ifdef.
> Or even emulate the syscall - which can be quite hard.
Hmm thinking on that. will it be worth?
>
> I put together the new user linux patches together with riku, seems the
> main qemu staff likes more to make qemu system mode stuff.
>
Thanks for that.
Thanks & Regards
vibi sreenivasan
> Regards, Martin
>
> vibi sreenivasan wrote:
> > linux-user : add vmsplice system call
> >
> > Signed-off-by: vibi sreenivasan <vibi_sreenivasan@cms.com>
> >
> > ---
> > linux-user/syscall.c | 14 ++++++++++++++
> > 1 files changed, 14 insertions(+), 0 deletions(-)
> >
> > diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> > index dc726ad..bb32f84 100644
> > --- a/linux-user/syscall.c
> > +++ b/linux-user/syscall.c
> > @@ -6598,6 +6598,20 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
> > break;
> > #endif
> >
> > +#ifdef TARGET_NR_vmsplice
> > + case TARGET_NR_vmsplice:
> > + {
> > + int count = arg3;
> > + struct iovec *vec;
> > +
> > + vec = alloca(count * sizeof(struct iovec));
> > + if (lock_iovec(VERIFY_READ, vec, arg2, count, 1) < 0)
> > + goto efault;
> > + ret = get_errno(vmsplice(arg1, vec, count, arg4));
> > + unlock_iovec(vec, arg2, count, 0);
> > + }
> > + break;
> > +#endif
> > default:
> > unimplemented:
> > gemu_log("qemu: Unsupported syscall: %d\n", num);
> >
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 02/02] linux-user : add vmsplice system call
2009-05-25 6:13 ` vibi sreenivasan
@ 2009-05-25 14:04 ` Riku Voipio
0 siblings, 0 replies; 4+ messages in thread
From: Riku Voipio @ 2009-05-25 14:04 UTC (permalink / raw)
To: vibi sreenivasan; +Cc: Martin Mohring, qemu-devel
On Mon, May 25, 2009 at 11:43:07AM +0530, vibi sreenivasan wrote:
> hi,
> Thanks for your comment.
> > fine that you provide missing syscalls for user mode one after the other.
> >
> > I have one remark: if the host os kernel is too old to provide the
> > syscalls, they should be #if'ed out (tee, vmsplice & co).
> if the host kernel is too old , i think it will return -1 & set errno to
> ENOSYS.
> So isnt that same as putting #ifdef.
Yes, having old kernel is not a problem in this. However, having a
old libc when compiling qemu can be a problem. Think Redhat RHEL 4
or debian etch. vmsplice() is not available, and compiling qemu
would fail.
See how we #ifdef utimensat in linux-user/syscall.c and detect
availability in ./configure
Other than that, your patches looked ok.
> > Or even emulate the syscall - which can be quite hard.
> Hmm thinking on that. will it be worth?
This could be in interest for people who want to run qemu linux-user
on non-linux systems (such a *bsd). But that doesn't work yet,
and even when people get it working, new syscalls such as tee/splice
are not the most important ones to provide emulation for. Very
few applications use these syscalls yet.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-05-25 14:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-24 8:05 [Qemu-devel] [PATCH 02/02] linux-user : add vmsplice system call vibi sreenivasan
2009-05-24 18:21 ` Martin Mohring
2009-05-25 6:13 ` vibi sreenivasan
2009-05-25 14:04 ` Riku Voipio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).