Revision 8754dc49 src/vmm/LibVirtDriverKVM.cc

View differences:

src/vmm/LibVirtDriverKVM.cc
184 184

  
185 185
    vector<const VectorAttribute *> pci;
186 186

  
187
    string  domain          = "";
187
    string  domain   = "";
188 188
    /* bus is already defined for disks */
189
    string  slot            = "";
190
    string  func            = "";
189
    string  slot     = "";
190
    string  func     = "";
191

  
192
    string vm_domain = "";
193
    string vm_bus    = "";
194
    string vm_slot   = "";
195
    string vm_func   = "";
191 196

  
192 197
    const VectorAttribute * features;
193 198

  
......
1014 1019
        slot    = pci[i]->vector_value("SLOT");
1015 1020
        func    = pci[i]->vector_value("FUNCTION");
1016 1021

  
1022
        vm_domain  = pci[i]->vector_value("VM_DOMAIN");
1023
        vm_bus     = pci[i]->vector_value("VM_BUS");
1024
        vm_slot    = pci[i]->vector_value("VM_SLOT");
1025
        vm_func    = pci[i]->vector_value("VM_FUNCTION");
1026

  
1017 1027
        if ( domain.empty() || bus.empty() || slot.empty() || func.empty() )
1018 1028
        {
1019 1029
            vm->log("VMM", Log::WARNING,
......
1033 1043
             << "/>\n";
1034 1044
        file << "\t\t\t</source>\n";
1035 1045

  
1046
        if ( !vm_domain.empty() && !vm_bus.empty() && !vm_slot.empty() &&
1047
                !vm_func.empty() )
1048
        {
1049
            file << "\t\t\t\t<address type='pci'"
1050
                     << " domain="   << one_util::escape_xml_attr(vm_domain)
1051
                     << " bus="      << one_util::escape_xml_attr(vm_bus)
1052
                     << " slot="     << one_util::escape_xml_attr(vm_slot)
1053
                     << " function=" << one_util::escape_xml_attr(vm_func)
1054
                 << "/>\n";
1055
        }
1056

  
1036 1057
        file << "\t\t</hostdev>" << endl;
1037 1058
    }
1038 1059

  

Also available in: Unified diff