<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">I find the situation that there is no
network doesn't exist.<br>
<br>
There should be at least one network named "default", and it
should not be deleted.<br>
When starting up kimchi, it will check if the "default" network
exists or not, if not, it will <br>
create a network named "default".<br>
<br>
The current problem is that the "default" network can be deleted,
it's a issue.<br>
In my testcase, I delete all networks including "default", and
then create several network <br>
not named "default", and restart kimchi, it will throw errors as
following:<br>
<span style="color: rgb(51, 51, 51); font-family: Helvetica,
arial, freesans, clean, sans-serif; font-size: 13px; font-style:
normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: 22px; orphans: auto;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(251, 251,
251); display: inline !important; float: none;">libvirt: Network
Driver error : Network not found: no network with matching name
'default'</span><br style="color: rgb(51, 51, 51); font-family:
Helvetica, arial, freesans, clean, sans-serif; font-size: 13px;
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: 22px; orphans: auto;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(251, 251,
251);">
<span style="color: rgb(51, 51, 51); font-family: Helvetica,
arial, freesans, clean, sans-serif; font-size: 13px; font-style:
normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: 22px; orphans: auto;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(251, 251,
251); display: inline !important; float: none;">libvirt: Network
Driver error : internal error: bridge name 'virbr0' already in
use.</span><br style="color: rgb(51, 51, 51); font-family:
Helvetica, arial, freesans, clean, sans-serif; font-size: 13px;
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: 22px; orphans: auto;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(251, 251,
251);">
<span style="color: rgb(51, 51, 51); font-family: Helvetica,
arial, freesans, clean, sans-serif; font-size: 13px; font-style:
normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: 22px; orphans: auto;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(251, 251,
251); display: inline !important; float: none;">[13/Jan/2014:10:37:05]
Fatal: Cannot create default network because of internal error:
bridge name 'virbr0' already in use., exit kimchid</span><br>
I have submitted this issue <a
href="https://github.com/kimchi-project/kimchi/issues/302">https://github.com/kimchi-project/kimchi/issues/302</a>.<br>
<br>
On 1/9/2014 2:46 AM, Aline Manera wrote:<br>
</div>
<blockquote cite="mid:52CD9CFA.8000503@linux.vnet.ibm.com"
type="cite">
<br>
Only one point that I've just noticed
<br>
When there is no network you should also remove the label
"Network" or add a link to "Add network" page
<br>
<br>
On 01/08/2014 04:26 PM, Aline Manera wrote:
<br>
<blockquote type="cite">
<br>
Reviewed-by: Aline Manera <a class="moz-txt-link-rfc2396E" href="mailto:alinefm@linux.vnet.ibm.com"><alinefm@linux.vnet.ibm.com></a>
<br>
<br>
On 01/08/2014 06:35 AM, Xin Ding wrote:
<br>
<blockquote type="cite">V1 ->V2 use combo box
<br>
<br>
Add network to edit Template.
<br>
<br>
Signed-off-by: Xin Ding <a class="moz-txt-link-rfc2396E" href="mailto:xinding@linux.vnet.ibm.com"><xinding@linux.vnet.ibm.com></a>
<br>
---
<br>
ui/css/theme-default/template-edit.css | 34
+++++++++++++++++++++++++++++++++-
<br>
ui/js/src/kimchi.template_edit_main.js | 29
+++++++++++++++++++++++++++++
<br>
ui/pages/template-edit.html.tmpl | 21
+++++++++++++++++++--
<br>
3 files changed, 81 insertions(+), 3 deletions(-)
<br>
<br>
diff --git a/ui/css/theme-default/template-edit.css
b/ui/css/theme-default/template-edit.css
<br>
index e61b2fb..ecc9106 100644
<br>
--- a/ui/css/theme-default/template-edit.css
<br>
+++ b/ui/css/theme-default/template-edit.css
<br>
@@ -20,7 +20,7 @@
<br>
*/
<br>
#template-edit-window {
<br>
font-size: 13px;
<br>
- height: 400px;
<br>
+ height: 420px;
<br>
width: 1000px;
<br>
}
<br>
<br>
@@ -73,3 +73,35 @@
<br>
.hidden-area {
<br>
display: none;
<br>
}
<br>
+
<br>
+.template-edit-wrapper-controls .select-list-box {
<br>
+ width: 272px;
<br>
+ max-height: 168px;
<br>
+ overflow: auto;
<br>
+ margin-top: 5px;
<br>
+ border: 1px solid #ccc;
<br>
+}
<br>
+
<br>
+.template-edit-wrapper-controls
.select-list-box>li>label {
<br>
+ display: block;
<br>
+}
<br>
+
<br>
+.template-edit-wrapper-controls
.select-list-box>li>label>input[type="checkbox"] {
<br>
+ display: none;
<br>
+}
<br>
+
<br>
+.template-edit-wrapper-controls
.select-list-box>li>label>.item {
<br>
+ display: block;
<br>
+ height: 41px;
<br>
+ line-height: 41px;
<br>
+ padding: 0 20px 0 40px;
<br>
+ border-bottom: 1px solid #ccc;
<br>
+ box-shadow: 0px 1px 1px #fff;
<br>
+ text-shadow: -1px -1px 1px #ddd, 1px 1px 1px #fff;
<br>
+ color: #222;
<br>
+ font-size: 12px;
<br>
+}
<br>
+
<br>
+.template-edit-wrapper-controls
.select-list-box>li>label>input[type="checkbox"]:CHECKED+.item
{
<br>
+ background: #f8f8f8
url(../images/theme-default/check-green.png) no-repeat 10px
center;
<br>
+}
<br>
diff --git a/ui/js/src/kimchi.template_edit_main.js
b/ui/js/src/kimchi.template_edit_main.js
<br>
index efe4a6f..ad535ee 100644
<br>
--- a/ui/js/src/kimchi.template_edit_main.js
<br>
+++ b/ui/js/src/kimchi.template_edit_main.js
<br>
@@ -43,6 +43,26 @@ kimchi.template_edit_main = function() {
<br>
}
<br>
kimchi.select('template-edit-storagePool-list',
options);
<br>
});
<br>
+ kimchi.listNetworks(function(result) {
<br>
+ if(result && result.length > 0) {
<br>
+ var html = '';
<br>
+ var tmpl = $('#tmpl-network').html();
<br>
+ $.each(result, function(index, network) {
<br>
+ html += kimchi.template(tmpl, network);
<br>
+ });
<br>
+ $('#template-edit-network-list').html(html).show();
<br>
+ if(template.networks &&
template.networks.length > 0) {
<br>
+ $('input[name="networks"]',
templateEditForm).each(function(index, element) {
<br>
+ var value = $(element).val();
<br>
+ if(template.networks.indexOf(value)
>= 0) {
<br>
+ $(element).prop('checked', true);
<br>
+ }
<br>
+ });
<br>
+ }
<br>
+ } else {
<br>
+ $('#template-edit-network-list').hide();
<br>
+ }
<br>
+ });
<br>
});
<br>
<br>
$('#tmpl-edit-button-cancel').on('click', function() {
<br>
@@ -64,6 +84,15 @@ kimchi.template_edit_main = function() {
<br>
});
<br>
data['memory'] = Number(data['memory']);
<br>
data['cpus'] = Number(data['cpus']);
<br>
+ var networks =
templateEditForm.serializeObject().networks;
<br>
+ if (networks instanceof Array) {
<br>
+ data.networks = networks;
<br>
+ } else if (networks != null) {
<br>
+ data.networks = [networks];
<br>
+ } else {
<br>
+ data.networks = [];
<br>
+ }
<br>
+
<br>
kimchi.updateTemplate($('#template-name').val(),
data, function() {
<br>
kimchi.doListTemplates();
<br>
kimchi.window.close();
<br>
diff --git a/ui/pages/template-edit.html.tmpl
b/ui/pages/template-edit.html.tmpl
<br>
index fe7314d..f7921d6 100644
<br>
--- a/ui/pages/template-edit.html.tmpl
<br>
+++ b/ui/pages/template-edit.html.tmpl
<br>
@@ -75,8 +75,6 @@
<br>
<input
id="template-edit-memory-textbox" name="memory" type="text"
/>
<br>
</div>
<br>
</div>
<br>
- </fieldset>
<br>
- <fieldset class="template-edit-fieldset">
<br>
<div>
<br>
<div
class="template-edit-wrapper-label">
<br>
<label>$_("Disk
(GB)")</label>
<br>
@@ -85,6 +83,8 @@
<br>
<input
id="template-edit-version-textbox" name="disks" type="text"
/>
<br>
</div>
<br>
</div>
<br>
+ </fieldset>
<br>
+ <fieldset class="template-edit-fieldset">
<br>
<div>
<br>
<div
class="template-edit-wrapper-label">
<br>
<label>$_("CDROM")</label>
<br>
@@ -108,6 +108,23 @@
<br>
</div>
<br>
</div>
<br>
</div>
<br>
+ <div>
<br>
+ <div
class="template-edit-wrapper-label">
<br>
+ <label>$_("Network")</label>
<br>
+ </div>
<br>
+ <div
class="template-edit-wrapper-controls">
<br>
+ <ul class="select-list-box"
id="template-edit-network-list">
<br>
+ </ul>
<br>
+ <script id="tmpl-network"
type="text/html">
<br>
+ <li>
<br>
+ <label>
<br>
+ <input name="networks"
type="checkbox" value="{name}" />
<br>
+ <span
class="item">{name}</span>
<br>
+ </label>
<br>
+ </li>
<br>
+ </script>
<br>
+ </div>
<br>
+ </div>
<br>
</fieldset>
<br>
</form>
<br>
</div>
<br>
</blockquote>
<br>
_______________________________________________
<br>
Kimchi-devel mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>