• D
    qemu_hotplug.c: adding qemuDomainGetUnplugTimeout · e03e27ee
    Daniel Henrique Barboza 提交于
    For some architectures and setups, device removal can take
    longer than the default 5 seconds. This results in commands
    such as 'virsh setvcpus' to fire timeout messages even if
    the operation were successful in the guest, confusing the
    user.
    
    This patch sets a new 10 seconds unplug timeout for PPC64
    guests. All other archs will keep the default 5 seconds
    timeout.
    
    Instead of putting 'if PPC64' conditionals inside qemu_hotplug.c
    to set the new timeout value, a new function called
    qemuDomainGetUnplugTimeout was added. The timeout value is then
    retrieved when needed, by passing the correspondent DomainDef
    object. This approach allows for different guest architectures
    to have distint unplug timeout intervals, regardless of the
    host architecture. This design also makes it easier to
    modify/enhance the unplug timeout logic in the future
    (allow for special timeouts for TCG domains, for example).
    
    A new mock file was created to work with qemuhotplugtest.c,
    given that the test timeout is significantly shorter than
    the actual timeout value in qemu_hotplug.c.
    
    The now unused 'qemuDomainRemoveDeviceWaitTime' global can't
    be simply erased from qemu_hotplug.c though. Next patch will
    remove it properly.
    Reviewed-by: NCole Robinson <crobinso@redhat.com>
    Suggested-by: NCole Robinson <crobinso@redhat.com>
    Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
    e03e27ee
qemu_hotplug.c 209.1 KB