Revision 2876c2d6 lib/hypervisor/hv_xen.py

b/lib/hypervisor/hv_xen.py
89 89
    """Helper function for L{_GetXMList} to run "xm list".
90 90

  
91 91
    """
92
    result = utils.RunCmd(["xm", "list"])
92
    result = utils.RunCmd([constants.XEN_CMD, "list"])
93 93
    if result.failed:
94 94
      logging.error("xm list failed (%s): %s", result.fail_reason,
95 95
                    result.output)
......
185 185

  
186 186
    """
187 187
    self._WriteConfigFile(instance, block_devices)
188
    cmd = ["xm", "create"]
188
    cmd = [constants.XEN_CMD, "create"]
189 189
    if startup_paused:
190 190
      cmd.extend(["--paused"])
191 191
    cmd.extend([instance.name])
......
204 204
      name = instance.name
205 205
    self._RemoveConfigFile(name)
206 206
    if force:
207
      command = ["xm", "destroy", name]
207
      command = [constants.XEN_CMD, "destroy", name]
208 208
    else:
209
      command = ["xm", "shutdown", name]
209
      command = [constants.XEN_CMD, "shutdown", name]
210 210
    result = utils.RunCmd(command)
211 211

  
212 212
    if result.failed:
......
223 223
      raise errors.HypervisorError("Failed to reboot instance %s,"
224 224
                                   " not running" % instance.name)
225 225

  
226
    result = utils.RunCmd(["xm", "reboot", instance.name])
226
    result = utils.RunCmd([constants.XEN_CMD, "reboot", instance.name])
227 227
    if result.failed:
228 228
      raise errors.HypervisorError("Failed to reboot instance %s: %s, %s" %
229 229
                                   (instance.name, result.fail_reason,
......
261 261

  
262 262
    """
263 263
    # note: in xen 3, memory has changed to total_memory
264
    result = utils.RunCmd(["xm", "info"])
264
    result = utils.RunCmd([constants.XEN_CMD, "info"])
265 265
    if result.failed:
266 266
      logging.error("Can't run 'xm info' (%s): %s", result.fail_reason,
267 267
                    result.output)
......
325 325
    For Xen, this verifies that the xend process is running.
326 326

  
327 327
    """
328
    result = utils.RunCmd(["xm", "info"])
328
    result = utils.RunCmd([constants.XEN_CMD, "info"])
329 329
    if result.failed:
330 330
      return "'xm info' failed: %s, %s" % (result.fail_reason, result.output)
331 331

  
......
432 432
      raise errors.HypervisorError("Remote host %s not listening on port"
433 433
                                   " %s, cannot migrate" % (target, port))
434 434

  
435
    args = ["xm", "migrate", "-p", "%d" % port]
435
    args = [constants.XEN_CMD, "migrate", "-p", "%d" % port]
436 436
    if live:
437 437
      args.append("-l")
438 438
    args.extend([instance.name, target])
......
461 461
    try:
462 462
      cls.LinuxPowercycle()
463 463
    finally:
464
      utils.RunCmd(["xm", "debug", "R"])
464
      utils.RunCmd([constants.XEN_CMD, "debug", "R"])
465 465

  
466 466

  
467 467
class XenPvmHypervisor(XenHypervisor):

Also available in: Unified diff