[package]
name = "StratoVirt"
version = "2.2.0"
authors = ["Huawei StratoVirt Team"]
edition = "2021"
description = "a lightweight hypervisor with low memory overhead and fast booting speed"
license = "Mulan PSL v2"

[dependencies]
thiserror = "1.0"
anyhow = "1.0"
capng = "0.2.2"
error-chain = "0.12.4"
kvm-ioctls = ">=0.11.0"
libc = "0.2"
log = "0.4"
vmm-sys-util = ">=0.10.0"
hypervisor = { path = "hypervisor" }
machine = { path = "machine" }
machine_manager = { path = "machine_manager" }
migration = { path = "migration" }
util = { path = "util" }
virtio = { path = "virtio" }
vhost_user_fs = { path = "vhost_user_fs" }
vfio = { path = "vfio" }

[target.'cfg(not(target_env = "musl"))'.dependencies]
vnc = { path = "vnc" }

[workspace]
members = [
    "address_space",
    "boot_loader",
    "cpu",
    "devices",
    "hypervisor",
    "machine",
    "machine_manager",
    "migration",
    "migration_derive",
    "pci",
    "sysbus",
    "util",
    "acpi",
    "virtio",
    "vhost_user_fs",
    "ozone",
    "vfio",
]

[[bin]]
name = "stratovirt"
path = "src/main.rs"

[[bin]]
name = "ozone"
path = "ozone/src/main.rs"

[[bin]]
name = "vhost_user_fs"
path = "vhost_user_fs/src/main.rs"

[features]
default = []
boot_time = ["machine/boot_time"]

[package.metadata.rpm.cargo]
buildflags = ["--release"]

[package.metadata.rpm.targets]
stratovirt = { path = "/usr/bin/stratovirt" }

[profile.dev]
panic = "abort"

[profile.release]
panic = "abort"
lto = true