Check-in [7a641a0a0e]
Not logged in
Overview
Comment:Don't try to start spice client if DISPLAY env var doesn't present
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7a641a0a0e3a621147a371d4c59eab85786cd5fd
User & Date: vitus on 2017-01-14 15:33:34
Other Links: manifest | tags
Context
2017-01-14
16:34
Fixed [edb14da425] - remove partially created VM if creation fails check-in: 46aebd7c09 user: vitus tags: trunk
15:33
Don't try to start spice client if DISPLAY env var doesn't present check-in: 7a641a0a0e user: vitus tags: trunk
11:15
Replaced find_free_port with more generic version check-in: 83455d7349 user: vitus tags: trunk
Changes

Modified find_free_port.mkd from [a3a16abd82] to [1efa1a53f7].

22
23
24
25
26
27
28
29
It is written as helper utility for **vws**(1) to search for unused port
where virtual machine can listen for GUI clients.


SEE ALSO
========

**netstat**(8), **vws**(1)







|
22
23
24
25
26
27
28
29
It is written as helper utility for **vws**(1) to search for unused port
where virtual machine can listen for GUI clients.


SEE ALSO
========

**vws**(1), **socket**(2), **bind**(2), **listen**(2)

Modified vws from [b84e336c77] to [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: