[gnome-boxes/gnome-3-12] vm-creator: Ensure VM name is <= 15 characters long
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/gnome-3-12] vm-creator: Ensure VM name is <= 15 characters long
- Date: Thu, 15 May 2014 23:59:23 +0000 (UTC)
commit 21e6a70d408ebb9249cac3f297835b15c73288c4
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed May 14 20:51:46 2014 +0100
vm-creator: Ensure VM name is <= 15 characters long
Commit 4dd0b75 put variant id into the VM names (and therefore
hostnames) to make it more likely to assign a meaningful name to VMs but
it also broke express installation for OSs with variants name that are
long and have very strict restrictions on number of characters in
hostnames, e.g win7 professional.
This patch fixes express installation of such OSes by ensuring that VM
name is not longer than 15 characters.
src/vm-creator.vala | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/vm-creator.vala b/src/vm-creator.vala
index 6d8cbfa..06ce5a9 100644
--- a/src/vm-creator.vala
+++ b/src/vm-creator.vala
@@ -233,6 +233,10 @@ private class Boxes.VMCreator {
return config;
}
+ // Ensure name is less than 12 characters as its also used as the hostname of the guest OS in case of
+ // express installation and some OSes (you know who you are) don't like hostnames with more than 15
+ // characters (we later add a '-' and a number to the name if name is not unique so we leave 3 characters
+ // or that).
protected virtual void create_domain_base_name_and_title (out string base_name, out string base_title) {
base_title = install_media.label;
if (install_media.os != null) {
@@ -244,6 +248,9 @@ private class Boxes.VMCreator {
// FIXME: Assuming first variant only from multivariant medias.
base_name += "-" + variants.get_nth (0).id;
}
+
+ if (base_name.length > 12)
+ base_name = base_name[0:12];
} else
base_name = "boxes-unknown";
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]