|
|
97ae69 |
From cdc0aab726f8fc9145c264fb7277f622ae8b7956 Mon Sep 17 00:00:00 2001
|
|
|
e76f14 |
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
|
e76f14 |
Date: Mon, 21 Sep 2015 12:38:50 -0400
|
|
|
e76f14 |
Subject: [PATCH] RHEL 7: Revert "launch: libvirt: Better error when bridge /
|
|
|
e76f14 |
virbr0 doesn't exist (RHBZ#1262127)."
|
|
|
e76f14 |
|
|
|
e76f14 |
This reverts commit edcd02a965ae6675c0ee9ecd8d98a1a641c6ef60.
|
|
|
e76f14 |
---
|
|
|
97ae69 |
lib/launch-libvirt.c | 47 --------------------------------------------
|
|
|
e76f14 |
1 file changed, 47 deletions(-)
|
|
|
e76f14 |
|
|
|
90a56e |
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
|
|
|
97ae69 |
index f0f52fba0..c709c4fe2 100644
|
|
|
90a56e |
--- a/lib/launch-libvirt.c
|
|
|
90a56e |
+++ b/lib/launch-libvirt.c
|
|
|
90a56e |
@@ -155,7 +155,6 @@ static int is_blk (const char *path);
|
|
|
e76f14 |
static void ignore_errors (void *ignore, virErrorPtr ignore2);
|
|
|
e76f14 |
static void set_socket_create_context (guestfs_h *g);
|
|
|
e76f14 |
static void clear_socket_create_context (guestfs_h *g);
|
|
|
e76f14 |
-static int check_bridge_exists (guestfs_h *g, const char *brname);
|
|
|
e76f14 |
|
|
|
e76f14 |
#if HAVE_LIBSELINUX
|
|
|
e76f14 |
static void selinux_warning (guestfs_h *g, const char *func, const char *selinux_op, const char *data);
|
|
|
97ae69 |
@@ -438,9 +437,6 @@ launch_libvirt (guestfs_h *g, void *datav, const char *libvirt_uri)
|
|
|
e76f14 |
guestfs_int_get_backend_setting_bool (g, "internal_libvirt_norelabel_disks");
|
|
|
e76f14 |
guestfs_pop_error_handler (g);
|
|
|
e76f14 |
|
|
|
e76f14 |
- if (g->enable_network && check_bridge_exists (g, data->network_bridge) == -1)
|
|
|
e76f14 |
- goto cleanup;
|
|
|
e76f14 |
-
|
|
|
e76f14 |
/* Locate and/or build the appliance. */
|
|
|
e76f14 |
TRACE0 (launch_build_libvirt_appliance_start);
|
|
|
e76f14 |
|
|
|
97ae69 |
@@ -2048,49 +2044,6 @@ is_blk (const char *path)
|
|
|
e76f14 |
return S_ISBLK (statbuf.st_mode);
|
|
|
e76f14 |
}
|
|
|
e76f14 |
|
|
|
e76f14 |
-static int
|
|
|
e76f14 |
-is_dir (const char *path)
|
|
|
e76f14 |
-{
|
|
|
e76f14 |
- struct stat statbuf;
|
|
|
e76f14 |
-
|
|
|
e76f14 |
- if (stat (path, &statbuf) == -1)
|
|
|
e76f14 |
- return 0;
|
|
|
e76f14 |
- return S_ISDIR (statbuf.st_mode);
|
|
|
e76f14 |
-}
|
|
|
e76f14 |
-
|
|
|
e76f14 |
-/* Used to check the network_bridge exists, or give a useful error
|
|
|
e76f14 |
- * message.
|
|
|
e76f14 |
- */
|
|
|
e76f14 |
-static int
|
|
|
e76f14 |
-check_bridge_exists (guestfs_h *g, const char *brname)
|
|
|
e76f14 |
-{
|
|
|
e76f14 |
- CLEANUP_FREE char *path = NULL;
|
|
|
e76f14 |
-
|
|
|
e76f14 |
- /* If this doesn't look like Linux, give up. */
|
|
|
e76f14 |
- if (!is_dir ("/sys/class/net"))
|
|
|
e76f14 |
- return 0;
|
|
|
e76f14 |
-
|
|
|
e76f14 |
- /* Does the interface exist and is it a bridge? */
|
|
|
e76f14 |
- path = safe_asprintf (g, "/sys/class/net/%s/bridge", brname);
|
|
|
e76f14 |
- if (is_dir (path))
|
|
|
e76f14 |
- return 0;
|
|
|
e76f14 |
-
|
|
|
e76f14 |
- error (g,
|
|
|
97ae69 |
- _("bridge ā%sā not found. Try running:\n"
|
|
|
e76f14 |
- "\n"
|
|
|
e76f14 |
- " brctl show\n"
|
|
|
e76f14 |
- "\n"
|
|
|
e76f14 |
- "to get a list of bridges on the host, and then selecting the\n"
|
|
|
e76f14 |
- "bridge you wish the appliance network to connect to using:\n"
|
|
|
e76f14 |
- "\n"
|
|
|
e76f14 |
- " export LIBGUESTFS_BACKEND_SETTINGS=network_bridge=<bridge name>\n"
|
|
|
e76f14 |
- "\n"
|
|
|
e76f14 |
- "You may also need to allow the bridge in /etc/qemu/bridge.conf.\n"
|
|
|
e76f14 |
- "For further information see guestfs(3)."),
|
|
|
e76f14 |
- brname);
|
|
|
e76f14 |
- return -1;
|
|
|
e76f14 |
-}
|
|
|
e76f14 |
-
|
|
|
e76f14 |
static void
|
|
|
e76f14 |
ignore_errors (void *ignore, virErrorPtr ignore2)
|
|
|
e76f14 |
{
|
|
|
e76f14 |
--
|
|
|
97ae69 |
2.17.1
|
|
|
e76f14 |
|