virtio-9p-handle: define AT_EMPTY_PATH if needed
PATCH 1/1 virtio-9p-handle: define AT_EMPTY_PATH if needed
If AT_EMPTY_PATH is not in one of the included files, go ahead and define it. qemu won't compile on ubuntu for me without this.
(Note - alternatively we could #include <linux/fcntl.h> to pick up the definitions there)
--- hw/9pfs/virtio-9p-handle.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
hw/9pfs/virtio-9p-handle.c +9 -0
@@ -39,6 +39,15 @@#ifndef BTRFS_SUPER_MAGIC #define BTRFS_SUPER_MAGIC 0x9123683E#endif +#ifndef AT_REMOVEDIR +#define AT_REMOVEDIR 0x200 +#endif +#ifndef AT_EMPTY_PATH +#define AT_EMPTY_PATH 0x1000/* Allow empty relative pathname */ +#endif +#ifndef O_PATH +#define O_PATH 010000000 +#endif struct handle_data {int mountfd;
Signature · 1 line
1.7.9
[Qemu-devel] [BUG QEMU 1.1] virtio-9p-handle does not compile
Hi Anthony,
currently QEMU 1.1 doesn't compile virtfs correctly on Ubuntu:
qemu/hw/9pfs/virtio-9p-handle.c: In function ‘handle_update_file_cred’:qemu/hw/9pfs/virtio-9p-handle.c:66:58: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function) qemu/hw/9pfs/virtio-9p-handle.c:66:58: note: each undeclared identifier is reported only once for each function it appears in qemu/hw/9pfs/virtio-9p-handle.c: In function ‘handle_lstat’:qemu/hw/9pfs/virtio-9p-handle.c:87:34: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function) qemu/hw/9pfs/virtio-9p-handle.c: In function ‘handle_symlink’:qemu/hw/9pfs/virtio-9p-handle.c:314:62: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function) qemu/hw/9pfs/virtio-9p-handle.c: In function ‘handle_link’:qemu/hw/9pfs/virtio-9p-handle.c:337:45: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function) qemu/hw/9pfs/virtio-9p-handle.c: In function ‘handle_chown’:qemu/hw/9pfs/virtio-9p-handle.c:373:58: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function)
a patch was sent on the 24th of Feb to fix the issue (also see below):
http://marc.info/?l=qemu-devel&m=133011313912147
Even though it is not particularly pretty, in the absence of better alternatives it should probably be applied.
Cheers,
Stefano
Quoted 35 lines · Serge Hallyn
If
AT_EMPTY_PATHis not in one of the included files, go ahead and define it. qemu won't compile on ubuntu for me without this.(Note - alternatively we could #include <
linux/fcntl.h> to pick up the definitions there)Signed-off-by Serge Hallyn <[email protected]>--- hw/9pfs/virtio-9p-handle.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)hw/9pfs/virtio-9p-handle.c +9
-0@@ -39,6 +39,15 @@#ifndef BTRFS_SUPER_MAGIC #define BTRFS_SUPER_MAGIC 0x9123683E#endif +#ifndef AT_REMOVEDIR +#define AT_REMOVEDIR 0x200 +#endif +#ifndef AT_EMPTY_PATH +#define AT_EMPTY_PATH 0x1000/* Allow empty relative pathname */ +#endif +#ifndef O_PATH +#define O_PATH 010000000 +#endif struct handle_data {int mountfd;Signature · 1 line
1.7.9
Re: [Qemu-devel] [BUG QEMU 1.1] virtio-9p-handle does not compile
Am 06.06.2012 12:50, schrieb Stefano Stabellini:
Quoted 61 lines
Hi Anthony,
currently QEMU 1.1 doesn't compile virtfs correctly on Ubuntu:
qemu/hw/9pfs/virtio-9p-handle.c: In function ‘handle_update_file_cred’:qemu/hw/9pfs/virtio-9p-handle.c:66:58: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function)qemu/hw/9pfs/virtio-9p-handle.c:66:58: note: each undeclared identifier is reported only once for each function it appears inqemu/hw/9pfs/virtio-9p-handle.c: In function ‘handle_lstat’:qemu/hw/9pfs/virtio-9p-handle.c:87:34: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function)qemu/hw/9pfs/virtio-9p-handle.c: In function ‘handle_symlink’:qemu/hw/9pfs/virtio-9p-handle.c:314:62: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function)qemu/hw/9pfs/virtio-9p-handle.c: In function ‘handle_link’:qemu/hw/9pfs/virtio-9p-handle.c:337:45: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function)qemu/hw/9pfs/virtio-9p-handle.c: In function ‘handle_chown’:qemu/hw/9pfs/virtio-9p-handle.c:373:58: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function)a patch was sent on the 24th of Feb to fix the issue (also see below):
http://marc.info/?l=qemu-devel&m=133011313912147
Even though it is not particularly pretty, in the absence of better alternatives it should probably be applied.
Cheers,
Stefano
Quoted 29 lines · Serge Hallyn
If
AT_EMPTY_PATHis not in one of the included files, go ahead and define it. qemu won't compile on ubuntu for me without this.(Note - alternatively we could #include<linux/fcntl.h> to pick up the definitions there)
Signed-off-by Serge Hallyn<[email protected]>--- hw/9pfs/virtio-9p-handle.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)hw/9pfs/virtio-9p-handle.c +9
-0@@ -39,6 +39,15 @@#ifndef BTRFS_SUPER_MAGIC #define BTRFS_SUPER_MAGIC 0x9123683E#endif +#ifndef AT_REMOVEDIR +#define AT_REMOVEDIR 0x200 +#endif +#ifndef AT_EMPTY_PATH +#define AT_EMPTY_PATH 0x1000/* Allow empty relative pathname */ +#endif +#ifndef O_PATH +#define O_PATH 010000000 +#endif
Quoted 4 lines
Quoted 4 lines
hw/9pfs/virtio-9p-handle.c +0
-0struct handle_data {int mountfd;Signature · 1 line
1.7.9
The patch will fix the compiler error messages, but will the resulting code work? Maybe it has runtime dependencies (Linux kernel?) which should be checked at runtime.
Would an enhanced test in configure be a better solution? It could disable VirtFS automatically if the definitions are missing.
On Ubuntu Lenny, there is no definition for AT_EMPTY_PATH, not even in linux/fcntl.h.
Regards,
Stefan W.
Re: [Qemu-devel] [BUG QEMU 1.1] virtio-9p-handle does not compile
Quoted 72 lines · Stefan Weil
Am 06.06.2012 12:50, schrieb Stefano Stabellini:
Quoted 61 lines
Hi Anthony,
currently QEMU 1.1 doesn't compile virtfs correctly on Ubuntu:
qemu/hw/9pfs/virtio-9p-handle.c: In function ‘handle_update_file_cred’:qemu/hw/9pfs/virtio-9p-handle.c:66:58: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function)qemu/hw/9pfs/virtio-9p-handle.c:66:58: note: each undeclared identifier is reported only once for each function it appears inqemu/hw/9pfs/virtio-9p-handle.c: In function ‘handle_lstat’:qemu/hw/9pfs/virtio-9p-handle.c:87:34: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function)qemu/hw/9pfs/virtio-9p-handle.c: In function ‘handle_symlink’:qemu/hw/9pfs/virtio-9p-handle.c:314:62: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function)qemu/hw/9pfs/virtio-9p-handle.c: In function ‘handle_link’:qemu/hw/9pfs/virtio-9p-handle.c:337:45: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function)qemu/hw/9pfs/virtio-9p-handle.c: In function ‘handle_chown’:qemu/hw/9pfs/virtio-9p-handle.c:373:58: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function)a patch was sent on the 24th of Feb to fix the issue (also see below):
http://marc.info/?l=qemu-devel&m=133011313912147
Even though it is not particularly pretty, in the absence of better alternatives it should probably be applied.
Cheers,
Stefano
Quoted 29 lines · Serge Hallyn
If
AT_EMPTY_PATHis not in one of the included files, go ahead and define it. qemu won't compile on ubuntu for me without this.(Note - alternatively we could #include<linux/fcntl.h> to pick up the definitions there)
Signed-off-by Serge Hallyn<[email protected]>--- hw/9pfs/virtio-9p-handle.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)hw/9pfs/virtio-9p-handle.c +9
-0@@ -39,6 +39,15 @@#ifndef BTRFS_SUPER_MAGIC #define BTRFS_SUPER_MAGIC 0x9123683E#endif +#ifndef AT_REMOVEDIR +#define AT_REMOVEDIR 0x200 +#endif +#ifndef AT_EMPTY_PATH +#define AT_EMPTY_PATH 0x1000/* Allow empty relative pathname */ +#endif +#ifndef O_PATH +#define O_PATH 010000000 +#endif Quoted 4 lines
Quoted 4 lines
hw/9pfs/virtio-9p-handle.c +0
-0struct handle_data {int mountfd;Signature · 1 line
1.7.9The patch will fix the compiler error messages, but will the resulting code work? Maybe it has runtime dependencies (Linux kernel?) which should be checked at runtime.
Quoted 5 lines
Would an enhanced test in configure be a better solution? It could disable VirtFS automatically if the definitions are missing.
On Ubuntu Lenny, there is no definition for
AT_EMPTY_PATH,
(Debian Lenny I presume)
True, the flag is newer than I thought. How could the configure option be enhanced? Could we simply grep for it in /usr/include/linux/fcntl.h, set an option saying it exists, then still do the #ifndef in hw/9pfs/virtio-9p-handle.c?
(The problem is that the glibc and linux headers are currently not compatible... a separate problem, yes, but one I can't currently overcome AFAIK)
Quoted 5 lines
not even in
linux/fcntl.h.Regards,
Stefan W.
Re: [Qemu-devel] [BUG QEMU 1.1] virtio-9p-handle does not compile
Am 06.06.2012 19:49, schrieb Serge Hallyn:
Quoted 11 lines · Stefan Weil
Quoted 9 lines
The patch will fix the compiler error messages, but will the resulting code work? Maybe it has runtime dependencies (Linux kernel?) which should be checked at runtime.
Would an enhanced test in configure be a better solution? It could disable VirtFS automatically if the definitions are missing.
On Ubuntu Lenny, there is no definition for
AT_EMPTY_PATH,(Debian Lenny I presume)
Sorry, my mistake. I meant Ubuntu Lucid.
Quoted 8 lines
True, the flag is newer than I thought. How could the configure option be enhanced? Could we simply grep for it in
/usr/include/linux/fcntl.h, set an option saying it exists, then still do the #ifndef inhw/9pfs/virtio-9p-handle.c?(The problem is that the glibc and linux headers are currently not compatible... a separate problem, yes, but one I can't currently overcome AFAIK)
I'd use virtio-9p-handle only if AT_EMPTY_PATH is defined without requiring a hack like using linux/fcntl.h.
configure can check that. Should I send a patch which does this check?
Regards,
Stefan W.
Re: [Qemu-devel] [BUG QEMU 1.1] virtio-9p-handle does not compile
----- Original message -----
Quoted 20 lines
Am 06.06.2012 19:49, schrieb Serge Hallyn:
Quoted 11 lines · Stefan Weil
Quoted 9 lines
The patch will fix the compiler error messages, but will the resulting code work? Maybe it has runtime dependencies (Linux kernel?) which should be checked at runtime.
Would an enhanced test in configure be a better solution? It could disable VirtFS automatically if the definitions are missing.
On Ubuntu Lenny, there is no definition for
AT_EMPTY_PATH,(Debian Lenny I presume)
Sorry, my mistake. I meant Ubuntu Lucid.
Quoted 5 lines
True, the flag is newer than I thought. How could the configure option be enhanced? Could we simply grep for it in
/usr/include/linux/fcntl.h, set an option saying it exists, then still do the #ifndef inhw/9pfs/virtio-9p-handle.c?
Quoted 8 lines
Quoted 3 lines
(The problem is that the glibc and linux headers are currently not compatible... a separate problem, yes, but one I can't currently overcome AFAIK)
I'd use virtio-9p-handle only if
AT_EMPTY_PATHis defined without requiring a hack like usinglinux/fcntl.h.configure can check that. Should I send a patch which does this check?
That'd be great, please do - thanks!
-Serge
Re: [Qemu-devel] [BUG QEMU 1.1] virtio-9p-handle does not compile
In reply to Stefan WeilQuoted 4 lines · Stefan Weil
Am 06.06.2012 12:50, schrieb Stefano Stabellini:
Quoted 3 lines
Hi Anthony,
currently QEMU 1.1 doesn't compile virtfs correctly on Ubuntu:
.....
Quoted 11 lines
The patch will fix the compiler error messages, but will the resulting code work? Maybe it has runtime dependencies (Linux kernel?) which should be checked at runtime.
Would an enhanced test in configure be a better solution? It could disable VirtFS automatically if the definitions are missing.
On Ubuntu Lenny, there is no definition for
AT_EMPTY_PATH, not even inlinux/fcntl.h.
We enable virtio-9p-handle only if open_by_handle_at is supported by glibc. And if open_by_handle_at is supported by glibc AT_EMPTY_PATH should also be there, because they all went in linux kernel for the same feature set. So if glibc didn't pick AT_EMPTY_PATH definition and took open_by_handle_at feature, it should be fixed in glibc.
BTW I am still not clear why including linux/fcntl.h gives those compile errors. IMHO fixing those errors and including linux/fcntl.h in virtio-9p-handle.c would be a better fix than redefining these constants.
-aneesh
Quoted 5 lines · Serge Hallyn
If
AT_EMPTY_PATHis not in one of the included files, go ahead and define it. qemu won't compile on ubuntu for me without this.(Note - alternatively we could #include <
linux/fcntl.h> to pick up the definitions there)
Then why don't we do that ? I do get the below errors
In file included from /usr/include/x86_64-linux-gnu/asm/fcntl.h:1:0,
from /usr/include/linux/fcntl.h:4,
from /home/opensource/sources/qemu/qemu-upstream/hw/9pfs/virtio-9p-handle.c:28:/usr/include/asm-generic/fcntl.h:127:8: error: redefinition of ‘struct f_owner_ex’ /usr/include/x86_64-linux-gnu/bits/fcntl.h:204:8: note: originally defined here In file included from /usr/include/x86_64-linux-gnu/asm/fcntl.h:1:0,
from /usr/include/linux/fcntl.h:4,
Are they do to ubuntu multi-arch changes ?
Quoted 28 lines
Signed-off-by Serge Hallyn <[email protected]>--- hw/9pfs/virtio-9p-handle.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)hw/9pfs/virtio-9p-handle.c +9
-0@@ -39,6 +39,15 @@#ifndef BTRFS_SUPER_MAGIC #define BTRFS_SUPER_MAGIC 0x9123683E#endif +#ifndef AT_REMOVEDIR +#define AT_REMOVEDIR 0x200 +#endif +#ifndef AT_EMPTY_PATH +#define AT_EMPTY_PATH 0x1000/* Allow empty relative pathname */ +#endif +#ifndef O_PATH +#define O_PATH 010000000 +#endif struct handle_data {int mountfd;Signature · 1 line
1.7.9
-aneesh
Quoted 18 lines · Aneesh Kumar K.V
Quoted 5 lines · Serge Hallyn
If
AT_EMPTY_PATHis not in one of the included files, go ahead and define it. qemu won't compile on ubuntu for me without this.(Note - alternatively we could #include <
linux/fcntl.h> to pick up the definitions there)Then why don't we do that ? I do get the below errors
In file included from
/usr/include/x86_64-linux-gnu/asm/fcntl.h:1:0,
from/usr/include/linux/fcntl.h:4,
from/home/opensource/sources/qemu/qemu-upstream/hw/9pfs/virtio-9p-handle.c:28:/usr/include/asm-generic/fcntl.h:127:8: error: redefinition of ‘struct f_owner_ex’/usr/include/x86_64-linux-gnu/bits/fcntl.h:204:8: note: originally defined here In file included from/usr/include/x86_64-linux-gnu/asm/fcntl.h:1:0,
from/usr/include/linux/fcntl.h:4,
Quoted 1 line
Are they do to ubuntu multi-arch changes ?
I don't think so. I got these awhile ago as well. The libc and linux headers simply don't seem to be compatible.
Quoted 31 lines
Quoted 28 lines
Signed-off-by Serge Hallyn <[email protected]>--- hw/9pfs/virtio-9p-handle.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)hw/9pfs/virtio-9p-handle.c +9
-0@@ -39,6 +39,15 @@#ifndef BTRFS_SUPER_MAGIC #define BTRFS_SUPER_MAGIC 0x9123683E#endif +#ifndef AT_REMOVEDIR +#define AT_REMOVEDIR 0x200 +#endif +#ifndef AT_EMPTY_PATH +#define AT_EMPTY_PATH 0x1000/* Allow empty relative pathname */ +#endif +#ifndef O_PATH +#define O_PATH 010000000 +#endif struct handle_data {int mountfd;Signature · 1 line
1.7.9-aneesh