Diff
Not logged in

Differences From Artifact [b84e336c77]:

To Artifact [55b3a303d0]:


166
167
168
169
170
171
172



173
174
175
176
177
178
179
def cmd_spiceuri(options):
    """ vws spiceuri """
    print spiceurl(options.sock)


def cmd_start(options):
    """ vws start """



    if options.stopped:
        arg = ""
        if options.cdrom:
            arg = " -cdrom " + os.path.abspath(options.cdrom[0])
        if options.snapshot:
            arg = arg+" -snapshot"
        if options.args:







>
>
>







166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
def cmd_spiceuri(options):
    """ vws spiceuri """
    print spiceurl(options.sock)


def cmd_start(options):
    """ vws start """
    if not "DISPLAY" in os.environ:
        # If cannot start GUI just don't do it.
        options.gui = False
    if options.stopped:
        arg = ""
        if options.cdrom:
            arg = " -cdrom " + os.path.abspath(options.cdrom[0])
        if options.snapshot:
            arg = arg+" -snapshot"
        if options.args:
207
208
209
210
211
212
213
214
215

216
217
218
219
220
221
222
223
224
225
        if options.snapshot or options.args:
            print >>sys.stderr, ("Cannot change qemu options. " +
                                 "VM is already running")
        if options.cdrom:
            options.file = options.cdrom[0]
            options.id = None
            cmd_cdrom(options)
    if options.gui:
        uri = spiceurl(options.sock)

        os.system((config.get('tools', 'viewer') + "&") % uri)
    elif not options.stopped:
        print >>sys.stderr, "VM already running"

def cmd_stop(options):
    """ vws stop """
    if snapshot_mode(options.sock) or options.hard:
        try:
           send_command(options.sock, 'quit')
        except IOError as e:







<
|
>


|







210
211
212
213
214
215
216

217
218
219
220
221
222
223
224
225
226
227
228
        if options.snapshot or options.args:
            print >>sys.stderr, ("Cannot change qemu options. " +
                                 "VM is already running")
        if options.cdrom:
            options.file = options.cdrom[0]
            options.id = None
            cmd_cdrom(options)

    uri = spiceurl(options.sock)
    if options.gui:
        os.system((config.get('tools', 'viewer') + "&") % uri)
    elif not options.stopped:
        print >>sys.stderr, "VM already running use uri %s" % uri

def cmd_stop(options):
    """ vws stop """
    if snapshot_mode(options.sock) or options.hard:
        try:
           send_command(options.sock, 'quit')
        except IOError as e: