Esempio n. 1
0
    def run(self, status):
        try:
            log.info("Xend Daemon started")

            xc = xen.lowlevel.xc.xc()
            xinfo = xc.xeninfo()
            log.info("Xend changeset: %s.", xinfo['xen_changeset'])
            del xc

            try:
                from xen import VERSION
                log.info("Xend version: %s", VERSION)
            except ImportError:
                log.info("Xend version: Unknown.")

            relocate.listenRelocation()
            servers = SrvServer.create()
            servers.start(status)
            del servers
            
        except Exception, ex:
            print >>sys.stderr, 'Exception starting xend:', ex
            if XEND_DEBUG:
                traceback.print_exc()
            log.exception("Exception starting xend (%s)" % ex)
            if status:
                status.write('1')
                status.close()
            sys.exit(1)
Esempio n. 2
0
    def configure(self, vmConfig):
        ImageHandler.configure(self, vmConfig)

        self.loader = vmConfig['platform'].get('loader')

        info = xc.xeninfo()
        if 'hvm' not in info['xen_caps']:
            raise HVMRequired()

        rtc_timeoffset = vmConfig['platform'].get('rtc_timeoffset')

        self.vm.storeVm(("image/dmargs", " ".join(self.dmargs)),
                        ("image/device-model", self.device_model),
                        ("image/display", self.display))
        self.vm.permissionsVm("image/dmargs", {
            'dom': self.vm.getDomid(),
            'read': True
        })
        self.vm.storeVm(("rtc/timeoffset", rtc_timeoffset))
        self.vm.permissionsVm("rtc/timeoffset", {
            'dom': self.vm.getDomid(),
            'read': True
        })

        self.apic = int(vmConfig['platform'].get('apic', 0))
        self.acpi = int(vmConfig['platform'].get('acpi', 0))
        self.guest_os_type = vmConfig['platform'].get('guest_os_type')
Esempio n. 3
0
    def run(self, status):
        try:
            log.info("Xend Daemon started")

            xc = xen.lowlevel.xc.xc()
            xinfo = xc.xeninfo()
            log.info("Xend changeset: %s.", xinfo['xen_changeset'])
            del xc

            try:
                from xen import VERSION
                log.info("Xend version: %s", VERSION)
            except ImportError:
                log.info("Xend version: Unknown.")

            relocate.listenRelocation()
            servers = SrvServer.create()
            servers.start(status)
            del servers

        except Exception, ex:
            print >> sys.stderr, 'Exception starting xend:', ex
            if XEND_DEBUG:
                traceback.print_exc()
            log.exception("Exception starting xend (%s)" % ex)
            if status:
                status.write('1')
                status.close()
            sys.exit(1)
Esempio n. 4
0
    def configure(self, imageConfig, deviceConfig):
        ImageHandler.configure(self, imageConfig, deviceConfig)

        info = xc.xeninfo()
        if not 'hvm' in info['xen_caps']:
            raise VmError("Not an HVM capable platform, we stop creating!")

        self.dmargs = self.parseDeviceModelArgs(imageConfig, deviceConfig)
        self.device_model = sxp.child_value(imageConfig, 'device_model')
        if not self.device_model:
            raise VmError("hvm: missing device model")
        self.display = sxp.child_value(imageConfig, 'display')
        self.xauthority = sxp.child_value(imageConfig, 'xauthority')

        self.vm.storeVm(("image/dmargs", " ".join(self.dmargs)),
                        ("image/device-model", self.device_model),
                        ("image/display", self.display))

        self.pid = 0

        self.dmargs += self.configVNC(imageConfig)

        self.pae  = int(sxp.child_value(imageConfig, 'pae', 0))

        self.acpi = int(sxp.child_value(imageConfig, 'acpi', 0))
        self.apic = int(sxp.child_value(imageConfig, 'apic', 0))
Esempio n. 5
0
    def configure(self, vmConfig):
        ImageHandler.configure(self, vmConfig)

        self.loader = vmConfig['platform'].get('loader')

        info = xc.xeninfo()
        if 'hvm' not in info['xen_caps']:
            raise HVMRequired()

        xen_platform_pci = int(vmConfig['platform'].get('xen_platform_pci', 1))
        rtc_timeoffset = vmConfig['platform'].get('rtc_timeoffset')

        if not self.display:
            self.display = ''

        store_dmargs = [
            x for x in self.dmargs if x not in ['-sdl', '-disable-opengl']
        ]
        try:
            midx = store_dmargs.index('-monitor')
            store_dmargs[midx + 1] = 'pty'
        except ValueError:
            pass
        self.vm.storeVm(("image/dmargs", " ".join(store_dmargs)),
                        ("image/device-model", self.device_model),
                        ("image/display", self.display))
        self.vm.permissionsVm("image/dmargs", {
            'dom': self.vm.getDomid(),
            'read': True
        })

        if xen_platform_pci == 0:
            disable_pf = 1
            log.info("No need to create platform device.[domid:%d]",
                     self.vm.getDomid())
        else:
            disable_pf = 0
            log.info("Need to create platform device.[domid:%d]",
                     self.vm.getDomid())

        xstransact.Store(
            "/local/domain/0/device-model/%i" % self.vm.getDomid(),
            ('disable_pf', disable_pf))
        self.vm.storeVm(("rtc/timeoffset", rtc_timeoffset))
        self.vm.permissionsVm("rtc/timeoffset", {
            'dom': self.vm.getDomid(),
            'read': True
        })

        self.apic = int(vmConfig['platform'].get('apic', 0))
        self.acpi = int(vmConfig['platform'].get('acpi', 0))
        self.guest_os_type = vmConfig['platform'].get('guest_os_type')
        self.memory_sharing = int(vmConfig['memory_sharing'])
        try:
            xc.dom_set_memshr(self.vm.getDomid(), self.memory_sharing)
        except:
            pass
Esempio n. 6
0
    def configure(self, vmConfig):
        ImageHandler.configure(self, vmConfig)

        self.loader = vmConfig['platform'].get('loader')

        info = xc.xeninfo()
        if 'hvm' not in info['xen_caps']:
            raise HVMRequired()

        xen_platform_pci = int(vmConfig['platform'].get('xen_platform_pci',1))
        rtc_timeoffset = vmConfig['platform'].get('rtc_timeoffset')

        if not self.display :
            self.display = ''

        store_dmargs = [ x for x in self.dmargs
                         if x not in ['-sdl', '-disable-opengl'] ]
        try :
            midx = store_dmargs.index('-monitor')
            store_dmargs[midx + 1] = 'pty'
        except ValueError :
            pass
        self.vm.storeVm(("image/dmargs", " ".join(store_dmargs)),
                        ("image/device-model", self.device_model),
                        ("image/display", self.display))
        self.vm.permissionsVm("image/dmargs", { 'dom': self.vm.getDomid(), 'read': True } )

        if xen_platform_pci == 0:
            disable_pf = 1
            log.info("No need to create platform device.[domid:%d]", self.vm.getDomid())
        else:
            disable_pf = 0
            log.info("Need to create platform device.[domid:%d]", self.vm.getDomid())

        xstransact.Store("/local/domain/0/device-model/%i"%self.vm.getDomid(),
                                      ('disable_pf', disable_pf))
        self.vm.storeVm(("rtc/timeoffset", rtc_timeoffset))
        self.vm.permissionsVm("rtc/timeoffset", { 'dom': self.vm.getDomid(), 'read': True } )

        self.apic = int(vmConfig['platform'].get('apic', 0))
        self.acpi = int(vmConfig['platform'].get('acpi', 0))
        self.extid = int(vmConfig['platform'].get('extid', 0))
        self.guest_os_type = vmConfig['platform'].get('guest_os_type')
        self.memory_sharing = int(vmConfig['memory_sharing'])
        try:
            xc.dom_set_memshr(self.vm.getDomid(), self.memory_sharing)
        except:
            pass
Esempio n. 7
0
    def configure(self, vmConfig):
        ImageHandler.configure(self, vmConfig)

        self.loader = vmConfig["platform"].get("loader")

        info = xc.xeninfo()
        if "hvm" not in info["xen_caps"]:
            raise HVMRequired()

        xen_platform_pci = int(vmConfig["platform"].get("xen_platform_pci", 1))
        rtc_timeoffset = vmConfig["platform"].get("rtc_timeoffset")

        if not self.display:
            self.display = ""

        store_dmargs = [x for x in self.dmargs if x not in ["-sdl", "-disable-opengl"]]
        try:
            midx = store_dmargs.index("-monitor")
            store_dmargs[midx + 1] = "pty"
        except ValueError:
            pass
        self.vm.storeVm(
            ("image/dmargs", " ".join(store_dmargs)),
            ("image/device-model", self.device_model),
            ("image/display", self.display),
        )
        self.vm.permissionsVm("image/dmargs", {"dom": self.vm.getDomid(), "read": True})

        if xen_platform_pci == 0:
            disable_pf = 1
            log.info("No need to create platform device.[domid:%d]", self.vm.getDomid())
        else:
            disable_pf = 0
            log.info("Need to create platform device.[domid:%d]", self.vm.getDomid())

        xstransact.Store("/local/domain/0/device-model/%i" % self.vm.getDomid(), ("disable_pf", disable_pf))
        self.vm.storeVm(("rtc/timeoffset", rtc_timeoffset))
        self.vm.permissionsVm("rtc/timeoffset", {"dom": self.vm.getDomid(), "read": True})

        self.apic = int(vmConfig["platform"].get("apic", 0))
        self.acpi = int(vmConfig["platform"].get("acpi", 0))
        self.guest_os_type = vmConfig["platform"].get("guest_os_type")
        self.memory_sharing = int(vmConfig["memory_sharing"])
        try:
            xc.dom_set_memshr(self.vm.getDomid(), self.memory_sharing)
        except:
            pass
Esempio n. 8
0
    def configure(self, vmConfig):
        ImageHandler.configure(self, vmConfig)

        if not self.kernel:
            self.kernel = '/usr/lib/xen/boot/hvmloader'

        info = xc.xeninfo()
        if 'hvm' not in info['xen_caps']:
            raise HVMRequired()

        rtc_timeoffset = vmConfig['platform'].get('rtc_timeoffset')

        self.vm.storeVm(("image/dmargs", " ".join(self.dmargs)),
                        ("image/device-model", self.device_model),
                        ("image/display", self.display))
        self.vm.storeVm(("rtc/timeoffset", rtc_timeoffset))

        self.apic = int(vmConfig['platform'].get('apic', 0))
        self.acpi = int(vmConfig['platform'].get('acpi', 0))
        self.guest_os_type = vmConfig['platform'].get('guest_os_type')
Esempio n. 9
0
    def configure(self, vmConfig):
        ImageHandler.configure(self, vmConfig)

        if not self.kernel:
            self.kernel = '/usr/lib/xen/boot/hvmloader'

        info = xc.xeninfo()
        if 'hvm' not in info['xen_caps']:
            raise HVMRequired()

        rtc_timeoffset = vmConfig['platform'].get('rtc_timeoffset')

        self.vm.storeVm(("image/dmargs", " ".join(self.dmargs)),
                        ("image/device-model", self.device_model),
                        ("image/display", self.display))
        self.vm.storeVm(("rtc/timeoffset", rtc_timeoffset))

        self.apic = int(vmConfig['platform'].get('apic', 0))
        self.acpi = int(vmConfig['platform'].get('acpi', 0))
        self.guest_os_type = vmConfig['platform'].get('guest_os_type')
Esempio n. 10
0
    def configure(self, vmConfig):
        ImageHandler.configure(self, vmConfig)

        self.loader = vmConfig['platform'].get('loader')

        info = xc.xeninfo()
        if 'hvm' not in info['xen_caps']:
            raise HVMRequired()

        rtc_timeoffset = vmConfig['platform'].get('rtc_timeoffset')

        self.vm.storeVm(("image/dmargs", " ".join(self.dmargs)),
                        ("image/device-model", self.device_model),
                        ("image/display", self.display))
        self.vm.permissionsVm("image/dmargs", { 'dom': self.vm.getDomid(), 'read': True } )
        self.vm.storeVm(("rtc/timeoffset", rtc_timeoffset))
        self.vm.permissionsVm("rtc/timeoffset", { 'dom': self.vm.getDomid(), 'read': True } )

        self.apic = int(vmConfig['platform'].get('apic', 0))
        self.acpi = int(vmConfig['platform'].get('acpi', 0))
        self.guest_os_type = vmConfig['platform'].get('guest_os_type')
Esempio n. 11
0
    def configure(self, vmConfig):
        ImageHandler.configure(self, vmConfig)

        self.loader = vmConfig['platform'].get('loader')

        info = xc.xeninfo()
        if 'hvm' not in info['xen_caps']:
            raise HVMRequired()

        xen_platform_pci = int(vmConfig['platform'].get('xen_platform_pci',1))
        rtc_timeoffset = vmConfig['platform'].get('rtc_timeoffset')

        if not self.display :
            self.display = ''
        # Do not store sdl, opengl and serial related qemu cli options
        self.vm.storeVm(("image/dmargs", " ".join([ x for x in self.dmargs
                        if x != "-sdl"
                        and x != "-disable-opengl"
                        and x != "-serial"
                        and x != "pty" ])),
                        ("image/device-model", self.device_model),
                        ("image/display", self.display))
        self.vm.permissionsVm("image/dmargs", { 'dom': self.vm.getDomid(), 'read': True } )

        if xen_platform_pci == 0:
            disable_pf = 1
            log.info("No need to create platform device.[domid:%d]", self.vm.getDomid())
        else:
            disable_pf = 0
            log.info("Need to create platform device.[domid:%d]", self.vm.getDomid())

        xstransact.Store("/local/domain/0/device-model/%i"%self.vm.getDomid(),
                                      ('disable_pf', disable_pf))
        self.vm.storeVm(("rtc/timeoffset", rtc_timeoffset))
        self.vm.permissionsVm("rtc/timeoffset", { 'dom': self.vm.getDomid(), 'read': True } )

        self.apic = int(vmConfig['platform'].get('apic', 0))
        self.acpi = int(vmConfig['platform'].get('acpi', 0))
        self.guest_os_type = vmConfig['platform'].get('guest_os_type')
Esempio n. 12
0
    def run(self, status):
        try:
            log.info("Xend Daemon started")

            xc = xen.lowlevel.xc.xc()
            xinfo = xc.xeninfo()
            log.info("Xend changeset: %s.", xinfo['xen_changeset'])
            del xc

            relocate.listenRelocation()
            udevevent.listenUdevEvent()
            servers = SrvServer.create()
            servers.start(status)
            del servers

        except Exception, ex:
            print >> sys.stderr, 'Exception starting xend:', ex
            if XEND_DEBUG:
                traceback.print_exc()
            log.exception("Exception starting xend (%s)" % ex)
            if status:
                status.write('1')
                status.close()
            sys.exit(1)
Esempio n. 13
0
	def run(self, status):
		try:
			log.info("Xend Daemon started")

			xc = xen.lowlevel.xc.xc()
			xinfo = xc.xeninfo()
			log.info("Xend changeset: %s.", xinfo['xen_changeset'])
			del xc

			relocate.listenRelocation()
			udevevent.listenUdevEvent()
			servers = SrvServer.create()
			servers.start(status)
			del servers
			
		except Exception, ex:
			print >>sys.stderr, 'Exception starting xend:', ex
			if XEND_DEBUG:
				traceback.print_exc()
			log.exception("Exception starting xend (%s)" % ex)
			if status:
				status.write('1')
				status.close()
			sys.exit(1)
Esempio n. 14
0
'''

    bugball = []

    xc = xen.lowlevel.xc.xc()

    def do(n, f):
        try:
            s = f()
        except Exception, exn:
            s = str(exn)
        bugball.append(string_iterator(n, s))

    do('xen-dmesg', lambda: xc.readconsolering())
    do('physinfo', lambda: prettyDict(xc.physinfo()))
    do('xeninfo', lambda: prettyDict(xc.xeninfo()))

    for filename in FILES_TO_SEND:
        if not os.path.exists(filename):
            continue

        if yes('Include %s? [Y/n] ' % filename):
            bugball.append(file(filename))

    maybeAttach(bugball)

    if (yes('''
Do you wish to save these details as a tarball (.tar.bz2)? [Y/n] ''')):
        tar(bugball)

    return 0
Esempio n. 15
0
'''
    
    bugball = []

    xc = xen.lowlevel.xc.xc()

    def do(n, f):
        try:
            s = f()
        except Exception, exn:
            s = str(exn)
        bugball.append(string_iterator(n, s))

    do('xen-dmesg', lambda: xc.readconsolering())
    do('physinfo',  lambda: prettyDict(xc.physinfo()))
    do('xeninfo',   lambda: prettyDict(xc.xeninfo()))

    for filename in FILES_TO_SEND:
        if not os.path.exists(filename):
            continue

        if yes('Include %s? [Y/n] ' % filename):
            bugball.append(file(filename))

    maybeAttach(bugball)

    if (yes('''
Do you wish to save these details as a tarball (.tar.bz2)? [Y/n] ''')):
        tar(bugball)

    return 0