wasmer-journal 0.701.0

Journaling functionality used by Wasmer to save and restore WASM state
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
use std::{
    net::{Ipv4Addr, Ipv6Addr, SocketAddr},
    time::{Duration, SystemTime},
};

use super::*;
use lz4_flex::compress_prepend_size;
use rkyv::{
    api::high::HighSerializer,
    rancor::Strategy,
    ser::{
        Serializer,
        allocator::{Arena, ArenaHandle},
        sharing::Share,
    },
};
use wasmer_wasix_types::wasi;

pub fn run_test(record: JournalEntry<'_>) {
    tracing::info!("record: {:?}", record);

    // Determine the record type
    let record_type = record.archive_record_type();
    tracing::info!("record_type: {:?}", record_type);

    // Serialize it
    let mut arena = Arena::new();
    let mut buffer = Vec::new();
    let mut serializer = Serializer::new(&mut buffer, arena.acquire(), Share::new());
    let serializer: &mut HighSerializer<&mut Vec<u8>, ArenaHandle, rkyv::rancor::Error> =
        Strategy::wrap(&mut serializer);

    record.clone().serialize_archive(serializer).unwrap();
    let buffer = &buffer[..];
    if buffer.len() < 20 {
        tracing::info!("buffer: {:x?}", buffer);
    } else {
        tracing::info!("buffer_len: {}", buffer.len());
    }

    // Deserialize it
    let record2 = unsafe { record_type.deserialize_archive(buffer).unwrap() };
    tracing::info!("record2: {:?}", record2);

    // Check it
    assert_eq!(record, record2);

    // Now make it static and check it again
    let record3 = record2.into_owned();
    tracing::info!("record3: {:?}", record3);
    assert_eq!(record, record3);
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_init_module() {
    run_test(JournalEntry::InitModuleV1 {
        wasm_hash: Box::new([13u8; 8]),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_process_exit() {
    run_test(JournalEntry::ProcessExitV1 {
        exit_code: Some(wasi::ExitCode::from(wasi::Errno::Fault)),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_set_thread() {
    run_test(JournalEntry::SetThreadV1 {
        id: 1234u32,
        call_stack: vec![1, 2, 3].into(),
        memory_stack: vec![4, 5, 6, 7].into(),
        store_data: vec![10, 11].into(),
        is_64bit: true,
        layout: wasmer_wasix_types::wasix::WasiMemoryLayout {
            stack_upper: 0,
            stack_lower: 1024,
            guard_size: 16,
            stack_size: 1024,
            tls_base: None,
        },
        start: wasmer_wasix_types::wasix::ThreadStartType::MainThread,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_close_thread() {
    run_test(JournalEntry::CloseThreadV1 {
        id: 987u32,
        exit_code: Some(wasi::ExitCode::from(wasi::Errno::Fault)),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_descriptor_seek() {
    run_test(JournalEntry::FileDescriptorSeekV1 {
        fd: 765u32,
        offset: 9183722450971234i64,
        whence: wasi::Whence::End,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_descriptor_write() {
    run_test(JournalEntry::FileDescriptorWriteV1 {
        fd: 54321u32,
        offset: 13897412934u64,
        data: vec![74u8, 98u8, 36u8].into(),
        is_64bit: true,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_update_memory() {
    run_test(JournalEntry::UpdateMemoryRegionV1 {
        region: 76u64..8237453u64,
        compressed_data: compress_prepend_size(&[74u8; 40960]).into(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_set_clock_time() {
    run_test(JournalEntry::SetClockTimeV1 {
        clock_id: wasi::Snapshot0Clockid::Realtime,
        time: 7912837412934u64,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_open_file_descriptor() {
    run_test(JournalEntry::OpenFileDescriptorV1 {
        fd: 298745u32,
        dirfd: 23458922u32,
        dirflags: 134512345,
        path: "/blah".into(),
        o_flags: wasi::Oflags::all(),
        fs_rights_base: wasi::Rights::all(),
        fs_rights_inheriting: wasi::Rights::all(),
        fs_flags: wasi::Fdflags::all(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_close_descriptor() {
    run_test(JournalEntry::CloseFileDescriptorV1 { fd: 23845732u32 });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_renumber_file_descriptor() {
    run_test(JournalEntry::RenumberFileDescriptorV1 {
        old_fd: 27834u32,
        new_fd: 398452345u32,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_duplicate_file_descriptor() {
    run_test(JournalEntry::DuplicateFileDescriptorV1 {
        original_fd: 23482934u32,
        copied_fd: 9384529u32,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_create_directory() {
    run_test(JournalEntry::CreateDirectoryV1 {
        fd: 238472u32,
        path: "/joasjdf/asdfn".into(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_remove_directory() {
    run_test(JournalEntry::RemoveDirectoryV1 {
        fd: 23894952u32,
        path: "/blahblah".into(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_path_set_times() {
    run_test(JournalEntry::PathSetTimesV1 {
        fd: 1238934u32,
        flags: 234523,
        path: "/".into(),
        st_atim: 923452345,
        st_mtim: 350,
        fst_flags: wasi::Fstflags::all(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_file_descriptor_set_times() {
    run_test(JournalEntry::FileDescriptorSetTimesV1 {
        fd: 898785u32,
        st_atim: 29834952345,
        st_mtim: 239845892345,
        fst_flags: wasi::Fstflags::all(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_file_descriptor_set_size() {
    run_test(JournalEntry::FileDescriptorSetSizeV1 {
        fd: 34958234u32,
        st_size: 234958293845u64,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_file_descriptor_set_flags() {
    run_test(JournalEntry::FileDescriptorSetFlagsV1 {
        fd: 982348752u32,
        flags: wasi::Fdflags::all(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_file_descriptor_set_rights() {
    run_test(JournalEntry::FileDescriptorSetRightsV1 {
        fd: 872345u32,
        fs_rights_base: wasi::Rights::all(),
        fs_rights_inheriting: wasi::Rights::all(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_file_descriptor_advise() {
    run_test(JournalEntry::FileDescriptorAdviseV1 {
        fd: 298434u32,
        offset: 92834529092345,
        len: 23485928345,
        advice: wasi::Advice::Random,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_file_descriptor_allocate() {
    run_test(JournalEntry::FileDescriptorAllocateV1 {
        fd: 2934852,
        offset: 23489582934523,
        len: 9845982345,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_create_hard_link() {
    run_test(JournalEntry::CreateHardLinkV1 {
        old_fd: 324983845,
        old_path: "/asjdfiasidfasdf".into(),
        old_flags: 234857,
        new_fd: 34958345,
        new_path: "/ashdufnasd".into(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_create_symbolic_link() {
    run_test(JournalEntry::CreateSymbolicLinkV1 {
        old_path: "/asjbndfjasdf/asdafasdf".into(),
        fd: 235422345,
        new_path: "/asdf".into(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_unlink_file() {
    run_test(JournalEntry::UnlinkFileV1 {
        fd: 32452345,
        path: "/asdfasd".into(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_path_rename() {
    run_test(JournalEntry::PathRenameV1 {
        old_fd: 32451345,
        old_path: "/asdfasdfas/asdfasdf".into(),
        new_fd: 23452345,
        new_path: "/ahgfdfghdfghdfgh".into(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_change_directory() {
    run_test(JournalEntry::ChangeDirectoryV1 {
        path: "/etc".to_string().into(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_epoll_create() {
    run_test(JournalEntry::EpollCreateV1 { fd: 45384752 });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_epoll_ctl() {
    run_test(JournalEntry::EpollCtlV1 {
        epfd: 34523455,
        op: wasi::EpollCtl::Unknown,
        fd: 23452345,
        event: Some(wasi::EpollEventCtl {
            events: wasi::EpollType::all(),
            ptr: 32452345,
            fd: 23452345,
            data1: 1235245756,
            data2: 23452345,
        }),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_tty_set() {
    run_test(JournalEntry::TtySetV1 {
        tty: wasi::Tty {
            cols: 1234,
            rows: 6754,
            width: 4563456,
            height: 345,
            stdin_tty: true,
            stdout_tty: false,
            stderr_tty: true,
            echo: true,
            line_buffered: true,
        },
        line_feeds: true,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_create_pipe() {
    run_test(JournalEntry::CreatePipeV1 {
        read_fd: 3452345,
        write_fd: 2345163,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_create_event() {
    run_test(JournalEntry::CreateEventV1 {
        initial_val: 13451345,
        flags: 2343,
        fd: 5836544,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_port_add_addr() {
    run_test(JournalEntry::PortAddAddrV1 {
        cidr: JournalIpCidrV1 {
            ip: Ipv4Addr::LOCALHOST.into(),
            prefix: 24,
        }
        .into(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_del_addr() {
    run_test(JournalEntry::PortDelAddrV1 {
        addr: Ipv6Addr::LOCALHOST.into(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_addr_clear() {
    run_test(JournalEntry::PortAddrClearV1);
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_port_bridge() {
    run_test(JournalEntry::PortBridgeV1 {
        network: "mynetwork".into(),
        token: "blh blah".to_string().into(),
        security: JournalStreamSecurityV1::ClassicEncryption.into(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_unbridge() {
    run_test(JournalEntry::PortUnbridgeV1);
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_dhcp_acquire() {
    run_test(JournalEntry::PortDhcpAcquireV1);
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_gateway_set() {
    run_test(JournalEntry::PortGatewaySetV1 {
        ip: Ipv4Addr::new(12, 34, 136, 220).into(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_route_add() {
    run_test(JournalEntry::PortRouteAddV1 {
        cidr: JournalIpCidrV1 {
            ip: Ipv4Addr::LOCALHOST.into(),
            prefix: 24,
        }
        .into(),
        via_router: Ipv4Addr::LOCALHOST.into(),
        preferred_until: Some(Duration::MAX),
        expires_at: Some(Duration::ZERO),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_route_clear() {
    run_test(JournalEntry::PortRouteClearV1);
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_route_del() {
    run_test(JournalEntry::PortRouteDelV1 {
        ip: Ipv4Addr::BROADCAST.into(),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_open() {
    run_test(JournalEntry::SocketOpenV1 {
        af: wasi::Addressfamily::Inet6,
        ty: wasi::Socktype::Stream,
        pt: wasi::SockProto::Tcp,
        fd: 23452345,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_listen() {
    run_test(JournalEntry::SocketListenV1 {
        fd: 12341234,
        backlog: 123,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_bind() {
    run_test(JournalEntry::SocketBindV1 {
        fd: 2341234,
        addr: SocketAddr::new(Ipv6Addr::UNSPECIFIED.into(), 1234),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_connected() {
    run_test(JournalEntry::SocketConnectedV1 {
        fd: 12341,
        local_addr: SocketAddr::new(Ipv6Addr::UNSPECIFIED.into(), 1234),
        peer_addr: SocketAddr::new(Ipv6Addr::UNSPECIFIED.into(), 1234),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_accepted() {
    run_test(JournalEntry::SocketAcceptedV1 {
        listen_fd: 21234,
        fd: 1,
        local_addr: SocketAddr::new(Ipv6Addr::UNSPECIFIED.into(), 3452),
        peer_addr: SocketAddr::new(Ipv6Addr::UNSPECIFIED.into(), 3452),
        fd_flags: wasi::Fdflags::all(),
        non_blocking: true,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_join_ipv4_multicast() {
    run_test(JournalEntry::SocketJoinIpv4MulticastV1 {
        fd: 12,
        multiaddr: Ipv4Addr::new(123, 123, 123, 123),
        iface: Ipv4Addr::new(128, 0, 0, 1),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_join_ipv6_multicast() {
    run_test(JournalEntry::SocketJoinIpv6MulticastV1 {
        fd: 12,
        multi_addr: Ipv6Addr::new(123, 123, 123, 123, 1234, 12663, 31, 1324),
        iface: 23541,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_leave_ipv4_multicast() {
    run_test(JournalEntry::SocketLeaveIpv4MulticastV1 {
        fd: 12,
        multi_addr: Ipv4Addr::new(123, 123, 123, 123),
        iface: Ipv4Addr::new(128, 0, 0, 1),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_leave_ipv6_multicast() {
    run_test(JournalEntry::SocketLeaveIpv6MulticastV1 {
        fd: 12,
        multi_addr: Ipv6Addr::new(123, 123, 123, 123, 1234, 12663, 31, 1324),
        iface: 23541,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_send_file() {
    run_test(JournalEntry::SocketSendFileV1 {
        socket_fd: 22234,
        file_fd: 989,
        offset: 124,
        count: 345673456234651234,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_send_to() {
    run_test(JournalEntry::SocketSendToV1 {
        fd: 123,
        data: [98u8; 102400].to_vec().into(),
        flags: 1234,
        addr: SocketAddr::new(Ipv6Addr::UNSPECIFIED.into(), 3452),
        is_64bit: true,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_send() {
    run_test(JournalEntry::SocketSendV1 {
        fd: 123,
        data: [98u8; 102400].to_vec().into(),
        flags: 1234,
        is_64bit: true,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_set_opt_flag() {
    run_test(JournalEntry::SocketSetOptFlagV1 {
        fd: 0,
        opt: wasi::Sockoption::Linger,
        flag: true,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_set_opt_size() {
    run_test(JournalEntry::SocketSetOptSizeV1 {
        fd: 15,
        opt: wasi::Sockoption::Linger,
        size: 234234,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_set_opt_time() {
    run_test(JournalEntry::SocketSetOptTimeV1 {
        fd: 0,
        ty: SocketOptTimeType::AcceptTimeout,
        time: Some(Duration::ZERO),
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_socket_shutdown() {
    run_test(JournalEntry::SocketShutdownV1 {
        fd: 123,
        how: SocketShutdownHow::Both,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_snapshot() {
    run_test(JournalEntry::SnapshotV1 {
        when: SystemTime::now(),
        trigger: SnapshotTrigger::Idle,
    });
}

#[tracing_test::traced_test]
#[test]
pub fn test_record_alignment() {
    assert_eq!(std::mem::align_of::<JournalEntryInitModuleV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryProcessExitV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntrySetThreadV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryCloseThreadV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryFileDescriptorSeekV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryFileDescriptorWriteV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryUpdateMemoryRegionV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntrySetClockTimeV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryOpenFileDescriptorV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryCloseFileDescriptorV1>(), 8);
    assert_eq!(
        std::mem::align_of::<JournalEntryRenumberFileDescriptorV1>(),
        8
    );
    assert_eq!(
        std::mem::align_of::<JournalEntryDuplicateFileDescriptorV1>(),
        8
    );
    assert_eq!(std::mem::align_of::<JournalEntryCreateDirectoryV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryRemoveDirectoryV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryPathSetTimesV1>(), 8);
    assert_eq!(
        std::mem::align_of::<JournalEntryFileDescriptorSetTimesV1>(),
        8
    );
    assert_eq!(
        std::mem::align_of::<JournalEntryFileDescriptorSetSizeV1>(),
        8
    );
    assert_eq!(
        std::mem::align_of::<JournalEntryFileDescriptorSetFlagsV1>(),
        8
    );
    assert_eq!(
        std::mem::align_of::<JournalEntryFileDescriptorSetRightsV1>(),
        8
    );
    assert_eq!(
        std::mem::align_of::<JournalEntryFileDescriptorAdviseV1>(),
        8
    );
    assert_eq!(
        std::mem::align_of::<JournalEntryFileDescriptorAllocateV1>(),
        8
    );
    assert_eq!(std::mem::align_of::<JournalEntryCreateHardLinkV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryCreateSymbolicLinkV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryUnlinkFileV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryPathRenameV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryChangeDirectoryV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryEpollCreateV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryEpollCtlV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryTtySetV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryCreatePipeV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryCreateEventV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryPortAddAddrV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryPortDelAddrV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryPortBridgeV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryPortGatewaySetV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryPortRouteAddV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntryPortRouteDelV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntrySocketOpenV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntrySocketListenV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntrySocketBindV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntrySocketConnectedV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntrySocketAcceptedV1>(), 8);
    assert_eq!(
        std::mem::align_of::<JournalEntrySocketJoinIpv4MulticastV1>(),
        8
    );
    assert_eq!(
        std::mem::align_of::<JournalEntrySocketJoinIpv6MulticastV1>(),
        8
    );
    assert_eq!(
        std::mem::align_of::<JournalEntrySocketLeaveIpv4MulticastV1>(),
        8
    );
    assert_eq!(
        std::mem::align_of::<JournalEntrySocketLeaveIpv6MulticastV1>(),
        8
    );
    assert_eq!(std::mem::align_of::<JournalEntrySocketSendFileV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntrySocketSendToV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntrySocketSendV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntrySocketSetOptFlagV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntrySocketSetOptSizeV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntrySocketSetOptTimeV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntrySocketShutdownV1>(), 8);
    assert_eq!(std::mem::align_of::<JournalEntrySnapshotV1>(), 8);
}