Matthew Booth
2013-May-16 15:24 UTC
[Libguestfs] [PATCH] Fix compiler warning when libselinux is not present
static function selinux_warning() isn't used if HAVE_LIBSELINUX isn't defined, which results in a warning. --- src/launch-libvirt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c index 4588602..10a4d2c 100644 --- a/src/launch-libvirt.c +++ b/src/launch-libvirt.c @@ -138,7 +138,10 @@ static int make_drive_priv (guestfs_h *g, struct drive *drv, const char *selinux static void drive_free_priv (void *); static void set_socket_create_context (guestfs_h *g); static void clear_socket_create_context (guestfs_h *g); + +#if HAVE_LIBSELINUX static void selinux_warning (guestfs_h *g, const char *func, const char *selinux_op, const char *data); +#endif static int launch_libvirt (guestfs_h *g, const char *libvirt_uri) @@ -1716,6 +1719,7 @@ libvirt_error (guestfs_h *g, const char *fs, ...) free (msg); } +#if HAVE_LIBSELINUX static void selinux_warning (guestfs_h *g, const char *func, const char *selinux_op, const char *data) @@ -1724,6 +1728,7 @@ selinux_warning (guestfs_h *g, const char *func, " [you can ignore this UNLESS using SELinux + sVirt]", func, selinux_op, data ? data : "(none)"); } +#endif /* This backend assumes virtio-scsi is available. */ static int -- 1.8.1.4
Richard W.M. Jones
2013-May-16 15:41 UTC
[Libguestfs] [PATCH] Fix compiler warning when libselinux is not present
On Thu, May 16, 2013 at 04:24:22PM +0100, Matthew Booth wrote:> static function selinux_warning() isn't used if HAVE_LIBSELINUX isn't > defined, which results in a warning. > --- > src/launch-libvirt.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c > index 4588602..10a4d2c 100644 > --- a/src/launch-libvirt.c > +++ b/src/launch-libvirt.c > @@ -138,7 +138,10 @@ static int make_drive_priv (guestfs_h *g, struct drive *drv, const char *selinux > static void drive_free_priv (void *); > static void set_socket_create_context (guestfs_h *g); > static void clear_socket_create_context (guestfs_h *g); > + > +#if HAVE_LIBSELINUX > static void selinux_warning (guestfs_h *g, const char *func, const char *selinux_op, const char *data); > +#endif > > static int > launch_libvirt (guestfs_h *g, const char *libvirt_uri) > @@ -1716,6 +1719,7 @@ libvirt_error (guestfs_h *g, const char *fs, ...) > free (msg); > } > > +#if HAVE_LIBSELINUX > static void > selinux_warning (guestfs_h *g, const char *func, > const char *selinux_op, const char *data) > @@ -1724,6 +1728,7 @@ selinux_warning (guestfs_h *g, const char *func, > " [you can ignore this UNLESS using SELinux + sVirt]", > func, selinux_op, data ? data : "(none)"); > } > +#endif > > /* This backend assumes virtio-scsi is available. */ > static int > -- > 1.8.1.4ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Seemingly Similar Threads
- [PATCH] launch: libvirt: Better error when bridge / virbr0 doesn't exist (RHBZ#1262127).
- [PATCH 0/7] Fix SELinux security contexts so we can access shared disks (RHBZ#912499).
- [PATCH v2] Revert "launch: libvirt: Use qemu-bridge-helper to implement a full network (RHBZ#1148012)."
- [PATCH v2] Revert "launch: libvirt: Use qemu-bridge-helper to implement a full network (RHBZ#1148012)."
- [PATCH 0/2] Don't use snapshot=on