From d576b9855cda543580d1e2fb8c7a8f7201ae6b5d Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Mon, 3 Oct 2011 23:01:55 +0200 Subject: [PATCH] dom0/qvm-create: do not add PCI devs to new NetVM (#282) This makes sense only in firstboot - so move it there. --- dom0/qvm-tools/qvm-create | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/dom0/qvm-tools/qvm-create b/dom0/qvm-tools/qvm-create index 4ca09b8c..a8eafbd6 100755 --- a/dom0/qvm-tools/qvm-create +++ b/dom0/qvm-tools/qvm-create @@ -27,26 +27,6 @@ import subprocess import re import os -def find_net_devices(): - p = subprocess.Popen (["lspci", "-mm", "-n"], stdout=subprocess.PIPE) - result = p.communicate() - retcode = p.returncode - if (retcode != 0): - print "ERROR when executing lspci!" - raise IOError - - net_devices = set() - rx_netdev = re.compile (r"^([0-9][0-9]:[0-9][0-9].[0-9]) \"02") - for dev in str(result[0]).splitlines(): - match = rx_netdev.match (dev) - if match is not None: - dev_bdf = match.group(1) - assert dev_bdf is not None - net_devices.add (dev_bdf) - - return net_devices - - def main(): usage = "usage: %prog [options] " parser = OptionParser (usage) @@ -137,17 +117,6 @@ def main(): vm = None if options.netvm: vm = qvm_collection.add_new_netvm(vmname, new_vm_template, label = label, updateable = options.standalone) - - net_devices = find_net_devices() - print "Found the following net devices in your system:" - devs = [] - for dev in net_devices: - print "--> {0}".format(dev) - devs.append(dev) - - print "Assigning them to the netvm '{0}'".format(vmname) - vm.pcidevs = str(devs) - elif options.proxyvm: vm = qvm_collection.add_new_proxyvm(vmname, new_vm_template, label = label, updateable = options.standalone) else: