• Pavel Tikhomirov's avatar
    zdtm/lib: add pre-dump-notify test flag · e071c2a6
    Pavel Tikhomirov authored
    If pre-dump-notify flag is set, zdtm sends a notify to the test after
    pre-dump was finished and waits for the test to send back a reply that
    test did all it's work and now is ready for a next pre-dump/dump.
    
    How it can be used:
    
    while (!test_wait_pre_dump()) {
    	/* Do something after predump */
    	test_wait_pre_dump_ack();
    }
    /* Do something after restore */
    
    Internally we open two pipes for the test one for receiving notify (with
    two open ends) and one for replying to it (only write end open). Fds of
    pipes are dupped to predefined numbers and zdtm opens these fds through
    /proc/<test-pid>/fd/{100,101} and communicates with the test.
    
    v9: switch to two way interface to remove race then operation we try to
    run after predump may be yet unfinished at the time of next dump.
    Suggested-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    Signed-off-by: 's avatarPavel Tikhomirov <ptikhomirov@virtuozzo.com>
    Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    e071c2a6
zdtmtst.h 5.48 KB