pub fn create_gic(
    vm: &VmFd,
    vcpu_count: u64,
    version: Option<GICVersion>,
) -> Result<Box<dyn GICDevice>> {
    match version {
        Some(GICVersion::GICV2) => GICv2::create(vm, vcpu_count),
        Some(GICVersion::GICV3) => GICv3::create(vm, vcpu_count),
        None => GICv3::create(vm, vcpu_count).or_else(|_| GICv2::create(vm, vcpu_count)),
    }
}
/// If "version" parameter is "None" the function will try to create by default a GICv3 device.
/// If that fails it will try to fall-back to a GICv2 device.
/// If version is Some the function will try to create a device of exactly the specified version.
If "version" parameter is "None" the function will try to create by default a GICv3 device.
If that fails it will try to fall-back to a GICv2 device.
If version is Some the function will try to create a device of exactly the specified version.
If " version " parameter is " None " the function will try to create by default a GICv3 device . If that fails it will try to fall - back to a GICv2 device . If version is Some the function will try to create a device of exactly the specified version .
pub fn create_gic(
    vm: &VmFd,
    vcpu_count: u64,
    version: Option<GICVersion>,
) -> Result<Box<dyn GICDevice>> {
    match version {
        Some(GICVersion::GICV2) => GICv2::create(vm, vcpu_count),
        Some(GICVersion::GICV3) => GICv3::create(vm, vcpu_count),
        None => GICv3::create(vm, vcpu_count).or_else(|_| GICv2::create(vm, vcpu_count)),
    }
}
pub fn create_gic ( vm : & VmFd , vcpu_count : u64 , version : Option < GICVersion > , ) -> Result < Box < dyn GICDevice > > { match version { Some ( GICVersion :: GICV2 ) => GICv2 :: create ( vm , vcpu_count ) , Some ( GICVersion :: GICV3 ) => GICv3 :: create ( vm , vcpu_count ) , None => GICv3 :: create ( vm , vcpu_count ) . or_else ( | _ | GICv2 :: create ( vm , vcpu_count ) ) , } }
If "version" parameter is "None" the function will try to create by default a GICv3 device.
If " version " parameter is " None " the function will try to create by default a GICv3 device .
vm
&VmFd
vcpu_count
u64
version
Option<GICVersion>
vm
&VmFd
vcpu_count
u64
version
Option<GICVersion>