change the NIC configuration accordingly after remove "nics=n"

otherwise, nics=-1 will be passed to device model and cause device
model exiting.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
This commit is contained in:
Xiaofeng Ling committed 2005-12-13 10:57:04 +00:00
1 parent d4895766cb
commit e697c7e8ef
3 files changed
+8 -5

No files matched your search

+5 -3
View File
@@ -238,9 +238,7 @@ class VmxImageHandler(ImageHandler):
# xm config file
def parseDeviceModelArgs(self, imageConfig, deviceConfig):
dmargs = [ 'cdrom', 'boot', 'fda', 'fdb', 'ne2000',
'localtime', 'serial', 'stdvga', 'isa', 'vcpus',
'nics'
]
'localtime', 'serial', 'stdvga', 'isa', 'vcpus']
ret = []
for a in dmargs:
v = sxp.child_value(imageConfig, a)
@@ -262,6 +260,7 @@ class VmxImageHandler(ImageHandler):
# Handle disk/network related options
mac = None
ret = ret + ["-domain-name", "%s" % self.vm.info['name']]
nics = 0
for (name, info) in deviceConfig:
if name == 'vbd':
uname = sxp.child_value(info, 'uname')
@@ -283,6 +282,7 @@ class VmxImageHandler(ImageHandler):
type = sxp.child_value(info, 'type')
if type != 'ioemu':
continue
nics += 1
if mac != None:
continue
mac = sxp.child_value(info, 'mac')
@@ -299,6 +299,8 @@ class VmxImageHandler(ImageHandler):
instance = sxp.child_value(info, 'pref_instance')
ret.append("-instance")
ret.append("%s" % instance)
ret.append("-nics")
ret.append("%d" % nics)
return ret
def configVNC(self, config):
+1 -2
View File
@@ -545,8 +545,7 @@ def configure_vmx(config_image, vals):
"""
args = [ 'device_model', 'vcpus', 'cdrom', 'boot', 'fda', 'fdb',
'localtime', 'serial', 'stdvga', 'isa', 'nographic',
'vnc', 'vncviewer', 'sdl', 'display', 'ne2000', 'lapic',
'nics']
'vnc', 'vncviewer', 'sdl', 'display', 'ne2000', 'lapic']
for a in args:
if (vals.__dict__[a]):
config_image.append([a, vals.__dict__[a]])
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.