Giter Site home page Giter Site logo

qcow2-rs's Introduction

qcow2-rs

license license

Library in qcow2-rs is for reading/writing data from qcow2 image, and follows its features:

  • async/await, support multiple io engines, verified on tokio-uring, raw linux sync IO syscall, tokio and io-uring1 with smol2 runtime

  • support both direct IO and buffered IO, for direct IO, it needs async runtime support, such as tokio doesn't allow it.

  • basic read/write function on data file, backing file and compressed image

  • l2 table & refcount block load & store in slice way, and the minimized slice size is block size, and the maximized size is cluster size

  • block device like interface, minimized read/write unit is aligned with block size of the FS qcow2 image

  • cross-platform support, verified on linux(Fedora/ubuntu), freebsd and windows

This project is based on qcow2 implementation from rsd3

Motivation of this project is for supporting ublk-qcow24, but turns out it becomes one generic async qcow2 library. Attributed to Rust async/.await, the lib is well designed & implemented, and easy to extend(add new features, improve, ...)

One utility is included in this project, which can dump qcow2 meta, show any meta related statistics of the image, check image meta integrity & host cluster leak, format qcow2 image and convert between qcow2 and raw.

Example

    use qcow2_rs::qcow2_default_params;
    use qcow2_rs::utils::qcow2_setup_dev_uring;
    use qcow2_rs::helpers::Qcow2IoBuf;

    tokio_uring::start(async move {
        let params = Qcow2DevParams::new(9, None, None, false, false);
        let path = std::path::PathBuf::from("test.qcow2");

        // setup one qcow2 device
        let dev = qcow2_setup_dev_uring(&path, &params).await.unwrap();

        // create one slice like & aligned IO buffer
        let mut buf = Qcow2IoBuf::<u8>::new(4096);

        // read 4096 bytes to `buf` from virt offset 0 of `test.qcow2`
        let _ = dev.read_at(&mut buf, 0).await.unwrap();

        // write 4096 bytes from `buf` to virt offset 4096 of `test.qcow2`
        let _ = dev.write_at(&buf, 4096).await.unwrap();

        // flush meta data lazily, which is done in soft update style
        dev.flush_meta().await.unwrap();
    });

Test

  • for running the built-in test, qemu-img is required, so package of qemu-utils(Debian/Ubuntu) or qemu-img(Fedora, RHEL, ...) needs to be installed

  • built CI covers 'carget test' on both ubuntu and windows

License

This project is licensed under MIT OR Apache.

Contributing

Any kinds of contributions are welcome!

References

Footnotes

  1. https://docs.rs/io-uring

  2. https://docs.rs/smol

  3. https://gitlab.com/hreitz/rsd/-/tree/main/src/node/qcow2?ref_type=heads

  4. https://github.com/ming1/rublk/tree/qcow2

qcow2-rs's People

Contributors

ming1 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

xiaoquanju

qcow2-rs's Issues

Fails to compile on macOS 14.2.1 ARM64

error[E0425]: cannot find value `MAP_POPULATE` in crate `libc`
    --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/util.rs:19:42
     |
19   |                 libc::MAP_SHARED | libc::MAP_POPULATE,
     |                                          ^^^^^^^^^^^^ help: a constant with a similar name exists: `MAP_PRIVATE`
     |
    ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/apple/mod.rs:3314:1
     |
3314 | pub const MAP_PRIVATE: ::c_int = 0x0002;
     | ------------------------------ similarly named constant `MAP_PRIVATE` defined here

error[E0425]: cannot find value `MADV_DONTFORK` in crate `libc`
    --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/util.rs:35:74
     |
35   |         match unsafe { libc::madvise(self.addr.as_ptr(), self.len, libc::MADV_DONTFORK) } {
     |                                                                          ^^^^^^^^^^^^^ help: a constant with a similar name exists: `MADV_DONTNEED`
     |
    ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/apple/mod.rs:3786:1
     |
3786 | pub const MADV_DONTNEED: ::c_int = 4;
     | -------------------------------- similarly named constant `MADV_DONTNEED` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:132:25
    |
132 |         offset64: libc::off64_t = 0,
    |                         ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:165:39
    |
165 |         self.offset64(offset as libc::off64_t)
    |                                       ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:178:25
    |
178 |         offset64: libc::off64_t = 0,
    |                         ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:208:39
    |
208 |         self.offset64(offset as libc::off64_t)
    |                                       ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:258:25
    |
258 |         offset64: libc::off64_t = 0,
    |                         ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:291:39
    |
291 |         self.offset64(offset as libc::off64_t)
    |                                       ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:310:25
    |
310 |         offset64: libc::off64_t = 0,
    |                         ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:342:39
    |
342 |         self.offset64(offset as libc::off64_t)
    |                                       ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:427:23
    |
427 |         offset: libc::off64_t = 0,
    |                       ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:762:25
    |
762 |         offset64: libc::off64_t = 0,
    |                         ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:785:39
    |
785 |         self.offset64(offset as libc::off64_t)
    |                                       ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:793:22
    |
793 |         len: { libc::off64_t },
    |                      ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:795:25
    |
795 |         offset64: libc::off64_t = 0,
    |                         ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:817:39
    |
817 |         self.offset64(offset as libc::off64_t)
    |                                       ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:954:25
    |
954 |         offset64: libc::off64_t = 0,
    |                         ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:986:39
    |
986 |         self.offset64(offset as libc::off64_t)
    |                                       ^^^^^^^ help: a type alias with a similar name exists: `off_t`
    |
   ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
    |
1   | pub type off_t = i64;
    | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
    --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:1011:25
     |
1011 |         offset64: libc::off64_t = 0,
     |                         ^^^^^^^ help: a type alias with a similar name exists: `off_t`
     |
    ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
     |
1    | pub type off_t = i64;
     | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
    --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:1040:39
     |
1040 |         self.offset64(offset as libc::off64_t)
     |                                       ^^^^^^^ help: a type alias with a similar name exists: `off_t`
     |
    ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
     |
1    | pub type off_t = i64;
     | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
    --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:1051:25
     |
1051 |         offset64: libc::off64_t = 0,
     |                         ^^^^^^^ help: a type alias with a similar name exists: `off_t`
     |
    ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
     |
1    | pub type off_t = i64;
     | -------------- similarly named type alias `off_t` defined here

error[E0412]: cannot find type `off64_t` in crate `libc`
    --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:1072:39
     |
1072 |         self.offset64(offset as libc::off64_t)
     |                                       ^^^^^^^ help: a type alias with a similar name exists: `off_t`
     |
    ::: /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:1:1
     |
1    | pub type off_t = i64;
     | -------------- similarly named type alias `off_t` defined here

error[E0425]: cannot find value `SYS_io_uring_register` in crate `libc`
  --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/sys/mod.rs:45:40
   |
45 | const SYSCALL_REGISTER: c_long = libc::SYS_io_uring_register;
   |                                        ^^^^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `SYS_io_uring_setup` in crate `libc`
  --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/sys/mod.rs:51:37
   |
51 | const SYSCALL_SETUP: c_long = libc::SYS_io_uring_setup;
   |                                     ^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `SYS_io_uring_enter` in crate `libc`
  --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/sys/mod.rs:57:37
   |
57 | const SYSCALL_ENTER: c_long = libc::SYS_io_uring_enter;
   |                                     ^^^^^^^^^^^^^^^^^^ not found in `libc`

libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
error[E0308]: mismatched types
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:841:19
    |
841 |         sqe.len = mode;
    |         -------   ^^^^ expected `u32`, found `u16`
    |         |
    |         expected due to the type of this binding

libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
error[E0308]: mismatched types
    --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/opcode.rs:1469:19
     |
1469 |         sqe.len = mode;
     |         -------   ^^^^ expected `u32`, found `u16`
     |         |
     |         expected due to the type of this binding

libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
error[E0308]: mismatched types
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/sys/mod.rs:67:9
    |
66  |     to_result(syscall(
    |               ------- arguments to this function are incorrect
67  |         SYSCALL_REGISTER,
    |         ^^^^^^^^^^^^^^^^ expected `i32`, found `i64`
    |
note: function defined here
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:635:12
    |
635 |     pub fn syscall(num: ::c_int, ...) -> ::c_int;
    |            ^^^^^^^
help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
    |
67  |         SYSCALL_REGISTER.try_into().unwrap(),
    |                         ++++++++++++++++++++

libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
error[E0308]: mismatched types
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/sys/mod.rs:93:23
    |
93  |     to_result(syscall(SYSCALL_SETUP, entries as c_long, p as c_long) as _)
    |               ------- ^^^^^^^^^^^^^ expected `i32`, found `i64`
    |               |
    |               arguments to this function are incorrect
    |
note: function defined here
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:635:12
    |
635 |     pub fn syscall(num: ::c_int, ...) -> ::c_int;
    |            ^^^^^^^
help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
    |
93  |     to_result(syscall(SYSCALL_SETUP.try_into().unwrap(), entries as c_long, p as c_long) as _)
    |                                    ++++++++++++++++++++

libunwind: malformed __unwind_info at 0x183053CA8 bad second level page
error[E0308]: mismatched types
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/io-uring-0.5.13/src/sys/mod.rs:111:9
    |
110 |     to_result(syscall(
    |               ------- arguments to this function are incorrect
111 |         SYSCALL_ENTER,
    |         ^^^^^^^^^^^^^ expected `i32`, found `i64`
    |
note: function defined here
   --> /Users/xvilka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.152/src/unix/bsd/mod.rs:635:12
    |
635 |     pub fn syscall(num: ::c_int, ...) -> ::c_int;
    |            ^^^^^^^
help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
    |
111 |         SYSCALL_ENTER.try_into().unwrap(),
    |                      ++++++++++++++++++++

Some errors have detailed explanations: E0308, E0412, E0425.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `io-uring` (lib) due to 30 previous errors
warning: build failed, waiting for other jobs to finish...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.