[PATCH] [Kimchi] For s390x hide VNC, PCI, Snapshot, Graphics and clone options
by rajgupta@linux.vnet.ibm.com
From: Rajat Gupta <rajgupta(a)linux.vnet.ibm.com>
For s390x hide VNC, PCI, Snapshot, Graphics and clone options
Signed-off-by: Rajat Gupta <rajgupta(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.guest_edit_main.js | 4 ++++
ui/js/src/kimchi.guest_main.js | 8 ++++++++
ui/js/src/kimchi.template_edit_main.js | 1 +
ui/pages/template-edit.html.tmpl | 4 ++--
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js
index c3609c2..9669d08 100644
--- a/ui/js/src/kimchi.guest_edit_main.js
+++ b/ui/js/src/kimchi.guest_edit_main.js
@@ -1207,4 +1207,8 @@ kimchi.guest_edit_main = function() {
}
}
};
+
+ if(kimchi.hostarch === s390xArch){
+ $('#guest-edit-window ul li a[data-id="form-guest-edit-pci"],a[data-id="form-guest-edit-snapshot"]').parent().hide();
+ }
};
diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js
index 34217e4..f1be019 100644
--- a/ui/js/src/kimchi.guest_main.js
+++ b/ui/js/src/kimchi.guest_main.js
@@ -20,6 +20,9 @@
var guestFilterList;
var listFiltered;
+//init s390x Architecture
+var s390xArch = 's390x';
+
kimchi.sampleGuestObject = {
"name": "",
"uuid": "",
@@ -897,6 +900,11 @@ kimchi.listVmsAuto = function() {
}
$('#guests-root-container > .wok-mask').fadeOut(300, function() {
});
+ //check if Architecture is s390x and hide VNC column
+ if(kimchi.hostarch === s390xArch){
+ $('#guests-root-container span.column-vnc').addClass('hidden');
+ $('#guestList a[name="vm-clone"]').hide();
+ }
} else {
$('.grid-control').addClass('hidden');
$('#guestListField').hide();
diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js
index 7d7cce3..b1f5123 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -69,6 +69,7 @@ kimchi.template_edit_main = function() {
$('input[name="' + prop + '"]', templateEditMain).val(value);
}
if(kimchi.hostarch == s390xArch){
+ $('.graphics', templateEditMain).hide();
$('.console', templateEditMain).show();
var consoleData = template.console ? template.console : '';
$('#template-edit-console', templateEditMain).val(consoleData);
diff --git a/ui/pages/template-edit.html.tmpl b/ui/pages/template-edit.html.tmpl
index 9ccc664..10532be 100644
--- a/ui/pages/template-edit.html.tmpl
+++ b/ui/pages/template-edit.html.tmpl
@@ -70,7 +70,7 @@
<div class="template-edit-wrapper-label templ-edit-vm-image hide">
<label for="template-edit-vmimage-textbox">$_("Image File")</label>
</div>
- <div class="template-edit-wrapper-label">
+ <div class="template-edit-wrapper-label graphics">
<label>$_("Graphics")</label>
</div>
<div class="template-edit-wrapper-label console" style="display:none">
@@ -104,7 +104,7 @@
<input id="template-edit-vmimage-textbox" class="form-control" name="vm-image" type="text" disabled="disabled" />
<span class="fa fa-times form-control-feedback"></span>
</div>
- <div class="template-edit-wrapper-controls">
+ <div class="template-edit-wrapper-controls graphics">
<select id="template-edit-graphics" name="graphics" class="form-control" />
</div>
<div class="template-edit-wrapper-controls console" style="display:none">
--
2.1.0
8 years, 2 months
[PATCH V2] Issue #999 : Attach storage to guest on s390x without libvirt
by harshalp@linux.vnet.ibm.com
From: Harshal Patil <harshalp(a)linux.vnet.ibm.com>
V1:
This patch enables direct storage attachment to guests running
on s390x arch without going through libvirt
V2:
Rebase with latest HEAD
Signed-off-by: Harshal Patil <harshalp(a)linux.vnet.ibm.com>
---
docs/API.md | 3 +++
i18n.py | 3 +++
model/vmstorages.py | 25 +++++++++++++++++++++++--
3 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/docs/API.md b/docs/API.md
index cff623e..b29108d 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -239,6 +239,9 @@ Represents a snapshot of the Virtual Machine's primary monitor.
* path: Path of cdrom iso.
* pool: Storage pool which disk image file locate in.
* vol: Storage volume name of disk image.
+ * dir_path: s390x specific attribute to attach direct storage without libvirt
+ * format: s390x specific attribute specify the format of direct storage
+ * size: s390x specific attribute to specify the size of direct storage
### Sub-resource: storage
**URI:** /plugins/kimchi/vms/*:name*/storages/*:dev*
diff --git a/i18n.py b/i18n.py
index 89a23af..82c679b 100644
--- a/i18n.py
+++ b/i18n.py
@@ -336,6 +336,9 @@ messages = {
"KCHVMSTOR0016E": _("Volume already in use by other virtual machine."),
"KCHVMSTOR0017E": _("Only one of path or pool/volume can be specified to add a new virtual machine disk"),
"KCHVMSTOR0018E": _("Volume chosen with format %(format)s does not fit in the storage type %(type)s"),
+ "KCHVMSTOR0019E": _("On s390x arch one of pool, path of dir_path must be specified"),
+ "KCHVMSTOR0020E": _("On s390x arch 'format' must be specified while attaching disk to virtual machine"),
+ "KCHVMSTOR0021E": _("Virtual disk already exists on the system: %(disk_path)s"),
"KCHSNAP0001E": _("Virtual machine '%(vm)s' must be stopped before creating a snapshot of it."),
"KCHSNAP0002E": _("Unable to create snapshot '%(name)s' on virtual machine '%(vm)s'. Details: %(err)s"),
diff --git a/model/vmstorages.py b/model/vmstorages.py
index 2e9f783..db68121 100644
--- a/model/vmstorages.py
+++ b/model/vmstorages.py
@@ -17,6 +17,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+import os
import string
from lxml import etree
@@ -30,6 +31,7 @@ from wok.plugins.kimchi.model.storagevolumes import StorageVolumeModel
from wok.plugins.kimchi.model.utils import get_vm_config_flag
from wok.plugins.kimchi.model.vms import DOM_STATE_MAP, VMModel
from wok.plugins.kimchi.osinfo import lookup
+from wok.plugins.kimchi.utils import create_disk_image, is_s390x
from wok.plugins.kimchi.xmlutils.disk import get_device_node, get_disk_xml
from wok.plugins.kimchi.xmlutils.disk import get_vm_disk_info, get_vm_disks
@@ -82,11 +84,30 @@ class VMStoragesModel(object):
# Path will never be blank due to API.json verification.
# There is no need to cover this case here.
if not ('vol' in params) ^ ('path' in params):
- raise InvalidParameter("KCHVMSTOR0017E")
+
+ if not is_s390x():
+ raise InvalidParameter("KCHVMSTOR0017E")
+
+ if 'dir_path' not in params:
+ raise InvalidParameter("KCHVMSTOR0019E")
dom = VMModel.get_vm(vm_name, self.conn)
params['bus'] = _get_device_bus(params['type'], dom)
- params['format'] = 'raw'
+
+ if is_s390x() and params['type'] == 'disk' and 'dir_path' in params:
+ if 'format' not in params:
+ raise InvalidParameter("KCHVMSTOR0020E")
+ size = params['size']
+ name = params['name']
+ dir_path = params.get('dir_path')
+ params['path'] = dir_path + "/" + name
+ if os.path.exists(params['path']):
+ raise InvalidParameter("KCHVMSTOR0021E",
+ {'disk_path': params['path']})
+ create_disk_image(format_type=params['format'],
+ path=params['path'], capacity=size)
+ else:
+ params['format'] = 'raw'
dev_list = [dev for dev, bus in get_vm_disks(dom).iteritems()
if bus == params['bus']]
--
2.7.4
8 years, 2 months
[PATCH] [Kimchi] Fix issue #1005: Proper display paused guests on Gallery View
by Aline Manera
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
ui/css/kimchi.css | 78 ++++++++++++++++++++++++++++++++++++++---
ui/css/src/modules/_guests.scss | 76 ++++++++++++++++++++++++++++++++++++---
ui/pages/guest.html.tmpl | 6 +++-
3 files changed, 150 insertions(+), 10 deletions(-)
diff --git a/ui/css/kimchi.css b/ui/css/kimchi.css
index 6cf2cc9..de742b3 100644
--- a/ui/css/kimchi.css
+++ b/ui/css/kimchi.css
@@ -689,9 +689,12 @@
display: block;
}
-#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.running span.paused,
#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.running span.shutoff,
#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.running span.starting,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.running span.crashed,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.running span.nostate,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.running span.paused,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.running span.pmsuspended,
#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.running span.resetting {
display: none;
}
@@ -700,9 +703,12 @@
display: block;
}
-#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.shutoff span.paused,
#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.shutoff span.running,
#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.shutoff span.starting,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.shutoff span.crashed,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.shutoff span.nostate,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.shutoff span.paused,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.shutoff span.pmsuspended,
#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.shutoff span.resetting {
display: none;
}
@@ -711,21 +717,83 @@
display: block;
}
-#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.starting span.paused,
#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.starting span.running,
#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.starting span.shutoff,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.starting span.crashed,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.starting span.nostate,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.starting span.paused,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.starting span.pmsuspended,
#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.starting span.resetting {
display: none;
}
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.crashed span.crashed {
+ display: block;
+}
+
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.crashed span.running,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.crashed span.shutoff,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.crashed span.starting,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.crashed span.nostate,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.crashed span.paused,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.crashed span.pmsuspended,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.crashed span.resetting {
+ display: none;
+}
+
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.nostate span.nostate {
+ display: block;
+}
+
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.nostate span.running,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.nostate span.shutoff,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.nostate span.starting,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.nostate span.crashed,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.nostate span.paused,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.nostate span.pmsuspended,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.nostate span.resetting {
+ display: none;
+}
+
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.paused span.paused {
+ display: block;
+}
+
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.paused span.running,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.paused span.shutoff,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.paused span.starting,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.paused span.crashed,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.paused span.nostate,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.paused span.pmsuspended,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.paused span.resetting {
+ display: none;
+}
+
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.pmsuspended span.pmsuspended {
+ display: block;
+}
+
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.pmsuspended span.running,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.pmsuspended span.shutoff,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.pmsuspended span.starting,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.pmsuspended span.crashed,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.pmsuspended span.nostate,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.pmsuspended span.paused,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.pmsuspended span.resetting {
+ display: none;
+}
+
#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.resetting span.resetting {
display: block;
}
-#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.resetting span.paused,
#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.resetting span.running,
#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.resetting span.shutoff,
-#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.resetting span.starting {
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.resetting span.starting,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.resetting span.crashed,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.resetting span.nostate,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.resetting span.paused,
+#guest-content-container .wok-guest-gallery .wok-guest-list-item .btn > span.guest-state.resetting span.pmsuspended {
display: none;
}
diff --git a/ui/css/src/modules/_guests.scss b/ui/css/src/modules/_guests.scss
index 8b8345c..237b395 100644
--- a/ui/css/src/modules/_guests.scss
+++ b/ui/css/src/modules/_guests.scss
@@ -382,9 +382,12 @@
span.running {
display: block;
}
- span.paused,
span.shutoff,
span.starting,
+ span.crashed,
+ span.nostate,
+ span.paused,
+ span.pmsuspended,
span.resetting {
display: none;
}
@@ -393,9 +396,12 @@
span.shutoff {
display: block;
}
- span.paused,
span.running,
span.starting,
+ span.crashed,
+ span.nostate,
+ span.paused,
+ span.pmsuspended,
span.resetting {
display: none;
}
@@ -404,21 +410,83 @@
span.starting {
display: block;
}
+ span.running,
+ span.shutoff,
+ span.crashed,
+ span.nostate,
span.paused,
+ span.pmsuspended,
+ span.resetting {
+ display: none;
+ }
+ }
+ > span.guest-state.crashed {
+ span.crashed {
+ display: block;
+ }
span.running,
span.shutoff,
+ span.starting,
+ span.nostate,
+ span.paused,
+ span.pmsuspended,
span.resetting {
display: none;
}
}
- > span.guest-state.resetting {
+ > span.guest-state.nostate {
+ span.nostate {
+ display: block;
+ }
+ span.running,
+ span.shutoff,
+ span.starting,
+ span.crashed,
+ span.paused,
+ span.pmsuspended,
span.resetting {
+ display: none;
+ }
+ }
+ > span.guest-state.paused {
+ span.paused {
display: block;
}
+ span.running,
+ span.shutoff,
+ span.starting,
+ span.crashed,
+ span.nostate,
+ span.pmsuspended,
+ span.resetting {
+ display: none;
+ }
+ }
+ > span.guest-state.pmsuspended {
+ span.pmsuspended {
+ display: block;
+ }
+ span.running,
+ span.shutoff,
+ span.starting,
+ span.crashed,
+ span.nostate,
span.paused,
+ span.resetting {
+ display: none;
+ }
+ }
+ > span.guest-state.resetting {
+ span.resetting {
+ display: block;
+ }
span.running,
span.shutoff,
- span.starting {
+ span.starting,
+ span.crashed,
+ span.nostate,
+ span.paused,
+ span.pmsuspended {
display: none;
}
}
diff --git a/ui/pages/guest.html.tmpl b/ui/pages/guest.html.tmpl
index f92bf11..389ba9d 100644
--- a/ui/pages/guest.html.tmpl
+++ b/ui/pages/guest.html.tmpl
@@ -44,8 +44,12 @@
</span>
<span class="guest-state">
<span class="running"><i class="fa fa-power-off"></i><span class="text-status">$_("Running")</span></span><!--
- --><span class="shutoff"><i class="fa fa-ban"></i><span class="text-status">$_("Disconnected")</span></span><!--
+ --><span class="shutoff shutdown blocked"><i class="fa fa-ban"></i><span class="text-status">$_("Disconnected")</span></span><!--
--><span class="starting"><i class="fa fa-undo"></i><span class="text-status">$_("Starting")</span></span><!--
+ --><span class="crashed"><i class="fa fa-exclamation-triangle"></i><span class="text-status">$_("Crashed")</span></span><!--
+ --><span class="nostate"><i class="fa fa-question-circle"></i><span class="text-status">$_("Unknown")</span></span><!--
+ --><span class="paused"><i class="fa fa-pause"></i><span class="text-status">$_("Paused")</span></span><!--
+ --><span class="pmsuspended"><i class="fa fa-power-off"></i><span class="text-status">$_("Suspended")</span></span><!--
--><span class="resetting"><i class="fa fa-refresh fa-spin"></i><span class="text-status">$_("Resetting")</span></span><!--
--><span class="caret"></span>
</span>
--
2.5.5
8 years, 2 months
[PATCH] [Kimchi 0/3] Fix issue #1020
by Aline Manera
Aline Manera (3):
Fix issue #1020: Verify libvirt access on real file path instead of
symlink
Fix issue #1020: Fix alert icon position to do not overlay img/iso
icon
Bug fix: Disable "Search More ISOs" button on create Template dialog
when the operation is in progress
model/storagevolumes.py | 3 ++-
model/templates.py | 5 +++--
ui/css/kimchi.css | 4 ++--
ui/css/src/modules/_templates.scss | 4 ++--
ui/js/src/kimchi.template_add_main.js | 1 +
5 files changed, 10 insertions(+), 7 deletions(-)
--
2.5.5
8 years, 3 months
[PATCH] [Wok v2] Issue #155: 'make clean' does not revert its changes from 'make rpm'
by bianca@linux.vnet.ibm.com
From: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
Edited Makefile.am to check if there is any file to be stashed or
commited before run 'make rpm' to avoid losing any changes.
Also included 'git reset --hard' command to revert changes made by
'make rpm' command.
Signed-off-by: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
---
Makefile.am | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 10d9718..2b27a6a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -115,30 +115,17 @@ wok.spec: contrib/wok.spec.fedora contrib/wok.spec.suse
/bin/false ; \
fi
-check_files:
- @if [ -d '.git' ]; then \
- if [ `git status --porcelain --untracked-files=no | wc -l` -gt 0 ]; then \
- echo "***** Aborting 'make rpm' command *****"; \
- echo "There are some changes not commited in your working \
-directory. To avoid losing them, please commit or stage before run 'make rpm' command."; \
- exit 1; \
- fi \
- fi
-
-rpm: check_files dist wok.spec
+rpm: wok.spec
$(MKDIR_P) rpm/BUILD rpm/RPMS rpm/SOURCES rpm/SPECS rpm/SRPMS
cp $(top_srcdir)/wok.spec rpm/SPECS/wok.spec
cp $(DIST_ARCHIVES) rpm/SOURCES
rpmbuild -ba --define "_topdir `pwd`/rpm" rpm/SPECS/wok.spec
- @if [ -d '.git' ]; then \
- git reset --hard; \
- fi
-fedora-rpm: check_files contrib/wok.spec.fedora
+fedora-rpm: contrib/wok.spec.fedora
ln -sf contrib/wok.spec.fedora wok.spec
$(MAKE) rpm
-suse-rpm: check_files contrib/wok.spec.suse
+suse-rpm: contrib/wok.spec.suse
ln -sf contrib/wok.spec.suse wok.spec
$(MAKE) rpm
--
2.7.4
8 years, 3 months
Centos 7 latest and updated no VIRTIO support with Kimchi
by emad ramlawi
Hello,
I really like your project, just wondered why I cant see any options to set Virt IO devices, while PowerKVM have that, I am suing Version: 2.2.0-0
And Centos :
PowerKVM
Host userspace tools based on the libvirt API, including virsh.
Note: The HMC cannot be used on Power systems running PowerKVM.
PowerKVM device model support
Supported disk models:
* virtio-scsi
* virtio
* spapr-vscsi
Unsupported disk models:
* IDE
Supported network models:
* virtio
* spapr-vlan
Supported graphics models:
* vga (VNC backend only)
Unsupported graphics models:
* SPICE
8 years, 3 months
[PATCH] Issue #999: Attach storage to guest on s390x without libvirt
by harshalp@linux.vnet.ibm.com
From: Harshal Patil <harshalp(a)linux.vnet.ibm.com>
This patch enables direct storage attachment to guests running
on s390x arch without going through libvirt
Signed-off-by: Harshal Patil <harshalp(a)linux.vnet.ibm.com>
---
docs/API.md | 3 +++
i18n.py | 3 +++
model/vmstorages.py | 25 +++++++++++++++++++++++--
utils.py | 2 +-
4 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/docs/API.md b/docs/API.md
index 6678ac5..c9d5d2a 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -239,6 +239,9 @@ Represents a snapshot of the Virtual Machine's primary monitor.
* path: Path of cdrom iso.
* pool: Storage pool which disk image file locate in.
* vol: Storage volume name of disk image.
+ * dir_path: s390x specific attribute to attach direct storage without libvirt
+ * format: s390x specific attribute specify the format of direct storage
+ * size: s390x specific attribute to specify the size of direct storage
### Sub-resource: storage
**URI:** /plugins/kimchi/vms/*:name*/storages/*:dev*
diff --git a/i18n.py b/i18n.py
index fc7dbc7..ceb4286 100644
--- a/i18n.py
+++ b/i18n.py
@@ -332,6 +332,9 @@ messages = {
"KCHVMSTOR0016E": _("Volume already in use by other virtual machine."),
"KCHVMSTOR0017E": _("Only one of path or pool/volume can be specified to add a new virtual machine disk"),
"KCHVMSTOR0018E": _("Volume chosen with format %(format)s does not fit in the storage type %(type)s"),
+ "KCHVMSTOR0019E": _("On s390x arch one of pool, path of dir_path must be specified"),
+ "KCHVMSTOR0020E": _("On s390x arch 'format' must be specified while attaching disk to virtual machine"),
+ "KCHVMSTOR0021E": _("Virtual disk already exists on the system: %(disk_path)s"),
"KCHSNAP0001E": _("Virtual machine '%(vm)s' must be stopped before creating a snapshot of it."),
"KCHSNAP0002E": _("Unable to create snapshot '%(name)s' on virtual machine '%(vm)s'. Details: %(err)s"),
diff --git a/model/vmstorages.py b/model/vmstorages.py
index 2e9f783..156a16f 100644
--- a/model/vmstorages.py
+++ b/model/vmstorages.py
@@ -17,6 +17,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+import os
import string
from lxml import etree
@@ -30,6 +31,7 @@ from wok.plugins.kimchi.model.storagevolumes import StorageVolumeModel
from wok.plugins.kimchi.model.utils import get_vm_config_flag
from wok.plugins.kimchi.model.vms import DOM_STATE_MAP, VMModel
from wok.plugins.kimchi.osinfo import lookup
+from wok.plugins.kimchi.utils import create_disk_image, is_s390x
from wok.plugins.kimchi.xmlutils.disk import get_device_node, get_disk_xml
from wok.plugins.kimchi.xmlutils.disk import get_vm_disk_info, get_vm_disks
@@ -82,11 +84,30 @@ class VMStoragesModel(object):
# Path will never be blank due to API.json verification.
# There is no need to cover this case here.
if not ('vol' in params) ^ ('path' in params):
- raise InvalidParameter("KCHVMSTOR0017E")
+ if not is_s390x():
+ raise InvalidParameter("KCHVMSTOR0017E")
+
+ if 'dir_path' not in params:
+ raise InvalidParameter("KCHVMSTOR0019E")
dom = VMModel.get_vm(vm_name, self.conn)
params['bus'] = _get_device_bus(params['type'], dom)
- params['format'] = 'raw'
+
+ if is_s390x() and params['type'] == 'disk':
+ if 'format' not in params:
+ raise InvalidParameter("KCHVMSTOR0020E")
+ if 'dir_path' in params:
+ size = params['size']
+ name = params['name']
+ dir_path = params.get('dir_path')
+ params['path'] = dir_path + "/" + name
+ if os.path.exists(params['path']):
+ raise InvalidParameter("KCHVMSTOR0021E",
+ {'disk_path': params['path']})
+ create_disk_image(format_type=params['format'],
+ path=params['path'], capacity=size)
+ else:
+ params['format'] = 'raw'
dev_list = [dev for dev, bus in get_vm_disks(dom).iteritems()
if bus == params['bus']]
diff --git a/utils.py b/utils.py
index 0fca191..7fdec02 100644
--- a/utils.py
+++ b/utils.py
@@ -305,4 +305,4 @@ def create_disk_image(format_type, path, capacity):
if rc != 0:
raise OperationFailed("KCHTMPL0035E", {'err': err})
- return
\ No newline at end of file
+ return
--
1.9.1
8 years, 3 months
[PATCH V2] Issue #1045 : boot order fix for guest edit
by harshalp@linux.vnet.ibm.com
From: Harshal Patil <harshalp(a)linux.vnet.ibm.com>
This patch sets the cdrom as the first boot device
on s390x arch
Signed-off-by: Harshal Patil <harshalp(a)linux.vnet.ibm.com>
---
vmtemplate.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/vmtemplate.py b/vmtemplate.py
index 07cebb9..b71f947 100644
--- a/vmtemplate.py
+++ b/vmtemplate.py
@@ -392,7 +392,10 @@ class VMTemplate(object):
# Set the boot order of VM
# TODO: need modify this when boot order edition feature came upstream.
- params['boot_order'] = get_bootorder_xml()
+ if cdrom_xml and params.get('arch') == 's390x':
+ params['boot_order'] = get_bootorder_xml(['cdrom', 'hd', 'network'])
+ else:
+ params['boot_order'] = get_bootorder_xml()
# Setting maximum number of memory slots
slots = str(self.info['mem_dev_slots'])
--
2.7.4
8 years, 3 months
[PATCH V2] Issue #1045 : boot order fix for guest edit
by harshalp@linux.vnet.ibm.com
From: Harshal Patil <harshalp(a)linux.vnet.ibm.com>
V1:
This patch sets the cdrom as the first boot device
on s390x arch
V2:
Review comments
Signed-off-by: Harshal Patil <harshalp(a)linux.vnet.ibm.com>
---
vmtemplate.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/vmtemplate.py b/vmtemplate.py
index 07cebb9..b71f947 100644
--- a/vmtemplate.py
+++ b/vmtemplate.py
@@ -392,7 +392,10 @@ class VMTemplate(object):
# Set the boot order of VM
# TODO: need modify this when boot order edition feature came upstream.
- params['boot_order'] = get_bootorder_xml()
+ if cdrom_xml and params.get('arch') == 's390x':
+ params['boot_order'] = get_bootorder_xml(['cdrom', 'hd', 'network'])
+ else:
+ params['boot_order'] = get_bootorder_xml()
# Setting maximum number of memory slots
slots = str(self.info['mem_dev_slots'])
--
2.7.4
8 years, 3 months
[PATCH][Kimchi] Issue #1012: Boot order gets reset to only one entry after editing a VM
by Ramon Medeiros
The comparison 'if "bootorder" or "bootmenu" in params' was always
returning true, beyond this error, the function always remove boot
sequence, without check if the user asked to.
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
model/vms.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/model/vms.py b/model/vms.py
index b889166..f56038d 100644
--- a/model/vms.py
+++ b/model/vms.py
@@ -775,12 +775,12 @@ class VMModel(object):
# get machine type
os = et.find("os")
- # remove old order
- for device in os.findall("boot"):
- os.remove(device)
-
# add new bootorder
if "bootorder" in params:
+
+ # remove old order
+ [os.remove(device) for device in os.findall("boot")]
+
for device in get_bootorder_node(params["bootorder"]):
os.append(device)
@@ -858,7 +858,7 @@ class VMModel(object):
new_xml = self._update_memory_config(new_xml, params, dom)
# update bootorder or bootmenu
- if "bootorder" or "bootmenu" in params:
+ if "bootorder" in params or "bootmenu" in params:
new_xml = self._update_bootorder(new_xml, params)
snapshots_info = []
--
2.5.5
8 years, 3 months