Skip to contentSkip to conversation

virtfs-proxy-helper: Fix and clean include statements

PATCH Applied Stefan Weil 2 participants 5 messages Jan 11, 2012 – Jan 12, 2012

lore
Share & tools
lore
#0 lore raw

cover virtfs-proxy-helper: Fix and clean include statements

Obviously most Linux host systems don't have a libcap-dev package.

If this package is available, make tries to build virtfs-proxy-helper and fails on recent Linux distributions because of a missing attr/xattr.h.

The first patch fixes this. As I noticed that several include statements were redundant, I added the second patch which is optional but cleans the code a little bit.

Please consider adding libcap-dev to the Linux build bots (and of course to the personal Linux environment when you are a maintainer).

Regards,
Stefan Weil

[PATCH 1/2] virtfs-proxy-helper: Fix compilation on newer systems [PATCH 2/2] virtfs-proxy-helper: Clean include files

#1 lore raw

PATCH 1/2 virtfs-proxy-helper: Fix compilation on newer systems

Include file attr/xattr.h is not available on "newer" systems (for example Fedora 12 or Debian Squeeze).

See comments in qemu-xattr.h for more information. This file handles the system dependencies automatically.

---
 fsdev/virtfs-proxy-helper.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fsdev/virtfs-proxy-helper.c +1 -1
index 7f8def5..ce7eb79 100644
@@ -27,13 +27,13 @@
 #include <stdbool.h>
 #include <sys/vfs.h>
 #include <sys/stat.h>
-#include <attr/xattr.h>
 #include <sys/ioctl.h>
 #include <linux/fs.h>
 #ifdef CONFIG_LINUX_MAGIC_H
 #include <linux/magic.h>
 #endif
 #include "qemu-common.h"
+#include "qemu-xattr.h"
 #include "virtio-9p-marshal.h"
 #include "hw/9pfs/virtio-9p-proxy.h"
 #include "fsdev/virtio-9p-marshal.h"
Signature · 1 line
1.7.2.5
#2 lore raw

PATCH 2/2 virtfs-proxy-helper: Clean include files

In reply to Stefan Weil

The common standard include files are already included via qemu-common.h, and for the socket related include files there is qemu_socket.h, so the code can be reduced by some lines.

---
 fsdev/virtfs-proxy-helper.c |   15 ++-------------
 1 files changed, 2 insertions(+), 13 deletions(-)
fsdev/virtfs-proxy-helper.c +2 -13
index ce7eb79..21e9b16 100644
@@ -8,31 +8,20 @@
  * This work is licensed under the terms of the GNU GPL, version 2. See
  * the COPYING file in the top-level directory.
  */
-#include <stdio.h>
-#include <sys/socket.h>
-#include <string.h>
-#include <sys/un.h>
-#include <limits.h>
-#include <signal.h>
-#include <errno.h>
-#include <stdlib.h>
+
 #include <sys/resource.h>
-#include <sys/stat.h>
 #include <getopt.h>
-#include <unistd.h>
 #include <syslog.h>
 #include <sys/capability.h>
 #include <sys/fsuid.h>
-#include <stdarg.h>
-#include <stdbool.h>
 #include <sys/vfs.h>
-#include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <linux/fs.h>
 #ifdef CONFIG_LINUX_MAGIC_H
 #include <linux/magic.h>
 #endif
 #include "qemu-common.h"
+#include "qemu_socket.h"
 #include "qemu-xattr.h"
 #include "virtio-9p-marshal.h"
 #include "hw/9pfs/virtio-9p-proxy.h"
Signature · 1 line
1.7.2.5
#3 lore raw
In reply to Stefan Weil
Quoted 9 lines · Stefan Weil

Obviously most Linux host systems don't have a libcap-dev package.

If this package is available, make tries to build virtfs-proxy-helper and fails on recent Linux distributions because of a missing attr/xattr.h.

The first patch fixes this. As I noticed that several include statements were redundant, I added the second patch which is optional but cleans the code a little bit.

Quoted 9 lines

Please consider adding libcap-dev to the Linux build bots (and of course to the personal Linux environment when you are a maintainer).

Regards,
Stefan Weil

[PATCH 1/2] virtfs-proxy-helper: Fix compilation on newer systems [PATCH 2/2] virtfs-proxy-helper: Clean include files

Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches

Stefan

#4 lore raw
In reply to Stefan Weil
Quoted 2 lines · Stefan Weil

Please consider adding libcap-dev to the Linux build bots (and of course to the personal Linux environment when you are a maintainer).

I have added it to yuzuki.

Stefan