Revision c5708931 lib/server/noded.py
b/lib/server/noded.py | ||
---|---|---|
616 | 616 |
return backend.StartInstance(instance, startup_paused, trail) |
617 | 617 |
|
618 | 618 |
@staticmethod |
619 |
def perspective_hotplug_device(params): |
|
620 |
"""Hotplugs device to a running instance. |
|
621 |
|
|
622 |
""" |
|
623 |
(idict, action, dev_type, ddict, extra, seq) = params |
|
624 |
instance = objects.Instance.FromDict(idict) |
|
625 |
if dev_type == constants.HOTPLUG_TARGET_DISK: |
|
626 |
device = objects.Disk.FromDict(ddict) |
|
627 |
elif dev_type == constants.HOTPLUG_TARGET_NIC: |
|
628 |
device = objects.NIC.FromDict(ddict) |
|
629 |
else: |
|
630 |
assert dev_type in constants.HOTPLUG_ALL_TARGETS |
|
631 |
return backend.HotplugDevice(instance, action, dev_type, device, extra, seq) |
|
632 |
|
|
633 |
@staticmethod |
|
619 | 634 |
def perspective_migration_info(params): |
620 | 635 |
"""Gather information about an instance to be migrated. |
621 | 636 |
|
Also available in: Unified diff