Revision e050429a

View differences:

src/vmm/LibVirtDriverKVM.cc
62 62
    string  bridge     = "";
63 63
    string  script     = "";
64 64
    string  model      = "";
65
    string  ip         = "";
66
    string  filter     = "";
67
    string  default_filter = "";
65 68

  
66 69
    const VectorAttribute * graphics;
67 70

  
......
419 422
    // Network interfaces
420 423
    // ------------------------------------------------------------------------
421 424

  
425
    get_default("NIC","FILTER",default_filter);
426

  
422 427
    num = vm->get_template_attribute("NIC",attrs);
423 428

  
424 429
    for(int i=0; i<num; i++)
......
435 440
        target = nic->vector_value("TARGET");
436 441
        script = nic->vector_value("SCRIPT");
437 442
        model  = nic->vector_value("MODEL");
443
        ip     = nic->vector_value("IP");
444
        filter = nic->vector_value("FILTER");
438 445

  
439 446
        if ( bridge.empty() )
440 447
        {
......
466 473
            file << "\t\t\t<model type='" << model << "'/>" << endl;
467 474
        }
468 475

  
469
        file << "\t\t</interface>" << endl;
476
        if (!ip.empty() )
477
        {
478
            string * the_filter = 0;
479

  
480
            if (!filter.empty())
481
            {
482
                the_filter = &filter;
483
            } 
484
            else if (!default_filter.empty())
485
            {
486
                the_filter = &default_filter;
487
            }
488

  
489
            if ( the_filter != 0 )
490
            {
491
                file <<"\t\t\t<filterref filter='"<< *the_filter <<"'/>"<<endl;
492
                file << "\t\t\t\t<parameter name='IP' value='" 
493
                     << ip << "'/>" << endl;
494
                file << "\t\t\t</filterref>" << endl; 
495
            }
496
        }
470 497

  
498
        file << "\t\t</interface>" << endl;
471 499
    }
472 500

  
473 501
    attrs.clear();
src/vmm_mad/ssh/vmm_ssh_kvm.conf
23 23
#  - cpu
24 24
#  - vcpu
25 25
#  - features [acpi, pae]
26
#  - disk [driver ]A
26
#  - disk [driver]
27
#  - nic  [filter]
27 28

  
28 29
#EMULATOR = /usr/libexec/qemu-kvm
29 30

  
......
34 35
FEATURES = [ PAE = "no", ACPI = "yes" ]
35 36

  
36 37
DISK     = [ driver = "raw" ]
38

  
39
NIC      = [ filter = "clean-traffic" ]

Also available in: Unified diff