def METHOD_NAME(device):
    """
    Hot unplug device
    :param device: QDevice object
    """
    parent_bus = device.get_param('bus')
    driver = device.get_param('driver')
    device_id = device.get_param('id')
    error_context.context("Hot-unplug %s" % driver, test.log.info)
    error_pattern = unplug_error_pattern % (parent_bus, parent_bus)
    try:
        device.unplug(vm.monitor)
    except QMPCmdError as e:
        if not re.search(error_pattern, e.data["desc"]):
            test.fail("Hot-unplug failed but '%s' isn't the expected error"
                      % e.data["desc"])
        error_context.context("Hot-unplug %s failed as expected: %s"
                              % (driver, e.data["desc"]), test.log.info)
    else:
        test.fail("Hot-unplug %s should not success" % driver)