Revision 171bf550

View differences:

src/vmm/LibVirtDriverKVM.cc
209 209
    string default_raw = "";
210 210
    string data        = "";
211 211

  
212
    string vm_xml;
212
    string  vm_xml;
213
    string* vm64;
213 214

  
214 215
    // ------------------------------------------------------------------------
215 216

  
......
517 518
            dev << vm->get_remote_system_dir() << "/disk." << disk_id;
518 519

  
519 520
            file << "\t\t<disk type='block' device='disk'>\n"
520
                 << "\t\t\t<source dev=" << one_util::escape_xml_attr(dev)
521
                 << "\t\t\t<source dev=" << one_util::escape_xml_attr(dev.str())
521 522
                 << "/>\n";
522 523
        }
523 524
        else if ( type == "ISCSI" )
......
584 585
                rbd_name << "-" << vm->get_oid() << "-" << disk_id;
585 586
            }
586 587

  
587
            file << one_util::escape_xml_attr(rbd_name);
588
            file << one_util::escape_xml_attr(rbd_name.str());
588 589

  
589 590
            do_network_hosts(file, ceph_host, "", CEPH_DEFAULT_PORT);
590 591

  
......
619 620
                sheep_name << "-" << vm->get_oid() << "-" << disk_id;
620 621
            }
621 622

  
622
            file << one_util::escape_xml_attr(sheep_name);
623
            file << one_util::escape_xml_attr(sheep_name.str());
623 624

  
624 625
            do_network_hosts(file, sheepdog_host, "tcp", -1);
625 626
        }
......
649 650
                gluster_name << one_util::split(source, '/').back();
650 651
            }
651 652

  
652
            file << one_util::escape_xml_attr(gluster_name);
653
            file << one_util::escape_xml_attr(gluster_name.str());
653 654

  
654 655
            do_network_hosts(file, gluster_host, "tcp", GLUSTER_DEFAULT_PORT);
655 656
        }
......
661 662

  
662 663
            file << "\t\t<disk type='file' device='cdrom'>\n"
663 664
                 << "\t\t\t<source file="
664
                 << one_util::escape_xml_attr(cd_name)<< "/>\n";
665
                 << one_util::escape_xml_attr(cd_name.str())<< "/>\n";
665 666
        }
666 667
        else
667 668
        {
......
671 672

  
672 673
            file << "\t\t<disk type='file' device='disk'>\n"
673 674
                 << "\t\t\t<source file="
674
                 << one_util::escape_xml_attr(fname) << "/>\n";
675
                 << one_util::escape_xml_attr(fname.str()) << "/>\n";
675 676
        }
676 677

  
677 678
        // ---- target device to map the disk ----
......
809 810

  
810 811
            file << "\t\t<disk type='file' device='cdrom'>\n"
811 812
                 << "\t\t\t<source file="
812
                     << one_util::escape_xml_attr(fname)  << "/>\n"
813
                     << one_util::escape_xml_attr(fname.str())  << "/>\n"
813 814
                 << "\t\t\t<target dev="
814 815
                     << one_util::escape_xml_attr(target) << "/>\n"
815 816
                 << "\t\t\t<readonly/>\n"
......
1150 1151
    // ------------------------------------------------------------------------
1151 1152
    // Metadata used by drivers
1152 1153
    // ------------------------------------------------------------------------
1154
    vm64 = one_util::base64_encode(vm->to_xml(vm_xml));
1155

  
1153 1156
    file << "\t<metadata>\n"
1154 1157
         << "\t\t<system_datastore>"
1155
             << one_util::escape_xml(vm->get_remote_system_dir())
1156
         << "</system_datastore>\n"
1157
         << "\t\t<vm_xml64>"
1158
             << one_util::escape_xml(one_util::base64_encode(vm->to_xml(vm_xml)))
1159
         << "<vm_xml64>\n"
1160
         << "\t</metadata>\n";
1158
         << one_util::escape_xml(vm->get_remote_system_dir())
1159
         << "</system_datastore>\n";
1160

  
1161
    if ( vm64 != 0 )
1162
    {
1163
        file << "\t\t<vm_xml64>"<< one_util::escape_xml(*vm64)<< "</vm_xml64>\n";
1164
        delete vm64;
1165
    }
1166

  
1167
    file << "\t</metadata>\n";
1161 1168

  
1162 1169
    file << "</domain>" << endl;
1163 1170

  

Also available in: Unified diff