Revision 860bf930 lib/server/noded.py
b/lib/server/noded.py | ||
---|---|---|
604 | 604 |
return backend.StartInstance(instance, startup_paused, trail) |
605 | 605 |
|
606 | 606 |
@staticmethod |
607 |
def perspective_hotplug_device(params): |
|
608 |
"""Hotplugs device to a running instance. |
|
609 |
|
|
610 |
""" |
|
611 |
(idict, action, dev_type, ddict, extra, seq) = params |
|
612 |
instance = objects.Instance.FromDict(idict) |
|
613 |
if dev_type == constants.HOTPLUG_TARGET_DISK: |
|
614 |
device = objects.Disk.FromDict(ddict) |
|
615 |
elif dev_type == constants.HOTPLUG_TARGET_NIC: |
|
616 |
device = objects.NIC.FromDict(ddict) |
|
617 |
else: |
|
618 |
assert dev_type in constants.HOTPLUG_ALL_TARGETS |
|
619 |
return backend.HotplugDevice(instance, action, dev_type, device, extra, seq) |
|
620 |
|
|
621 |
@staticmethod |
|
607 | 622 |
def perspective_migration_info(params): |
608 | 623 |
"""Gather information about an instance to be migrated. |
609 | 624 |
|
Also available in: Unified diff