• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright 2007 Google Inc. Released under the GPL v2
3
4"""
5This module defines the Host class.
6
7Implementation details:
8You should import the "hosts" package instead of importing each type of host.
9
10        KVMGuest: a KVM virtual machine on which you can run programs
11"""
12
13__author__ = """
14mbligh@google.com (Martin J. Bligh),
15poirier@google.com (Benjamin Poirier),
16stutsman@google.com (Ryan Stutsman)
17"""
18
19
20import guest
21
22
23class KVMGuest(guest.Guest):
24    """This class represents a KVM virtual machine on which you can run
25    programs.
26
27    Implementation details:
28    This is a leaf class in an abstract class hierarchy, it must
29    implement the unimplemented methods in parent classes.
30    """
31
32    def _init(self, controlling_hypervisor, qemu_options, *args, **dargs):
33        """
34        Construct a KVMGuest object
35
36        Args:
37                controlling_hypervisor: hypervisor object that is
38                        responsible for the creation and management of
39                        this guest
40                qemu_options: options to pass to qemu, these should be
41                        appropriately shell escaped, if need be.
42        """
43        hostname= controlling_hypervisor.new_guest(qemu_options)
44        # bypass Guest's __init__
45        super(KVMGuest, self)._initialize(hostname, *args, **dargs)
46        self.controlling_hypervisor= controlling_hypervisor
47