[Ovirt-devel] [PATCH] fix for Bug 466719

Scott Seago sseago at redhat.com
Thu Dec 11 19:16:54 UTC 2008


fix for Bug 466719: VM pool sort by load no longer causes server errors. It's still not doing anything useful yet, but that won't come until we update the stats code to aggregate something useful in the new pools load_average column.

Signed-off-by: Scott Seago <sseago at redhat.com>
---
 src/app/views/resources/_grid.rhtml |    2 +-
 src/db/migrate/032_add_pool_load.rb |   28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletions(-)
 create mode 100644 src/db/migrate/032_add_pool_load.rb

diff --git a/src/app/views/resources/_grid.rhtml b/src/app/views/resources/_grid.rhtml
index 908eac7..9b5e1c2 100644
--- a/src/app/views/resources/_grid.rhtml
+++ b/src/app/views/resources/_grid.rhtml
@@ -15,7 +15,7 @@
 	colModel : [
 		{display: '', name : 'id', width : 20, sortable : false, align: 'left', process: <%= table_id %>checkbox},
 		{display: 'Name', name : 'name', width : 160, sortable : true, align: 'left'},
-        {display: 'Load', name : 'load', width: 180, sortable : false, align: 'left', process: <%= table_id %>_load_widget }
+        {display: 'Load', name : 'load_average', width: 180, sortable : false, align: 'left', process: <%= table_id %>_load_widget }
 		],
 	sortname: "name",
 	sortorder: "asc",
diff --git a/src/db/migrate/032_add_pool_load.rb b/src/db/migrate/032_add_pool_load.rb
new file mode 100644
index 0000000..fbb1b55
--- /dev/null
+++ b/src/db/migrate/032_add_pool_load.rb
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2008 Red Hat, Inc.
+# Written by Scott Seago <sseago at redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.  A copy of the GNU General Public License is
+# also available at http://www.gnu.org/copyleft/gpl.html.
+
+class AddPoolLoad < ActiveRecord::Migration
+  def self.up
+    add_column :pools, :load_average, :float
+  end
+
+  def self.down
+    drop_column :pools, :load_average
+  end
+end
-- 
1.6.0.4




More information about the ovirt-devel mailing list