Commit 84488ced by Bach Dániel

vm: add e1000, rtl8139, pcnet, ne2k_pci support

parent 2da6b728
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('vm', '0001_initial'),
operations = [
field=models.CharField(default='virtio', max_length=10, choices=[('virtio', 'virtio'), ('ne2k_pci', 'ne2k_pci'), ('pcnet', 'pcnet'), ('rtl8139', 'rtl8139'), ('e1000', 'e1000')]),
......@@ -20,7 +20,7 @@ from __future__ import absolute_import, unicode_literals
from logging import getLogger
from netaddr import EUI, mac_unix
from django.db.models import Model, ForeignKey, BooleanField
from django.db.models import Model, ForeignKey, BooleanField, CharField
from django.utils.translation import ugettext_lazy as _, ugettext_noop
from common.models import create_readable
......@@ -61,11 +61,15 @@ class Interface(Model):
"""Network interface for an instance.
MODEL_TYPES = (('virtio', 'virtio'), ('ne2k_pci', 'ne2k_pci'),
('pcnet', 'pcnet'), ('rtl8139', 'rtl8139'),
('e1000', 'e1000'))
vlan = ForeignKey(Vlan, verbose_name=_('vlan'),
host = ForeignKey(Host, verbose_name=_('host'), blank=True, null=True)
instance = ForeignKey('Instance', verbose_name=_('instance'),
model = CharField(max_length=10, choices=MODEL_TYPES, default='virtio')
class Meta:
app_label = 'vm'
......@@ -104,6 +108,7 @@ class Interface(Model):
'ipv4': str( if is not None else None,
'ipv6': str( if is not None else None,
'vlan': self.vlan.vid,
'model': self.model,
'managed': is not None
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment