Revision f4529722 lib/hypervisor/hv_base.py

b/lib/hypervisor/hv_base.py
539 539
    else:
540 540
      return None
541 541

  
542
  # pylint: disable=R0201,W0613
542 543
  def HotAddDevice(self, instance, dev_type, device, extra, seq):
543 544
    """Hot-add a device.
544 545

  
545 546
    """
546
    pass
547
    raise errors.HotplugError("Hotplug is not supported by this hypervisor")
547 548

  
549
  # pylint: disable=R0201,W0613
548 550
  def HotDelDevice(self, instance, dev_type, device, extra, seq):
549 551
    """Hot-del a device.
550 552

  
551 553
    """
552
    pass
554
    raise errors.HotplugError("Hotplug is not supported by this hypervisor")
553 555

  
556
  # pylint: disable=R0201,W0613
554 557
  def HotModDevice(self, instance, dev_type, device, extra, seq):
555 558
    """Hot-mod a device.
556 559

  
557 560
    """
558
    pass
561
    raise errors.HotplugError("Hotplug is not supported by this hypervisor")
562

  
563
  # pylint: disable=R0201,W0613
564
  def VerifyHotplugSupport(self, instance, action, dev_type):
565
    """Verifies that hotplug is supported.
559 566

  
560
  def HotplugSupported(self, instance, action, dev_type):
561
    """Whether hotplug is supported.
567
    Hotplug is not supported by default. If a hypervisor wants to support
568
    it it should override this method.
569

  
570
    @type instance: L{objects.Instance}
571
    @param instance: the instance object
572
    @type action: string
573
    @param action: one of the supported hotplug commands
574
    @type dev_type: string
575
    @param dev_type: one of the supported device types to hotplug
576
    @raise errors.HotplugError: if hotplugging is not supported
562 577

  
563
    Depends on instance's hvparam, the action. and the dev_type
564 578
    """
565
    raise NotImplementedError
579
    raise errors.HotplugError("Hotplug is not supported by this hypervisor")

Also available in: Unified diff