Check-in [47e3e4a17d]
Not logged in
Overview
Comment:Removed files no more planned to develop. Added target to create orig.tar.bz2
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 47e3e4a17d79948d8e5ed95de79bc8c33c6e7be3
User & Date: vitus on 2017-01-14 16:48:16
Other Links: manifest | tags
Context
2017-01-14
17:24
Fixed some typos in make install check-in: 9bbf93f72b user: vitus tags: trunk
16:48
Removed files no more planned to develop. Added target to create orig.tar.bz2 check-in: 47e3e4a17d user: vitus tags: trunk
16:34
Fixed [edb14da425] - remove partially created VM if creation fails check-in: 46aebd7c09 user: vitus tags: trunk
Changes

Modified Makefile from [ce0c122a37] to [e2b0db9972].

28
29
30
31
32
33
34






28
29
30
31
32
33
34
35
36
37
38
39
40







+
+
+
+
+
+
	$(INSTALL) -c -m 755 -o root vws $(DESTDIR)$(bindir)
	
	[ -f $(DESTDIR)$(sysconfdir)/vws.conf ]|| $(INSTALL) -c -m 644 -o root vws.conf $(DESTDIR)$(sysconfdir)
	$(INSTALL) -c -m 644 -o root vws.1 $(DESTDIR)$(mandir)/man1
	$(INSTALL) -c -m 644 -o root find_free_port.1 $(DESTDIR)$(mandir)/man1
	$(INSTALL) -c -m 644 -o root vws.service $(DESTDIR)$(systemddir)
	$(INSTALL) -c -m 644 -o root vws.init $(DESTDIR)$(initddir)/vws

origtarball: vws find_free_port vws.init vws.service.in  Makefile vws.conf vws.mkd find_free_port.mkd
	version=$$(sed -n 's/VERSION = //p' vws); \
	mkdir vws-$$version; cp $+ vws-$$version; \
	tar cjf ../vws_$$version.orig.tar.bz2 vws-$$version; \
	rm -rf vws-$$version

Deleted ask_shutdown version [47a3414444].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

















-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
#!/usr/bin/wish
if {![llength $argv]} {
	puts stderr "Usage $argv0 machinename"
	exit 1
}
set name [lindex $argv 0]
label .top -text "Virtual machine [lindex $argv 0] is still running" -font {serif 20}
frame .buttons 
button .buttons.shutdown -text "Shut down" -command "exec vws shutdown $name
destroy ."
button .buttons.suspend -text "Suspend" -command "exec vws save $name
destroy ."
button .buttons.bgd -text "Run in background" -command "destroy ." -default active
pack .buttons.shutdown .buttons.suspend .buttons.bgd -side left -expand n -padx 20 -pady 10
#.top configure -wraplength [winfo reqwidth .buttons]p
pack .top -side top -expand y -fill x -padx 10 -pady 20
pack .buttons -side top -expand n

Deleted mkvm version [c9b2ef6117].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
















































































































































































-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
#!/usr/bin/python
import os,sys
from snack import SnackScreen,GridForm,Listbox,Entry,Label,Checkbox,Button,RadioBar
bridge="lxc0"
secno=3
macaddr="52:54:00:7d:7f:%02x"%secno
options={'qemubinary':'qemu-system-x86_64',
"accel":"-enable-kvm",
"memory":"1024M",
"drive":"-drive media=disk,index=0,if=virtio,file=drive0.qcow2",
"cdrom":"-drive media=cdrom,index=2,if=ide",
"sound":"-soundhw hda",
"net":"-net nic,macaddr=%s -net bridge,br=%s"%(macaddr,bridge),
"usb":"-usb"}

def choose_conf():
    """
    Selects main machine configuration 
    CPU type, memory size, USB and sound hardware
    """
    archs=['i386','x86_64']
    grid = GridForm(screen,"Setting up a virtual machine",2,5)
    archlabel=Label("CPU architecture")
    archlist=Listbox(height=4,width=20)
    for arch in archs:
        archlist.append(arch,arch)
    archlist.setCurrent(options['qemubinary'][12:])
    memlabel=Label("Memory size")
    memline=Entry(20,text=options['memory'])
    checkusb=Checkbox("Enable USB",isOn=len(options["usb"]))
    checksound=Checkbox("Enable sound",isOn=len(options["sound"]))
    checkkvm=Checkbox("Enable KVM",isOn=len(options['accel']))
    grid.add(archlabel,0,0,padding=(3,1,3,0))
    grid.add(archlist,0,1,padding=(3,0,3,1))
    grid.add(memlabel,1,0,padding=(3,1,3,0))
    grid.add(memline,1,1,padding=(3,0,3,1),anchorTop=1)
    grid.add(checkusb,0,2,padding=(3,1,3,0),anchorLeft=1)
    grid.add(checksound,0,3,padding=(3,0,3,1),anchorLeft=1)
    grid.add(checkkvm,1,2,padding=(3,1,3,1),anchorLeft=1)
    prevbtn=Button("<<Back")
    nextbtn=Button("Next>>")
    grid.add(prevbtn,0,4,anchorLeft=1)
    grid.add(nextbtn,1,4,anchorRight=1)
    answer=grid.runOnce()
    if answer == prevbtn or answer == u'ESC':
        return False
    else:
        if checkusb.value():
            options['usb']='-usb'
        else:
            options['usb']=''
        if checksound.value():
            options['sound']='-soundhw hba'
        else :
            options['sound']=''
        if checkkvm.value():
            options['accel'] = '-enable-kvm'
        else:
            options['accel'] = ''
        options['qemubinary']='qemu-system-'+archlist.current()
        options['memory']=memline.value()   
        return True

def choose_drive():
    """
    Selects storage subsystem to use
    import existing drive, use cdrom,
    connect some image on first run
    """
    grid = GridForm(screen,"Setting up a disk drives",1,5)
    
def mkradiogroup(choices, current):
    """
    choises is an array of value,text tuples
    current is value, which have to be selected
    """
    rg = RadioBar(screen,map(lambda x: (x[1],x[0],1 if x[0]==current else 0),choices) )
    return rg

def net_brige_conf():
    """
    Choose net bridge based on /etc/qemu/bridge.conf"
    """


def choose_net():
    """
    Select network type (bridge, tap or user)
    Select parameters of the choosen network type
    """
    grid = GridForm(screen,"Setting up a virtual networking",2,3)
    typlbl = Label("Network type")
    rg = mkradiogroup([('bridge','Attach to bridge'),
        ('tap','Use TAP device'),
        ('user','User mode networking'),
        ('vde','VDE virtual switch')],
        netmode)
    cardlbl = Label("Emulated hardware")    
    cardbox= Listbox(height=6,width=20,scroll=1)
    grid.add(typlbl,0,0,padding=(3,1,3,0))
    grid.add(rg,0,1,padding=(3,0,3,0))
    grid.add(cardlbl,1,0,padding=(3,1,3,0))
    grid.add(cardbox,1,1,padding=(3,0,3,0))
    prevbtn=Button("<<Back")
    nextbtn=Button("Next>>")
    grid.add(prevbtn,0,2,anchorLeft=1)
    grid.add(nextbtn,1,2,anchorRight=1)
name=''
vmtype='private'
def choose_name():
    """
    Selects name of virtual machine and sharing type
    """
    global name,vmtype
    grid = GridForm(screen,"Choosing name of virtual machine",1,5)
    namelbl=Label("Enter a virtual machine name")
    nameline=Entry(40,text=name)
    shlbl = Label("Select virtual machine accessability")
    rg = mkradiogroup([('private','Private VM'),('shared','Shared VM'),
                ('auto','AutoStart VM')],vmtype)

    grid.add(namelbl,0,0,padding=(3,1,3,0),anchorLeft=1)
    grid.add(nameline,0,1,padding=(3,0,3,0),anchorLeft=1)
    grid.add(shlbl,0,2,padding=(3,1,3,0),anchorLeft=1)
    grid.add(rg,0,3)
    #prevbtn=Button("<<Back")
    nextbtn=Button("Next>>")
    #grid.add(prevbtn,0,4,anchorLeft=1)
    grid.add(nextbtn,0,4,anchorRight=1)
    while not nameline.value():
        answer=grid.runOnce()
        if  answer == u'ESC':
            return False
    name = nameline.value()
    vmtype = rg.getSelection()
    return True

wizard=[choose_name,choose_conf,choose_drive,choose_net,None]    

try:
    screen=SnackScreen()
    i=0
    while i<len(wizard):
        if wizard[i]:
            nxt=wizard[i]()
        else:
            nxt=True
        if callable(nxt):
            wizard[i+1] = nxt
        if nxt:
            i+=1
        else :
            i-=1
        if (i<0):
            sys.exit(1)

finally:
    screen.finish()
with open("start.template","r") as f:
	template=f.read()

vmdir = "~/VWs/%s" % name
print repr(ret)
print repr(options)

sys.exit(1)

os.mkdir(vmdir)
with open(vmdir +"/start",w) as f:
	f.write(template.format(options))
os.chmod(0755,vmdir + "/start")
os.system("qemu-img create -f qcow2 "+vmdir+"/drive0.qcow2")

	


Deleted vwsgui version [e19838553c].

1
2
3
4
5
6
7
8
9
10
11
12












-
-
-
-
-
-
-
-
-
-
-
-
#!/bin/sh
if [ -z "$1" ]; then
	echo "Usage: $0 vm-name"
	exit 1
fi

uri=`vms spiceuri $1`
if [ $? -gt 0 ]; then
	exit 1
fi
spicy $uri </dev/null
vws spiceuri $1 >/dev/null && /usr/lib/vms/ask_shutdown $1