From 1096242f252dee4f1510102578a474769fa97edb Mon Sep 17 00:00:00 2001
From: Lucas Meneghel Rodrigues <lmr@redhat.com>
Date: Sat, 19 Jan 2013 10:59:03 -0600
Subject: [PATCH] nic_hotplug: Removing move of the hotplug rules

It was pointed out that this prevents the devices from
coming up and NetworkManager can't assign addresses.

CC: Cleber Rosa <cleber@redhat.com>
CC: Feng Yang <fyang@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
---
 qemu/tests/nic_hotplug.py | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/qemu/tests/nic_hotplug.py b/qemu/tests/nic_hotplug.py
index a554e4a9..549e658a 100644
--- a/qemu/tests/nic_hotplug.py
+++ b/qemu/tests/nic_hotplug.py
@@ -1,6 +1,6 @@
 import logging
 from autotest.client.shared import error
-from virttest import utils_test, virt_vm, aexpect
+from virttest import utils_test, virt_vm
 
 
 def run_nic_hotplug(test, params, env):
@@ -38,20 +38,7 @@ def run_nic_hotplug(test, params, env):
 
     session = utils_test.wait_for_login(vm, timeout=login_timeout)
 
-    udev_rules_path = "/etc/udev/rules.d/70-persistent-net.rules"
-    udev_rules_bkp_path = "/tmp/70-persistent-net.rules"
-
-    def guest_path_isfile(path):
-        try:
-            session.cmd("test -f %s" % path)
-        except aexpect.ShellError:
-            return False
-        return True
-
     if guest_is_not_windows:
-        if guest_path_isfile(udev_rules_path):
-            session.cmd("mv -f %s %s" % (udev_rules_path, udev_rules_bkp_path))
-
         # Modprobe the module if specified in config file
         module = params.get("modprobe_module")
         if module:
@@ -96,10 +83,3 @@ def run_nic_hotplug(test, params, env):
         for nic in vm.virtnet:
             if not (nic.nic_name == nic_name):
                 vm.set_link(nic.device_id, up=True)
-
-    # Attempt to put back udev network naming rules, even if the command to
-    # disable the rules failed. We may be undoing what was done in a previous
-    # (failed) test that never reached this point.
-    if guest_is_not_windows:
-        if guest_path_isfile(udev_rules_bkp_path):
-            session.cmd("mv -f %s %s" % (udev_rules_bkp_path, udev_rules_path))
-- 
GitLab