197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
elif nxt == 2 and line.startswith('ID'):
nxt = 1
elif nxt == 1:
nxt = 0
snapshot_id = line[:line.index(' ')]
arg = arg + " -loadvm " + snapshot_id
break
os.system("./start%s" % arg)
os.chdir(cwd)
time.sleep(2)
options.sock = connect_vm(options.dir)
if snapshot_id:
send_command(options.sock, "delvm " + snapshot_id)
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
elif nxt == 2 and line.startswith('ID'):
nxt = 1
elif nxt == 1:
nxt = 0
snapshot_id = line[:line.index(' ')]
arg = arg + " -loadvm " + snapshot_id
break
# Check for correct brige name
try:
os.stat("monitor")
except OSError:
# We cannot find monitor socket. So this machine might be
# never run on this host
f=open("start","r+")
data=f.read()
idx0=data.find("-net bridge,br=")
if idx != -1:
idx=data.find("=",idx)
idx+=1
idx2=data.find(" ",idx)
bridgename=data[idx:idx2]
if not bridgename in list_bridges():
net = config.get("create options","net")
if net== "user":
data=data[:idx0]+"-net user"+data[idx2:]
else:
data=data[:idx]+net+data[idx2:]
f.seek(0)
f.write(data)
f.truncate()
f.close()
os.system("./start%s" % arg)
os.chdir(cwd)
time.sleep(2)
options.sock = connect_vm(options.dir)
if snapshot_id:
send_command(options.sock, "delvm " + snapshot_id)
|