Revision 9d9bded1 lib/hypervisor/hv_kvm.py
b/lib/hypervisor/hv_kvm.py | ||
---|---|---|
49 | 49 |
from ganeti import objects |
50 | 50 |
from ganeti import uidpool |
51 | 51 |
from ganeti import ssconf |
52 |
from ganeti.hypervisor import hv_base |
|
53 | 52 |
from ganeti import netutils |
53 |
from ganeti import pathutils |
|
54 |
from ganeti.hypervisor import hv_base |
|
54 | 55 |
from ganeti.utils import wrapper as utils_wrapper |
55 | 56 |
|
56 | 57 |
|
57 |
_KVM_NETWORK_SCRIPT = constants.SYSCONFDIR + "/ganeti/kvm-vif-bridge"
|
|
58 |
_KVM_NETWORK_SCRIPT = pathutils.SYSCONFDIR + "/ganeti/kvm-vif-bridge"
|
|
58 | 59 |
_KVM_START_PAUSED_FLAG = "-S" |
59 | 60 |
|
60 | 61 |
# TUN/TAP driver constants, taken from <linux/if_tun.h> |
... | ... | |
404 | 405 |
""" |
405 | 406 |
CAN_MIGRATE = True |
406 | 407 |
|
407 |
_ROOT_DIR = constants.RUN_DIR + "/kvm-hypervisor"
|
|
408 |
_ROOT_DIR = pathutils.RUN_DIR + "/kvm-hypervisor"
|
|
408 | 409 |
_PIDS_DIR = _ROOT_DIR + "/pid" # contains live instances pids |
409 | 410 |
_UIDS_DIR = _ROOT_DIR + "/uid" # contains instances reserved uids |
410 | 411 |
_CTRL_DIR = _ROOT_DIR + "/ctrl" # contains instances control sockets |
... | ... | |
777 | 778 |
if nic.nicparams[constants.NIC_MODE] == constants.NIC_MODE_BRIDGED: |
778 | 779 |
env["BRIDGE"] = nic.nicparams[constants.NIC_LINK] |
779 | 780 |
|
780 |
result = utils.RunCmd([constants.KVM_IFUP, tap], env=env)
|
|
781 |
result = utils.RunCmd([pathutils.KVM_IFUP, tap], env=env)
|
|
781 | 782 |
if result.failed: |
782 | 783 |
raise errors.HypervisorError("Failed to configure interface %s: %s." |
783 | 784 |
" Network configuration script output: %s" % |
... | ... | |
1195 | 1196 |
if hvp[constants.HV_KVM_SPICE_USE_TLS]: |
1196 | 1197 |
spice_arg = ("%s,tls-port=%s,x509-cacert-file=%s" % |
1197 | 1198 |
(spice_arg, instance.network_port, |
1198 |
constants.SPICE_CACERT_FILE))
|
|
1199 |
pathutils.SPICE_CACERT_FILE))
|
|
1199 | 1200 |
spice_arg = ("%s,x509-key-file=%s,x509-cert-file=%s" % |
1200 |
(spice_arg, constants.SPICE_CERT_FILE,
|
|
1201 |
constants.SPICE_CERT_FILE))
|
|
1201 |
(spice_arg, pathutils.SPICE_CERT_FILE,
|
|
1202 |
pathutils.SPICE_CERT_FILE))
|
|
1202 | 1203 |
tls_ciphers = hvp[constants.HV_KVM_SPICE_TLS_CIPHERS] |
1203 | 1204 |
if tls_ciphers: |
1204 | 1205 |
spice_arg = "%s,tls-ciphers=%s" % (spice_arg, tls_ciphers) |
... | ... | |
1824 | 1825 |
|
1825 | 1826 |
""" |
1826 | 1827 |
if hvparams[constants.HV_SERIAL_CONSOLE]: |
1827 |
cmd = [constants.KVM_CONSOLE_WRAPPER,
|
|
1828 |
cmd = [pathutils.KVM_CONSOLE_WRAPPER,
|
|
1828 | 1829 |
constants.SOCAT_PATH, utils.ShellQuote(instance.name), |
1829 | 1830 |
utils.ShellQuote(cls._InstanceMonitor(instance.name)), |
1830 | 1831 |
"STDIO,%s" % cls._SocatUnixConsoleParams(), |
Also available in: Unified diff