diff --git a/.gitignore b/.gitignore index ea8c4bf..de358ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +.vscode/ diff --git a/Cargo.lock b/Cargo.lock index b0357dd..6b925eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,21 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "aho-corasick" version = "1.1.3" @@ -47,7 +62,7 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -58,7 +73,7 @@ checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", "once_cell", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -67,6 +82,94 @@ version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +dependencies = [ + "byteorder", + "iovec", +] + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "cc" +version = "1.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "clap" version = "4.5.32" @@ -114,313 +217,2082 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] -name = "env_filter" -version = "0.1.3" +name = "console" +version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" dependencies = [ - "log", - "regex", + "encode_unicode", + "libc", + "once_cell", + "unicode-width", + "windows-sys 0.59.0", ] [[package]] -name = "env_logger" -version = "0.11.7" +name = "core-foundation" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3716d7a920fb4fac5d84e9d4bce8ceb321e9414b4409da61b07b75c1e3d0697" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ - "anstream", - "anstyle", - "env_filter", - "jiff", - "log", + "core-foundation-sys", + "libc", ] [[package]] -name = "heck" -version = "0.5.0" +name = "core-foundation-sys" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] -name = "is_terminal_polyfill" -version = "1.70.1" +name = "crossbeam-deque" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", + "maybe-uninit", +] [[package]] -name = "jiff" -version = "0.2.4" +name = "crossbeam-epoch" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d699bc6dfc879fb1bf9bdff0d4c56f0884fc6f0d0eb0fba397a6d00cd9a6b85e" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ - "jiff-static", - "log", - "portable-atomic", - "portable-atomic-util", - "serde", + "autocfg", + "cfg-if 0.1.10", + "crossbeam-utils", + "lazy_static", + "maybe-uninit", + "memoffset", + "scopeguard", ] [[package]] -name = "jiff-static" -version = "0.2.4" +name = "crossbeam-queue" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d16e75759ee0aa64c57a56acbf43916987b20c77373cb7e808979e02b93c9f9" +checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" dependencies = [ - "proc-macro2", - "quote", - "syn", + "cfg-if 0.1.10", + "crossbeam-utils", + "maybe-uninit", ] [[package]] -name = "kvm-install-vm" -version = "1.0.0-alpha" +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "anyhow", - "clap", - "env_logger", - "log", - "pkg-config", - "virt", + "autocfg", + "cfg-if 0.1.10", + "lazy_static", ] [[package]] -name = "libc" -version = "0.2.171" +name = "dirs" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", +] [[package]] -name = "log" -version = "0.4.26" +name = "dirs-sys" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.59.0", +] [[package]] -name = "memchr" -version = "2.7.4" +name = "displaydoc" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] -name = "once_cell" -version = "1.21.1" +name = "encode_unicode" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] -name = "pkg-config" -version = "0.3.32" +name = "encoding_rs" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if 1.0.0", +] [[package]] -name = "portable-atomic" -version = "1.11.0" +name = "env_filter" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" +dependencies = [ + "log", + "regex", +] [[package]] -name = "portable-atomic-util" -version = "0.2.4" +name = "env_logger" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +checksum = "c3716d7a920fb4fac5d84e9d4bce8ceb321e9414b4409da61b07b75c1e3d0697" dependencies = [ - "portable-atomic", + "anstream", + "anstyle", + "env_filter", + "jiff", + "log", ] [[package]] -name = "proc-macro2" -version = "1.0.94" +name = "equivalent" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" -dependencies = [ - "unicode-ident", -] +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] -name = "quote" -version = "1.0.40" +name = "errno" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ - "proc-macro2", + "libc", + "windows-sys 0.59.0", ] [[package]] -name = "regex" -version = "1.11.1" +name = "fastrand" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] -name = "regex-automata" -version = "0.4.9" +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", + "foreign-types-shared", ] [[package]] -name = "regex-syntax" -version = "0.8.5" +name = "foreign-types-shared" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] -name = "serde" -version = "1.0.219" +name = "form_urlencoded" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "serde_derive", + "percent-encoding", ] [[package]] -name = "serde_derive" -version = "1.0.219" +name = "futures" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ - "proc-macro2", - "quote", - "syn", + "futures-core", ] [[package]] -name = "strsim" -version = "0.11.1" +name = "futures-core" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] -name = "syn" -version = "2.0.100" +name = "futures-io" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "unicode-ident", + "syn", ] [[package]] -name = "unicode-ident" -version = "1.0.18" +name = "futures-sink" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] -name = "utf8parse" -version = "0.2.2" +name = "futures-task" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] -name = "uuid" -version = "1.16.0" +name = "futures-util" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] [[package]] -name = "virt" -version = "0.4.2" +name = "getrandom" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a05f77c836efa9be343b5419663cf829d75203b813579993cdd9c44f51767e" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ + "cfg-if 1.0.0", "libc", - "uuid", - "virt-sys", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] -name = "virt-sys" -version = "0.3.0" +name = "getrandom" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c504e459878f09177f41bf2f8bb3e9a8af4fca7a09e73152fee02535d501601c" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" dependencies = [ + "cfg-if 1.0.0", "libc", - "pkg-config", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] -name = "windows-sys" -version = "0.59.0" +name = "gimli" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] -name = "windows-targets" -version = "0.52.6" +name = "h2" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "atomic-waker", + "bytes 1.10.1", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" +name = "hashbrown" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" +name = "heck" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] -name = "windows_i686_gnu" -version = "0.52.6" +name = "hermit-abi" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" +name = "http" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +dependencies = [ + "bytes 1.10.1", + "fnv", + "itoa", +] [[package]] -name = "windows_i686_msvc" -version = "0.52.6" +name = "http-body" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes 1.10.1", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes 1.10.1", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +dependencies = [ + "bytes 1.10.1", + "futures-channel", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes 1.10.1", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes 1.10.1", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "indicatif" +version = "0.17.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235" +dependencies = [ + "console", + "number_prefix", + "portable-atomic", + "unicode-width", + "web-time", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "jiff" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d699bc6dfc879fb1bf9bdff0d4c56f0884fc6f0d0eb0fba397a6d00cd9a6b85e" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde", +] + +[[package]] +name = "jiff-static" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d16e75759ee0aa64c57a56acbf43916987b20c77373cb7e808979e02b93c9f9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "kvm-install-vm" +version = "1.0.0-alpha" +dependencies = [ + "anyhow", + "clap", + "dirs", + "env_logger", + "futures-util", + "indicatif", + "log", + "pkg-config", + "reqwest", + "serde", + "tempfile", + "tokio", + "tokio-fs", + "toml", + "virt", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.171" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags", + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" + +[[package]] +name = "litemap" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memoffset" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "native-tls" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" + +[[package]] +name = "openssl" +version = "0.10.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-sys" +version = "0.9.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "portable-atomic" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "portable-atomic-util" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "proc-macro2" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + +[[package]] +name = "redox_syscall" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" +dependencies = [ + "getrandom 0.2.15", + "libredox", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "reqwest" +version = "0.12.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" +dependencies = [ + "base64", + "bytes 1.10.1", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tokio-util", + "tower", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "windows-registry", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if 1.0.0", + "getrandom 0.2.15", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustix" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.103.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aa4eeac2588ffff23e9d7a7e9b3f971c5fb5b7ebc9452745e0c232c64f83b2f" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" + +[[package]] +name = "socket2" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600" +dependencies = [ + "fastrand", + "getrandom 0.3.2", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.44.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" +dependencies = [ + "backtrace", + "bytes 1.10.1", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-executor" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" +dependencies = [ + "crossbeam-utils", + "futures", +] + +[[package]] +name = "tokio-fs" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" +dependencies = [ + "futures", + "tokio-io", + "tokio-threadpool", +] + +[[package]] +name = "tokio-io" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" +dependencies = [ + "bytes 0.4.12", + "futures", + "log", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-threadpool" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" +dependencies = [ + "crossbeam-deque", + "crossbeam-queue", + "crossbeam-utils", + "futures", + "lazy_static", + "log", + "num_cpus", + "slab", + "tokio-executor", +] + +[[package]] +name = "tokio-util" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" +dependencies = [ + "bytes 1.10.1", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "virt" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a05f77c836efa9be343b5419663cf829d75203b813579993cdd9c44f51767e" +dependencies = [ + "libc", + "uuid", + "virt-sys", +] + +[[package]] +name = "virt-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c504e459878f09177f41bf2f8bb3e9a8af4fca7a09e73152fee02535d501601c" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-registry" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.53.0", +] + +[[package]] +name = "windows-result" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "winnow" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml index 9e5c0cc..7805ce7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,9 +10,18 @@ repository = "https://github.com/giovtorres/kvm-install-vm" [dependencies] anyhow = "1.0" clap = { version = "4.5", features = ["derive"] } +dirs = "6.0" env_logger = "0.11" +futures-util = "0.3" +indicatif = "0.17" log = "0.4" +reqwest = { version = "0.12", features = ["stream"] } +serde = { version = "1.0", features = ["derive"] } +tempfile = "3.19" +toml = "0.8" virt = "0.4" +tokio = { version = "1.44", features = ["full"] } +tokio-fs = "0.1" [build-dependencies] pkg-config = "0.3" \ No newline at end of file diff --git a/src/cloudinit.rs b/src/cloudinit.rs new file mode 100644 index 0000000..c9e644e --- /dev/null +++ b/src/cloudinit.rs @@ -0,0 +1,167 @@ +// cloudinit.rs - New file +use anyhow::{Context, Result}; +use std::path::{Path, PathBuf}; +use std::fs; +use std::process::Command; + +/// Represents a cloud-init configuration manager +pub struct CloudInitManager; + +impl CloudInitManager { + /// Create cloud-init user-data and meta-data files + pub fn create_cloud_init_config( + vm_name: &str, + dns_domain: &str, + ssh_public_key: &str, + user: &str, + timezone: &str, + sudo_group: &str, + cloud_init_disable: &str, + ) -> Result<(String, String)> { + // Create meta-data content + let meta_data = format!( + "instance-id: {}\nlocal-hostname: {}\n", + vm_name, vm_name + ); + + // Create user-data content with cloud-init multipart format + let user_data = format!( + r#"Content-Type: multipart/mixed; boundary="==BOUNDARY==" +MIME-Version: 1.0 +--==BOUNDARY== +Content-Type: text/cloud-config; charset="us-ascii" + +#cloud-config + +# Hostname management +preserve_hostname: False +hostname: {hostname} +fqdn: {hostname}.{dns_domain} + +# Users +users: + - default + - name: {user} + groups: ['{sudo_group}'] + shell: /bin/bash + sudo: ALL=(ALL) NOPASSWD:ALL + ssh-authorized-keys: + - {ssh_key} + +# Configure where output will go +output: + all: ">> /var/log/cloud-init.log" + +# configure interaction with ssh server +ssh_genkeytypes: ['ed25519', 'rsa'] + +# Install my public ssh key to the user +ssh_authorized_keys: + - {ssh_key} + +timezone: {timezone} + +# Remove cloud-init when finished with it +runcmd: + - {cloud_init_disable} + +--==BOUNDARY==-- +"#, + hostname = vm_name, + dns_domain = dns_domain, + user = user, + ssh_key = ssh_public_key, + sudo_group = sudo_group, + timezone = timezone, + cloud_init_disable = cloud_init_disable + ); + + Ok((user_data, meta_data)) + } + + /// Create a cloud-init ISO from user-data and meta-data + pub fn create_cloud_init_iso( + work_dir: &Path, + vm_name: &str, + user_data: &str, + meta_data: &str + ) -> Result { + let user_data_path = work_dir.join("user-data"); + let meta_data_path = work_dir.join("meta-data"); + let iso_path = work_dir.join(format!("{}-cidata.iso", vm_name)); + + // Make sure the directory exists + fs::create_dir_all(work_dir) + .context("Failed to create working directory")?; + + // Write files + fs::write(&user_data_path, user_data) + .context("Failed to write user-data file")?; + fs::write(&meta_data_path, meta_data) + .context("Failed to write meta-data file")?; + + // Check for genisoimage or mkisofs + let mut cmd; + if Command::new("genisoimage").arg("--version").output().is_ok() { + cmd = Command::new("genisoimage"); + cmd.args(&[ + "-output", iso_path.to_str().unwrap(), + "-volid", "cidata", + "-joliet", "-rock", + user_data_path.to_str().unwrap(), + meta_data_path.to_str().unwrap(), + ]); + } else if Command::new("mkisofs").arg("--version").output().is_ok() { + cmd = Command::new("mkisofs"); + cmd.args(&[ + "-o", iso_path.to_str().unwrap(), + "-V", "cidata", + "-J", "-r", + user_data_path.to_str().unwrap(), + meta_data_path.to_str().unwrap(), + ]); + } else { + return Err(anyhow::anyhow!("Neither genisoimage nor mkisofs found. Please install one of these tools.")); + } + + // Run the command + let status = cmd.status() + .context("Failed to execute ISO creation command")?; + + if !status.success() { + return Err(anyhow::anyhow!("Failed to create cloud-init ISO")); + } + + // Remove temporary files + fs::remove_file(user_data_path) + .context("Failed to clean up user-data file")?; + fs::remove_file(meta_data_path) + .context("Failed to clean up meta-data file")?; + + Ok(iso_path) + } + + /// Find an SSH public key + pub fn find_ssh_public_key() -> Result { + // Try to find a suitable key file + let possible_keys = [ + "id_rsa.pub", + "id_ed25519.pub", + "id_dsa.pub", + ]; + + if let Some(home) = dirs::home_dir() { + let ssh_dir = home.join(".ssh"); + + for key_name in possible_keys.iter() { + let key_path = ssh_dir.join(key_name); + if key_path.exists() { + return fs::read_to_string(&key_path) + .context(format!("Failed to read SSH key from {}", key_path.display())); + } + } + } + + Err(anyhow::anyhow!("No SSH public key found. Please generate an SSH keypair using 'ssh-keygen' or specify one with the '-k' flag.")) + } +} \ No newline at end of file diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 0000000..bd3b89d --- /dev/null +++ b/src/config.rs @@ -0,0 +1,170 @@ +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; +use std::path::{Path, PathBuf}; +use std::fs; +use anyhow::{Context, Result}; +use crate::vm::DistroInfo; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Config { + pub distros: HashMap, + + #[serde(default)] + pub defaults: DefaultConfig, +} + +#[derive(Debug, Deserialize, Serialize)] +pub struct DefaultConfig { + pub memory_mb: u32, + pub vcpus: u32, + pub disk_size_gb: u32, + pub image_dir: String, + pub vm_dir: String, + pub dns_domain: String, + pub timezone: String, +} + +impl Default for DefaultConfig { + fn default() -> Self { + let home = dirs::home_dir().unwrap_or_else(|| PathBuf::from(".")); + + DefaultConfig { + memory_mb: 1024, + vcpus: 1, + disk_size_gb: 10, + image_dir: home.join("virt/images").to_string_lossy().to_string(), + vm_dir: home.join("virt/vms").to_string_lossy().to_string(), + dns_domain: "example.local".to_string(), + timezone: "UTC".to_string(), + } + } +} + +impl Config { + /// Load configuration from a specified path + pub fn from_file>(path: P) -> Result { + let content = fs::read_to_string(&path) + .context(format!("Failed to read config file: {}", path.as_ref().display()))?; + + // Changed from serde_yaml to toml + let config: Config = toml::from_str(&content) + .context("Failed to parse TOML configuration")?; + + Ok(config) + } + + /// Load configuration from the default locations + pub fn load() -> Result { + // Check for config in user's config directory + if let Some(config_dir) = dirs::config_dir() { + // Changed file extension from yaml to toml + let user_config = config_dir.join("kvm-install-vm/config.toml"); + if user_config.exists() { + return Self::from_file(user_config); + } + } + + // Check for config in user's home directory + if let Some(home_dir) = dirs::home_dir() { + // Changed file extension from yaml to toml + let home_config = home_dir.join(".config/kvm-install-vm/config.toml"); + if home_config.exists() { + return Self::from_file(home_config); + } + + // Legacy location + let old_config = home_dir.join(".kivrc"); + if old_config.exists() { + // TODO: Convert legacy config format if needed + println!("Legacy .kivrc file found but not supported. Please convert to TOML format."); + } + } + + // Check for system-wide config + // Changed file extension from yaml to toml + let system_config = Path::new("/etc/kvm-install-vm/config.toml"); + if system_config.exists() { + return Self::from_file(system_config); + } + + // If no config files found, return default config + Ok(Self::default()) + } + + /// Save configuration to a file + pub fn save_to_file>(&self, path: P) -> Result<()> { + // Changed from serde_yaml to toml + let toml_content = toml::to_string_pretty(self) + .context("Failed to serialize configuration to TOML")?; + + // Ensure parent directory exists + if let Some(parent) = path.as_ref().parent() { + fs::create_dir_all(parent) + .context(format!("Failed to create directory: {}", parent.display()))?; + } + + fs::write(&path, toml_content) + .context(format!("Failed to write config to: {}", path.as_ref().display()))?; + + Ok(()) + } + + /// Save configuration to the default user location + pub fn save_to_user_config(&self) -> Result<()> { + if let Some(config_dir) = dirs::config_dir() { + // Changed file extension from yaml to toml + let user_config = config_dir.join("kvm-install-vm/config.toml"); + self.save_to_file(user_config) + } else { + Err(anyhow::anyhow!("Could not determine user config directory")) + } + } + + /// Get distribution info by name + pub fn get_distro(&self, name: &str) -> Result<&DistroInfo> { + self.distros.get(name) + .ok_or_else(|| anyhow::anyhow!("Distribution '{}' not found in configuration", name)) + } +} + +impl Default for Config { + fn default() -> Self { + // Create a default configuration with some common distributions + let mut distros = HashMap::new(); + + // CentOS 8 + distros.insert("centos8".to_string(), DistroInfo { + qcow_filename: "CentOS-8-GenericCloud-8.1.1911-20200113.3.x86_64.qcow2".to_string(), + os_variant: "centos8".to_string(), + image_url: "https://cloud.centos.org/centos/8/x86_64/images".to_string(), + login_user: "centos".to_string(), + sudo_group: "wheel".to_string(), + cloud_init_disable: "systemctl disable cloud-init.service".to_string(), + }); + + // Ubuntu 20.04 + distros.insert("ubuntu2004".to_string(), DistroInfo { + qcow_filename: "ubuntu-20.04-server-cloudimg-amd64.img".to_string(), + os_variant: "ubuntu20.04".to_string(), + image_url: "https://cloud-images.ubuntu.com/releases/20.04/release".to_string(), + login_user: "ubuntu".to_string(), + sudo_group: "sudo".to_string(), + cloud_init_disable: "systemctl disable cloud-init.service".to_string(), + }); + + // Fedora 35 + distros.insert("fedora35".to_string(), DistroInfo { + qcow_filename: "Fedora-Cloud-Base-35-1.2.x86_64.qcow2".to_string(), + os_variant: "fedora35".to_string(), + image_url: "https://download.fedoraproject.org/pub/fedora/linux/releases/35/Cloud/x86_64/images".to_string(), + login_user: "fedora".to_string(), + sudo_group: "wheel".to_string(), + cloud_init_disable: "systemctl disable cloud-init.service".to_string(), + }); + + Config { + distros, + defaults: DefaultConfig::default(), + } + } +} \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 36ac53c..f4ecdf3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,6 @@ pub mod cli; pub mod vm; +pub mod config; +pub mod cloudinit; pub use cli::Cli; diff --git a/src/vm.rs b/src/vm.rs index 1a3992a..c6e1d62 100644 --- a/src/vm.rs +++ b/src/vm.rs @@ -1,6 +1,14 @@ use anyhow::{Context, Result}; +use futures_util::StreamExt; +use indicatif::{ProgressBar, ProgressStyle}; +use reqwest; +use serde::{Deserialize, Serialize}; use std::fmt; -use std::path::Path; +use std::fs; +use std::path::{Path, PathBuf}; +use std::process::Command; +use tokio::fs::File; +use tokio::io::AsyncWriteExt; use virt::connect::Connect; use virt::domain::Domain; use virt::sys; @@ -15,6 +23,20 @@ pub struct VirtualMachine { pub connection: Option, } +#[derive(Debug, Clone, Deserialize, Serialize)] +pub struct DistroInfo { + pub qcow_filename: String, + pub os_variant: String, + pub image_url: String, + pub login_user: String, + pub sudo_group: String, + pub cloud_init_disable: String, +} + +pub struct ImageManager { + image_dir: PathBuf, +} + #[derive(Debug)] pub struct DomainInfo { pub id: Option, // None if domain is inactive @@ -46,6 +68,154 @@ impl fmt::Display for DomainState { } } +impl ImageManager { + /// Create a new ImageManager with the specified image directory + pub fn new>(image_dir: P) -> Self { + ImageManager { + image_dir: image_dir.as_ref().to_path_buf(), + } + } + + /// Check if a cloud image exists locally + pub fn image_exists(&self, distro_info: &DistroInfo) -> bool { + let image_path = self.image_dir.join(&distro_info.qcow_filename); + image_path.exists() + } + + /// Get the full path to a cloud image (whether it exists or not) + pub fn get_image_path(&self, distro_info: &DistroInfo) -> PathBuf { + self.image_dir.join(&distro_info.qcow_filename) + } + + /// Download a cloud image if it doesn't already exist locally + pub async fn ensure_image(&self, distro_info: &DistroInfo) -> Result { + let image_path = self.get_image_path(distro_info); + + if image_path.exists() { + println!("Cloud image already exists: {}", image_path.display()); + return Ok(image_path); + } + + // Create image directory if it doesn't exist + if !self.image_dir.exists() { + fs::create_dir_all(&self.image_dir) + .context("Failed to create image directory")?; + } + + println!("Downloading cloud image: {}", distro_info.qcow_filename); + + // Construct download URL + let url = format!("{}/{}", + distro_info.image_url.trim_end_matches('/'), + distro_info.qcow_filename); + + println!("From URL: {}", url); + + // Download the file with progress indication + self.download_file(&url, &image_path).await + .context("Failed to download cloud image")?; + + Ok(image_path) + } + + /// Download a file with progress indication + async fn download_file(&self, url: &str, dest: &Path) -> Result<()> { + // Create a temporary file for downloading + let temp_path = dest.with_extension("part"); + + // Create parent directory if needed + if let Some(parent) = temp_path.parent() { + fs::create_dir_all(parent)?; + } + + // Begin the download + let res = reqwest::get(url).await?; + let total_size = res.content_length().unwrap_or(0); + + // Setup progress bar + let pb = ProgressBar::new(total_size); + pb.set_style(ProgressStyle::default_bar() + .template("{spinner:.green} [{elapsed_precise}] [{wide_bar:.cyan/blue}] {bytes}/{total_bytes} ({eta})") + .unwrap() + .progress_chars("#>-")); + + // Download the file in chunks, writing each chunk to disk + let mut file = File::create(&temp_path).await?; + let mut downloaded: u64 = 0; + let mut stream = res.bytes_stream(); + + while let Some(item) = stream.next().await { + let chunk = item?; + file.write_all(&chunk).await?; + downloaded += chunk.len() as u64; + pb.set_position(downloaded); + } + + // Ensure everything is written to disk + file.flush().await?; + + // Finalize the download by renaming the temp file + tokio::fs::rename(&temp_path, &dest).await?; + + pb.finish_with_message(format!("Downloaded {}", dest.display())); + + Ok(()) + } + + /// Prepare a VM disk from a cloud image + pub fn prepare_vm_disk( + &self, + base_image: &Path, + vm_dir: &Path, + vm_name: &str, + disk_size_gb: u32 + ) -> Result { + let disk_path = vm_dir.join(format!("{}.qcow2", vm_name)); + + // Create VM directory if it doesn't exist + fs::create_dir_all(vm_dir) + .context("Failed to create VM directory")?; + + // Create base disk by copying from the cloud image + println!("Creating disk from cloud image: {}", disk_path.display()); + + let status = Command::new("qemu-img") + .args(&[ + "create", + "-f", "qcow2", + "-F", "qcow2", + "-b", &base_image.to_string_lossy(), + &disk_path.to_string_lossy(), + ]) + .status() + .context("Failed to execute qemu-img create command")?; + + if !status.success() { + return Err(anyhow::anyhow!("qemu-img create failed with status: {}", status)); + } + + // Resize disk if requested + if disk_size_gb > 0 { + println!("Resizing disk to {}GB", disk_size_gb); + + let status = Command::new("qemu-img") + .args(&[ + "resize", + &disk_path.to_string_lossy(), + &format!("{}G", disk_size_gb), + ]) + .status() + .context("Failed to execute qemu-img resize command")?; + + if !status.success() { + return Err(anyhow::anyhow!("qemu-img resize failed with status: {}", status)); + } + } + + Ok(disk_path) + } +} + impl VirtualMachine { pub fn new( name: String, diff --git a/tests/cloud_init_tests.rs b/tests/cloud_init_tests.rs new file mode 100644 index 0000000..195dc82 --- /dev/null +++ b/tests/cloud_init_tests.rs @@ -0,0 +1,91 @@ +// tests/cloud_init_tests.rs +use anyhow::Result; +use kvm_install_vm::cloudinit::CloudInitManager; +use std::fs; +use tempfile::tempdir; + +#[test] +fn test_create_cloud_init_config() -> Result<()> { + let (user_data, meta_data) = CloudInitManager::create_cloud_init_config( + "test-vm", + "example.local", + "ssh-rsa AAAAB3NzaC1yc2E... test-key", + "testuser", + "UTC", + "wheel", + "systemctl disable cloud-init" + )?; + + // Verify user_data contains expected elements + assert!(user_data.contains("hostname: test-vm")); + assert!(user_data.contains("fqdn: test-vm.example.local")); + assert!(user_data.contains("name: testuser")); + assert!(user_data.contains("groups: ['wheel']")); + assert!(user_data.contains("ssh-rsa AAAAB3NzaC1yc2E... test-key")); + assert!(user_data.contains("timezone: UTC")); + + // Verify meta_data contains expected elements + assert!(meta_data.contains("instance-id: test-vm")); + assert!(meta_data.contains("local-hostname: test-vm")); + + Ok(()) +} + +#[test] +fn test_create_cloud_init_iso() -> Result<()> { + // Skip if neither genisoimage nor mkisofs is available + let has_genisoimage = std::process::Command::new("genisoimage") + .arg("--version") + .output() + .is_ok(); + + let has_mkisofs = std::process::Command::new("mkisofs") + .arg("--version") + .output() + .is_ok(); + + if !has_genisoimage && !has_mkisofs { + println!("Skipping test_create_cloud_init_iso: neither genisoimage nor mkisofs available"); + return Ok(()); + } + + let temp_dir = tempdir()?; + + // Create test cloud-init data + let user_data = "#cloud-config\nhostname: test-vm\n"; + let meta_data = "instance-id: test-vm\nlocal-hostname: test-vm\n"; + + // Create ISO + let iso_path = CloudInitManager::create_cloud_init_iso( + temp_dir.path(), + "test-vm", + user_data, + meta_data + )?; + + // Verify ISO was created + assert!(iso_path.exists()); + assert!(fs::metadata(&iso_path)?.len() > 0); + + // Verify the temporary files were cleaned up + assert!(!temp_dir.path().join("user-data").exists()); + assert!(!temp_dir.path().join("meta-data").exists()); + + Ok(()) +} + +#[test] +fn test_find_ssh_public_key() { + // This test is tricky because it depends on the local environment + // Just check that the function either succeeds or fails with a reasonable error + match CloudInitManager::find_ssh_public_key() { + Ok(key) => { + assert!(!key.is_empty()); + assert!(key.starts_with("ssh-")); + }, + Err(e) => { + // The error should mention SSH keys + assert!(format!("{}", e).contains("SSH")); + } + } +} \ No newline at end of file diff --git a/tests/config_tests.rs b/tests/config_tests.rs new file mode 100644 index 0000000..2735b40 --- /dev/null +++ b/tests/config_tests.rs @@ -0,0 +1,118 @@ +// tests/config_tests.rs +use anyhow::Result; +use kvm_install_vm::config::{Config, DefaultConfig}; +use std::collections::HashMap; +use tempfile::tempdir; + +#[test] +fn test_config_defaults() { + let config = Config::default(); + + // Check that default distributions exist + assert!(config.distros.contains_key("centos8")); + assert!(config.distros.contains_key("ubuntu2004")); + + // Check default settings + assert_eq!(config.defaults.memory_mb, 1024); + assert_eq!(config.defaults.vcpus, 1); + assert_eq!(config.defaults.disk_size_gb, 10); +} + +#[test] +fn test_config_serialization_deserialization() -> Result<()> { + // Create a temporary directory for the test + let temp_dir = tempdir()?; + let config_path = temp_dir.path().join("test-config.toml"); + + // Create a test configuration + let mut test_distros = HashMap::new(); + test_distros.insert("test-distro".to_string(), kvm_install_vm::vm::DistroInfo { + qcow_filename: "test-image.qcow2".to_string(), + os_variant: "test-os".to_string(), + image_url: "https://example.com/images".to_string(), + login_user: "testuser".to_string(), + sudo_group: "wheel".to_string(), + cloud_init_disable: "systemctl disable cloud-init".to_string(), + }); + + let test_defaults = DefaultConfig { + memory_mb: 2048, + vcpus: 2, + disk_size_gb: 20, + image_dir: "/tmp/test-images".to_string(), + vm_dir: "/tmp/test-vms".to_string(), + dns_domain: "test.local".to_string(), + timezone: "UTC".to_string(), + }; + + let original_config = Config { + distros: test_distros, + defaults: test_defaults, + }; + + // Save and then reload the configuration + original_config.save_to_file(&config_path)?; + let loaded_config = Config::from_file(&config_path)?; + + // Verify the loaded configuration matches the original + assert_eq!(loaded_config.distros.len(), original_config.distros.len()); + assert!(loaded_config.distros.contains_key("test-distro")); + assert_eq!( + loaded_config.distros["test-distro"].qcow_filename, + "test-image.qcow2" + ); + assert_eq!(loaded_config.defaults.memory_mb, 2048); + assert_eq!(loaded_config.defaults.vcpus, 2); + + Ok(()) +} + +#[test] +fn test_config_from_toml_string() -> Result<()> { + // Define a test TOML configuration + let toml_str = r#" + [distros.test-distro] + qcow_filename = "test-image.qcow2" + os_variant = "test-os" + image_url = "https://example.com/images" + login_user = "testuser" + sudo_group = "wheel" + cloud_init_disable = "systemctl disable cloud-init" + + [defaults] + memory_mb = 4096 + vcpus = 4 + disk_size_gb = 40 + image_dir = "/custom/images" + vm_dir = "/custom/vms" + dns_domain = "custom.local" + timezone = "America/New_York" + "#; + + // Parse the TOML string + let config: Config = toml::from_str(toml_str)?; + + // Verify the configuration + assert_eq!(config.distros.len(), 1); + assert!(config.distros.contains_key("test-distro")); + assert_eq!(config.defaults.memory_mb, 4096); + assert_eq!(config.defaults.vcpus, 4); + assert_eq!(config.defaults.timezone, "America/New_York"); + + Ok(()) +} + +#[test] +fn test_get_distro() -> Result<()> { + let config = Config::default(); + + // Test existing distro + let centos = config.get_distro("centos8")?; + assert_eq!(centos.os_variant, "centos8"); + + // Test non-existent distro + let result = config.get_distro("nonexistent-distro"); + assert!(result.is_err()); + + Ok(()) +} \ No newline at end of file diff --git a/tests/image_manager_tests.rs b/tests/image_manager_tests.rs new file mode 100644 index 0000000..d5cce7a --- /dev/null +++ b/tests/image_manager_tests.rs @@ -0,0 +1,125 @@ +// tests/image_manager_tests.rs - Fixed version +use anyhow::Result; +use kvm_install_vm::vm::{DistroInfo, ImageManager}; +use std::fs; +use tempfile::tempdir; +use tokio::runtime::Runtime; + +// Helper function to create a test distro info +fn create_test_distro() -> DistroInfo { + DistroInfo { + qcow_filename: "test-image.qcow2".to_string(), + os_variant: "test-os".to_string(), + image_url: "https://example.com/images".to_string(), + login_user: "testuser".to_string(), + sudo_group: "wheel".to_string(), + cloud_init_disable: "systemctl disable cloud-init".to_string(), + } +} + +#[test] +fn test_image_manager_initialization() { + let temp_dir = tempdir().unwrap(); + let image_manager = ImageManager::new(temp_dir.path()); + + // Test that the image directory is set correctly + assert_eq!( + image_manager.get_image_path(&create_test_distro()), + temp_dir.path().join("test-image.qcow2") + ); +} + +#[test] +fn test_image_existence_check() -> Result<()> { + let temp_dir = tempdir()?; + let image_manager = ImageManager::new(temp_dir.path()); + let distro = create_test_distro(); + + // Initially, the image should not exist + assert!(!image_manager.image_exists(&distro)); + + // Create an empty file at the image path + let image_path = temp_dir.path().join("test-image.qcow2"); + fs::write(&image_path, b"test content")?; + + // Now the image should be reported as existing + assert!(image_manager.image_exists(&distro)); + + Ok(()) +} + +// This test is marked as ignored because it would attempt to download +// a real cloud image, which we don't want in automated testing +#[test] +#[ignore] +fn test_ensure_image() -> Result<()> { + let rt = Runtime::new()?; + let temp_dir = tempdir()?; + let image_manager = ImageManager::new(temp_dir.path()); + + // This distro has a real URL that would be downloaded + let distro = DistroInfo { + qcow_filename: "cirros-0.5.1-x86_64-disk.img".to_string(), + os_variant: "cirros".to_string(), + image_url: "http://download.cirros-cloud.net/0.5.1".to_string(), + login_user: "cirros".to_string(), + sudo_group: "wheel".to_string(), + cloud_init_disable: "systemctl disable cloud-init".to_string(), + }; + + // Use the tokio runtime to run the async function + let image_path = rt.block_on(image_manager.ensure_image(&distro))?; + + // Verify the image was downloaded + assert!(image_path.exists()); + assert!(fs::metadata(&image_path)?.len() > 0); + + Ok(()) +} + +#[test] +fn test_prepare_vm_disk() -> Result<()> { + // Skip if qemu-img is not available + if std::process::Command::new("qemu-img").arg("--version").output().is_err() { + println!("Skipping test_prepare_vm_disk: qemu-img not available"); + return Ok(()); + } + + let temp_dir = tempdir()?; + let image_manager = ImageManager::new(temp_dir.path()); + + // Create a dummy base image + let base_image = temp_dir.path().join("base.qcow2"); + std::process::Command::new("qemu-img") + .args(&["create", "-f", "qcow2", &base_image.to_string_lossy(), "1G"]) + .output()?; + + // Create VM directory + let vm_dir = temp_dir.path().join("vms/test-vm"); + fs::create_dir_all(&vm_dir)?; + + // Prepare VM disk + let disk_path = image_manager.prepare_vm_disk( + &base_image, + &vm_dir, + "test-vm", + 5 // 5GB disk + )?; + + // Verify the disk was created + assert!(disk_path.exists()); + + // Check disk properties with qemu-img info + let output = std::process::Command::new("qemu-img") + .args(&["info", "--output=json", &disk_path.to_string_lossy()]) + .output()?; + + let info_str = String::from_utf8(output.stdout)?; + assert!(info_str.contains("qcow2")); + + // Fix: Convert Cow to a regular str for comparison + let base_path_str = base_image.to_string_lossy().to_string(); + assert!(info_str.contains(&base_path_str)); + + Ok(()) +} \ No newline at end of file diff --git a/tests/integration_test.rs b/tests/integration_test.rs new file mode 100644 index 0000000..5e49ce6 --- /dev/null +++ b/tests/integration_test.rs @@ -0,0 +1,120 @@ +// tests/integration_test.rs +use anyhow::Result; +use kvm_install_vm::{ + vm::{DistroInfo, ImageManager, VirtualMachine}, + cloudinit::CloudInitManager, +}; +use std::fs; +use tempfile::tempdir; + +// This test combines multiple components but doesn't actually create a VM +// It prepares everything up to the point of VM creation +#[test] +fn test_vm_preparation_flow() -> Result<()> { + // Skip if qemu-img is not available + if std::process::Command::new("qemu-img").arg("--version").output().is_err() { + println!("Skipping test_vm_preparation_flow: qemu-img not available"); + return Ok(()); + } + + // Skip if neither genisoimage nor mkisofs is available + let has_iso_tool = std::process::Command::new("genisoimage").arg("--version").output().is_ok() || + std::process::Command::new("mkisofs").arg("--version").output().is_ok(); + + if !has_iso_tool { + println!("Skipping test_vm_preparation_flow: neither genisoimage nor mkisofs available"); + return Ok(()); + } + + // Create temporary directories + let temp_dir = tempdir()?; + let image_dir = temp_dir.path().join("images"); + let vm_dir = temp_dir.path().join("vms"); + + fs::create_dir_all(&image_dir)?; + fs::create_dir_all(&vm_dir)?; + + // Create a test distro + let distro = DistroInfo { + qcow_filename: "test-integration.qcow2".to_string(), + os_variant: "generic".to_string(), + image_url: "http://example.com".to_string(), + login_user: "testuser".to_string(), + sudo_group: "wheel".to_string(), + cloud_init_disable: "systemctl disable cloud-init".to_string(), + }; + + // Create a base image (since we won't download one) + let base_image = image_dir.join(&distro.qcow_filename); + std::process::Command::new("qemu-img") + .args(&["create", "-f", "qcow2", &base_image.to_string_lossy(), "1G"]) + .output()?; + + // Initialize image manager + let image_manager = ImageManager::new(&image_dir); + + // Prepare VM directory + let vm_name = "test-integration-vm"; + let vm_dir_path = vm_dir.join(vm_name); + fs::create_dir_all(&vm_dir_path)?; + + // Prepare VM disk + let disk_path = image_manager.prepare_vm_disk( + &base_image, + &vm_dir_path, + vm_name, + 5 + )?; + + // Create mock SSH key + let ssh_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7RXIKhCmT... test@example.com"; + + // Create cloud-init configuration + let (user_data, meta_data) = CloudInitManager::create_cloud_init_config( + vm_name, + "test.local", + ssh_key, + "testuser", + "UTC", + "wheel", + "systemctl disable cloud-init" + )?; + + // Create cloud-init ISO + let iso_path = CloudInitManager::create_cloud_init_iso( + &vm_dir_path, + vm_name, + &user_data, + &meta_data + )?; + + // Initialize VM (but don't create it) + let vm = VirtualMachine::new( + vm_name.to_string(), + 2, + 1024, + 5, + disk_path.to_string_lossy().to_string(), + ); + + // Since we can't call generate_domain_xml() directly, we'll verify the + // components we've prepared instead + + // Verify the preparation was successful + assert!(disk_path.exists()); + assert!(iso_path.exists()); + + // We can verify the VM setup parameters + assert_eq!(vm.name, "test-integration-vm"); + assert_eq!(vm.vcpus, 2); + assert_eq!(vm.memory_mb, 1024); + assert_eq!(vm.disk_size_gb, 5); + + // For a more complete test that would require libvirt, we could: + // 1. Connect to libvirt + // 2. Create the VM + // 3. Inspect the actual XML via virsh + // But we'll skip that to keep this a non-libvirt test + + Ok(()) +} \ No newline at end of file diff --git a/tests/list_vms.rs b/tests/list_vms_tests.rs similarity index 100% rename from tests/list_vms.rs rename to tests/list_vms_tests.rs diff --git a/tests/vm_tests2.rs b/tests/vm_tests2.rs new file mode 100644 index 0000000..addf227 --- /dev/null +++ b/tests/vm_tests2.rs @@ -0,0 +1,185 @@ +use anyhow::Result; +use kvm_install_vm::vm::{VirtualMachine, DomainState}; +use tempfile::tempdir; + +// Test VM creation and initialization without actually interacting with libvirt +#[test] +fn test_vm_initialization() { + let vm = VirtualMachine::new( + "test-vm".to_string(), + 2, + 1024, + 10, + "/tmp/test-vm.qcow2".to_string(), + ); + + assert_eq!(vm.name, "test-vm"); + assert_eq!(vm.vcpus, 2); + assert_eq!(vm.memory_mb, 1024); + assert_eq!(vm.disk_size_gb, 10); + assert_eq!(vm.disk_path, "/tmp/test-vm.qcow2"); + assert!(vm.connection.is_none()); +} + +// Since generate_domain_xml is private, we'll test indirectly through create() +// This test is marked as ignored because it requires libvirt +#[test] +#[ignore] +fn test_domain_creation_xml() -> Result<()> { + // Create a temporary directory for disk images + let temp_dir = tempdir()?; + let disk_path = temp_dir.path().join("test-xml-vm.qcow2"); + + // Create a test disk image + std::process::Command::new("qemu-img") + .args(&[ + "create", + "-f", "qcow2", + &disk_path.to_string_lossy(), + "1G" + ]) + .output()?; + + // Create VM + let mut vm = VirtualMachine::new( + "test-xml-vm".to_string(), + 2, + 1024, + 10, + disk_path.to_string_lossy().to_string(), + ); + + // Connect to libvirt + vm.connect(None)?; + + + // Use virsh to dump and inspect XML + // This is a workaround since we can't call generate_domain_xml directly + let output = std::process::Command::new("virsh") + .args(&[ + "-c", "qemu:///session", + "dumpxml", + "test-xml-vm", + ]) + .output()?; + + if output.status.success() { + let xml = String::from_utf8(output.stdout)?; + + // Check for relevant XML elements + assert!(xml.contains("test-xml-vm")); + assert!(xml.contains("")); + assert!(xml.contains("")); + assert!(!xml.contains("")); + } + + // Clean up + let _ = VirtualMachine::destroy("test-xml-vm", None, true); + + Ok(()) +} + +// The following tests require libvirt to be running +// They're marked as ignored so they don't run in automated testing + +#[test] +#[ignore] +fn test_connect_to_libvirt() -> Result<()> { + let mut vm = VirtualMachine::new( + "test-connect-vm".to_string(), + 1, + 512, + 1, + "/tmp/test-connect-vm.qcow2".to_string(), + ); + + vm.connect(None)?; + assert!(vm.connection.is_some()); + + Ok(()) +} + +#[test] +#[ignore] +fn test_domain_list_and_print() -> Result<()> { + // Test the domain listing functionality + let domains = VirtualMachine::list_domains(None)?; + + // Print the domains for debug purposes + println!("Found {} domains:", domains.len()); + for domain in &domains { + println!( + "Domain: {}, ID: {:?}, State: {:?}", + domain.name, domain.id, domain.state + ); + + // State consistency checks + if domain.state == DomainState::Shutoff { + assert_eq!(domain.id, None); + } + + if domain.state == DomainState::Running { + assert!(domain.id.is_some()); + } + } + + // Test the print function (just make sure it doesn't crash) + VirtualMachine::print_domain_list(None, true, false, false)?; + + Ok(()) +} + +// This test is complex and potentially disruptive +// It creates and then destroys a real VM, so use with caution +#[test] +#[ignore] +fn test_create_and_destroy_vm() -> Result<()> { + // Create a temporary directory for disk images + let temp_dir = tempdir()?; + let disk_path = temp_dir.path().join("test-create-destroy.qcow2"); + + // Create a test disk image + std::process::Command::new("qemu-img") + .args(&[ + "create", + "-f", "qcow2", + &disk_path.to_string_lossy(), + "1G" + ]) + .output()?; + + // Create VM + let mut vm = VirtualMachine::new( + "test-create-destroy".to_string(), + 1, + 512, + 1, + disk_path.to_string_lossy().to_string(), + ); + + vm.connect(None)?; + + // Create the VM + let domain = vm.create()?; + + // Verify domain exists + let domain_name = domain.get_name()?; + assert_eq!(domain_name, "test-create-destroy"); + + // Try to destroy it + VirtualMachine::destroy("test-create-destroy", None, true)?; + + // Verify it's gone using virsh + let output = std::process::Command::new("virsh") + .args(&[ + "-c", "qemu:///session", + "dominfo", + "test-create-destroy", + ]) + .output()?; + + assert!(!output.status.success()); + + Ok(()) +} \ No newline at end of file