def BlockdevConvert(src_disk, target_disk):
  src_dev = _RecursiveFindBD(src_disk)
  if src_dev is None:
    _Fail("Cannot copy from device '%s': device not found", src_disk.uuid)

  dest_dev = _RecursiveFindBD(target_disk)
  if dest_dev is None:
    _Fail("Cannot copy to device '%s': device not found", target_disk.uuid)

  src_cmd = src_dev.Export()
  dest_cmd = dest_dev.Import()
  command = "%s | %s" % (utils.ShellQuoteArgs(src_cmd),
                         utils.ShellQuoteArgs(dest_cmd))

  result = utils.RunCmd(command)
  if result.failed:
    _Fail("Disk conversion command '%s' exited with error: %s; output: %s",
          result.cmd, result.fail_reason, result.output)
Protected access to private member.
dataset/ETHPy150Open ganeti/ganeti/lib/backend.py/BlockdevConvert--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/datastore/appscale_stub_util.py/ListCursor._GetLastResult