Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -30,5 +30,11 @@ [ -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 Index: ask_shutdown ================================================================== --- ask_shutdown +++ ask_shutdown @@ -1,17 +0,0 @@ -#!/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 Index: mkvm ================================================================== --- mkvm +++ mkvm @@ -1,176 +0,0 @@ -#!/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("<>") - 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("<>") - 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("<>") - #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/dev/null && /usr/lib/vms/ask_shutdown $1