Revision bbc4783a

b/lib/backend.py
1550 1550
  except Exception, err:  # pylint: disable=W0703
1551 1551
    _Fail("Failed to get migration status: %s", err, exc=True)
1552 1552

  
1553
def HotAddDisk(instance, disk, dev_path, seq):
1554
  """Hot add a nic
1555

  
1556
  """
1557
  hyper = hypervisor.GetHypervisor(instance.hypervisor)
1558
  return hyper.HotAddDisk(instance, disk, dev_path, seq)
1559

  
1560
def HotDelDisk(instance, disk, seq):
1561
  """Hot add a nic
1562

  
1563
  """
1564
  hyper = hypervisor.GetHypervisor(instance.hypervisor)
1565
  return hyper.HotDelDisk(instance, disk, seq)
1566

  
1567
def HotAddNic(instance, nic, seq):
1568
  """Hot add a nic
1569

  
1570
  """
1571
  hyper = hypervisor.GetHypervisor(instance.hypervisor)
1572
  return hyper.HotAddNic(instance, nic, seq)
1573

  
1574
def HotDelNic(instance, nic, seq):
1575
  """Hot add a nic
1576

  
1577
  """
1578
  hyper = hypervisor.GetHypervisor(instance.hypervisor)
1579
  return hyper.HotDelNic(instance, nic, seq)
1580

  
1553 1581

  
1554 1582
def BlockdevCreate(disk, size, owner, on_primary, info, excl_stor):
1555 1583
  """Creates a block device for an instance.
b/lib/rpc_defs.py
283 283
    ("reinstall", None, None),
284 284
    ("debug", None, None),
285 285
    ], None, None, "Starts an instance"),
286
  ("hot_add_nic", SINGLE, None, constants.RPC_TMO_NORMAL, [
287
    ("instance", ED_INST_DICT, "Instance object"),
288
    ("nic", ED_NIC_DICT, "Nic dict to hotplug"),
289
    ("seq", None, "Nic seq to hotplug"),
290
    ], None, None, "Adds a nic to a running instance"),
291
  ("hot_del_nic", SINGLE, None, constants.RPC_TMO_NORMAL, [
292
    ("instance", ED_INST_DICT, "Instance object"),
293
    ("nic", ED_NIC_DICT, "nic dict to remove"),
294
    ("seq", None, "Nic seq to hotplug"),
295
    ], None, None, "Removes a nic to a running instance"),
296
  ("hot_add_disk", SINGLE, None, constants.RPC_TMO_NORMAL, [
297
    ("instance", ED_INST_DICT, "Instance object"),
298
    ("disk", ED_OBJECT_DICT, "Disk dict to hotplug"),
299
    ("dev_path", None, "Device path"),
300
    ("seq", None, "Disk seq to hotplug"),
301
    ], None, None, "Adds a nic to a running instance"),
302
  ("hot_del_disk", SINGLE, None, constants.RPC_TMO_NORMAL, [
303
    ("instance", ED_INST_DICT, "Instance object"),
304
    ("disk", ED_OBJECT_DICT, "Disk dict to remove"),
305
    ("seq", None, "Disk seq to hotplug"),
306
    ], None, None, "Removes a nic to a running instance"),
286 307
  ]
287 308

  
288 309
_IMPEXP_CALLS = [
b/lib/server/noded.py
574 574
    return backend.StartInstance(instance, startup_paused)
575 575

  
576 576
  @staticmethod
577
  def perspective_hot_add_disk(params):
578
    """Hotplugs a nic to a running instance.
579

  
580
    """
581
    (idict, ddict, dev_path, seq) = params
582
    instance = objects.Instance.FromDict(idict)
583
    disk = objects.Disk.FromDict(ddict)
584
    return backend.HotAddDisk(instance, disk, dev_path, seq)
585

  
586
  @staticmethod
587
  def perspective_hot_del_disk(params):
588
    """Hotplugs a nic to a running instance.
589

  
590
    """
591
    (idict, ddict, seq) = params
592
    instance = objects.Instance.FromDict(idict)
593
    disk = objects.Disk.FromDict(ddict)
594
    return backend.HotDelDisk(instance, disk, seq)
595

  
596
  @staticmethod
597
  def perspective_hot_add_nic(params):
598
    """Hotplugs a nic to a running instance.
599

  
600
    """
601
    (idict, ndict, seq) = params
602
    instance = objects.Instance.FromDict(idict)
603
    nic = objects.NIC.FromDict(ndict)
604
    return backend.HotAddNic(instance, nic, seq)
605

  
606
  @staticmethod
607
  def perspective_hot_del_nic(params):
608
    """Hotplugs a nic to a running instance.
609

  
610
    """
611
    (idict, ndict, seq) = params
612
    instance = objects.Instance.FromDict(idict)
613
    nic = objects.NIC.FromDict(ndict)
614
    return backend.HotDelNic(instance, nic, seq)
615

  
616
  @staticmethod
577 617
  def perspective_migration_info(params):
578 618
    """Gather information about an instance to be migrated.
579 619

  

Also available in: Unified diff