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