iotune.diff

iotune support for kvm block devices - Vladislav Gorbunov, 12/07/2013 01:01 PM

Download (2.77 KB)

View differences:

../opennebula-4.4.0/src/vmm/LibVirtDriverKVM.cc 2013-12-08 00:53:08.147999944 +1200
64 64
    string  ceph_host  = "";
65 65
    string  ceph_secret= "";
66 66
    string  ceph_user  = "";
67
    string  total_bytes_sec = "";
68
    string  read_bytes_sec  = "";
69
    string  write_bytes_sec = "";
70
    string  total_iops_sec  = "";
71
    string  read_iops_sec   = "";
72
    string  write_iops_sec  = "";
67 73

  
68 74
    int     disk_id;
69 75
    string  default_driver          = "";
......
331 337
        ceph_host   = disk->vector_value("CEPH_HOST");
332 338
        ceph_secret = disk->vector_value("CEPH_SECRET");
333 339
        ceph_user   = disk->vector_value("CEPH_USER");
340
        total_bytes_sec = disk->vector_value("TOTAL_BYTES_SEC");
341
        read_bytes_sec = disk->vector_value("READ_BYTES_SEC");
342
        write_bytes_sec = disk->vector_value("WRITE_BYTES_SEC");
343
        total_iops_sec   = disk->vector_value("TOTAL_IOPS_SEC");
344
        read_iops_sec   = disk->vector_value("READ_IOPS_SEC");
345
        write_iops_sec  = disk->vector_value("WRITE_IOPS_SEC");
334 346

  
335 347
        disk->vector_value_str("DISK_ID", disk_id);
336 348

  
......
487 499
            file << " io='" << default_driver_disk_io << "'";
488 500
        }
489 501

  
490
        file << "/>" << endl << "\t\t</disk>" << endl;
502
        file << "/>" << endl;
503
        
504
        if ( !(total_bytes_sec.empty() && read_bytes_sec.empty() 
505
             && write_bytes_sec.empty() && total_iops_sec.empty() 
506
             && read_iops_sec.empty() && write_iops_sec.empty()) )
507
        {
508
            file << "\t\t\t<iotune>" << endl;
509
            if ( !total_bytes_sec.empty() )
510
            {
511
                file << "\t\t\t\t<total_bytes_sec>" << total_bytes_sec << "</total_bytes_sec>" << endl;
512
            }
513
            if ( !read_bytes_sec.empty() )
514
            {
515
                file << "\t\t\t\t<read_bytes_sec>" << read_bytes_sec << "</read_bytes_sec>" << endl;
516
            }
517
            if ( !write_bytes_sec.empty() )
518
            {
519
                file << "\t\t\t\t<write_bytes_sec>" << write_bytes_sec << "</write_bytes_sec>" << endl;
520
            }
521
            if ( !total_iops_sec.empty() )
522
            {
523
                file << "\t\t\t\t<total_iops_sec>" << total_iops_sec << "</total_iops_sec>" << endl;
524
            }
525
            if ( !read_iops_sec.empty() )
526
            {
527
                file << "\t\t\t\t<read_iops_sec>" << read_iops_sec << "</read_iops_sec>" << endl;
528
            }
529
            if ( !write_iops_sec.empty() )
530
            {
531
                file << "\t\t\t\t<write_iops_sec>" << write_iops_sec << "</write_iops_sec>" << endl;
532
            }
533
            file << "\t\t\t</iotune>" << endl;
534
        }
535
        file << "\t\t</disk>" << endl;
491 536
    }
492 537

  
493 538
    attrs.clear();