Skip to content
  • Jonathon Jongsma's avatar
    qemu: Monitor nbdkit process for exit · 447e09df
    Jonathon Jongsma authored
    
    
    Adds the ability to monitor the nbdkit process so that we can take
    action in case the child exits unexpectedly.
    
    When the nbdkit process exits, we pause the vm, restart nbdkit, and then
    resume the vm. This allows the vm to continue working in the event of a
    nbdkit failure.
    
    Eventually we may want to generalize this functionality since we may
    need something similar for e.g. qemu-storage-daemon, etc.
    
    The process is monitored with the pidfd_open() syscall if it exists
    (since linux 5.3). Otherwise it resorts to checking whether the process
    is alive once a second. The one-second time period was chosen somewhat
    arbitrarily.
    
    Signed-off-by: default avatarJonathon Jongsma <jjongsma@redhat.com>
    Reviewed-by: default avatarPeter Krempa <pkrempa@redhat.com>
    447e09df