Revision cacfd1fd

b/lib/backend.py
1248 1248
  @return: the success of the operation
1249 1249

  
1250 1250
  """
1251
  msgs = []
1251 1252
  r_dev = _RecursiveFindBD(disk)
1252 1253
  if r_dev is not None:
1253 1254
    r_path = r_dev.dev_path
1254
    result = r_dev.Shutdown()
1255
    try:
1256
      result = r_dev.Shutdown()
1257
    except errors.BlockDeviceError, err:
1258
      msgs.append(str(err))
1259
      result = False
1255 1260
    if result:
1256 1261
      DevCacheManager.RemoveCache(r_path)
1257 1262
  else:
1258 1263
    result = True
1259 1264
  if disk.children:
1260 1265
    for child in disk.children:
1261
      result = result and BlockdevShutdown(child)
1262
  return result
1266
      c_status, c_msg = BlockdevShutdown(child)
1267
      result = result and c_status
1268
      if c_msg: # not an empty message
1269
        msgs.append(c_msg)
1270
  return (result, "; ".join(msgs))
1263 1271

  
1264 1272

  
1265 1273
def BlockdevAddchildren(parent_cdev, new_cdevs):
b/lib/cmdlib.py
2572 2572
  ignored.
2573 2573

  
2574 2574
  """
2575
  result = True
2575
  all_result = True
2576 2576
  for disk in instance.disks:
2577 2577
    for node, top_disk in disk.ComputeNodeTree(instance.primary_node):
2578 2578
      lu.cfg.SetDiskID(top_disk, node)
2579 2579
      result = lu.rpc.call_blockdev_shutdown(node, top_disk)
2580
      if result.failed or not result.data:
2581
        logging.error("Could not shutdown block device %s on node %s",
2582
                      disk.iv_name, node)
2580
      msg = result.RemoteFailMsg()
2581
      if msg:
2582
        lu.LogWarning("Could not shutdown block device %s on node %s: %s",
2583
                      disk.iv_name, node, msg)
2583 2584
        if not ignore_primary or node != instance.primary_node:
2584
          result = False
2585
  return result
2585
          all_result = False
2586
  return all_result
2586 2587

  
2587 2588

  
2588 2589
def _CheckNodeFreeMemory(lu, node, reason, requested, hypervisor_name):
......
5197 5198
      # we have new devices, shutdown the drbd on the old secondary
5198 5199
      info("shutting down drbd for disk/%d on old node" % idx)
5199 5200
      cfg.SetDiskID(dev, old_node)
5200
      result = self.rpc.call_blockdev_shutdown(old_node, dev)
5201
      if result.failed or not result.data:
5202
        warning("Failed to shutdown drbd for disk/%d on old node" % idx,
5201
      msg = self.rpc.call_blockdev_shutdown(old_node, dev).RemoteFailMsg()
5202
      if msg:
5203
        warning("Failed to shutdown drbd for disk/%d on old node: %s" %
5204
                (idx, msg),
5203 5205
                hint="Please cleanup this device manually as soon as possible")
5204 5206

  
5205 5207
    info("detaching primary drbds from the network (=> standalone)")

Also available in: Unified diff