Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package krunvm for openSUSE:Factory checked in at 2023-01-10 14:59:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/krunvm (Old) and /work/SRC/openSUSE:Factory/.krunvm.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "krunvm" Tue Jan 10 14:59:38 2023 rev:8 rq:1057129 version:0.2.3+git12dac81 Changes: -------- --- /work/SRC/openSUSE:Factory/krunvm/krunvm.changes 2022-12-08 16:51:10.451479516 +0100 +++ /work/SRC/openSUSE:Factory/.krunvm.new.32243/krunvm.changes 2023-01-10 15:00:04.961296215 +0100 @@ -1,0 +2,7 @@ +Tue Jan 03 10:36:08 UTC 2023 - fcro...@suse.com + +- Update to version 0.2.3+git12dac81: + * Bump version to v0.2.3 + * macos: add support for creating x86 microVMs + +------------------------------------------------------------------- Old: ---- krunvm-0.2.2+gite67d0ea.obscpio New: ---- krunvm-0.2.3+git12dac81.obscpio krunvm-0.2.3+git12dac81.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ krunvm.spec ++++++ --- /var/tmp/diff_new_pack.ZQrBxU/_old 2023-01-10 15:00:05.973302039 +0100 +++ /var/tmp/diff_new_pack.ZQrBxU/_new 2023-01-10 15:00:05.977302062 +0100 @@ -1,7 +1,7 @@ # # spec file for package krunvm # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: krunvm -Version: 0.2.2+gite67d0ea +Version: 0.2.3+git12dac81 Release: 0 Summary: Manage lightweight VMs created from OCI images License: Apache-2.0 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.ZQrBxU/_old 2023-01-10 15:00:06.009302246 +0100 +++ /var/tmp/diff_new_pack.ZQrBxU/_new 2023-01-10 15:00:06.013302270 +0100 @@ -1,7 +1,7 @@ <services> <service name="obs_scm" mode="disabled"> <param name="scm">git</param> - <param name="revision">refs/tags/v0.2.2</param> + <param name="revision">refs/tags/v0.2.3</param> <param name="url">https://github.com/containers/krunvm.git</param> <param name="versionformat">@PARENT_TAG@+git%h</param> <param name="changesgenerate">enable</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.ZQrBxU/_old 2023-01-10 15:00:06.029302362 +0100 +++ /var/tmp/diff_new_pack.ZQrBxU/_new 2023-01-10 15:00:06.033302385 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/containers/krunvm.git</param> - <param name="changesrevision">e67d0ea06536f0e5559811fe46d240101bd47350</param></service></servicedata> + <param name="changesrevision">12dac810ecdc1a2519ac46d82e0c2739cef9f165</param></service></servicedata> (No newline at EOF) ++++++ krunvm-0.2.2+gite67d0ea.obscpio -> krunvm-0.2.3+git12dac81.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunvm-0.2.2+gite67d0ea/Cargo.lock new/krunvm-0.2.3+git12dac81/Cargo.lock --- old/krunvm-0.2.2+gite67d0ea/Cargo.lock 2022-08-16 18:03:53.000000000 +0200 +++ new/krunvm-0.2.3+git12dac81/Cargo.lock 2022-11-07 16:27:45.000000000 +0100 @@ -161,7 +161,7 @@ [[package]] name = "krunvm" -version = "0.2.2" +version = "0.2.3" dependencies = [ "clap", "confy", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunvm-0.2.2+gite67d0ea/Cargo.toml new/krunvm-0.2.3+git12dac81/Cargo.toml --- old/krunvm-0.2.2+gite67d0ea/Cargo.toml 2022-08-16 18:03:53.000000000 +0200 +++ new/krunvm-0.2.3+git12dac81/Cargo.toml 2022-11-07 16:27:45.000000000 +0100 @@ -1,6 +1,6 @@ [package] name = "krunvm" -version = "0.2.2" +version = "0.2.3" authors = ["Sergio Lopez <s...@redhat.com>"] description = "Create microVMs from OCI images" repository = "https://github.com/containers/krunvm" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunvm-0.2.2+gite67d0ea/src/create.rs new/krunvm-0.2.3+git12dac81/src/create.rs --- old/krunvm-0.2.2+gite67d0ea/src/create.rs 2022-08-16 18:03:53.000000000 +0200 +++ new/krunvm-0.2.3+git12dac81/src/create.rs 2022-11-07 16:27:45.000000000 +0100 @@ -3,6 +3,8 @@ use std::fs; use std::io::Write; +#[cfg(target_os = "macos")] +use std::path::Path; use std::process::Command; use super::utils::{ @@ -11,6 +13,9 @@ }; use crate::{ArgMatches, KrunvmConfig, VmConfig, APP_NAME}; +#[cfg(target_os = "macos")] +const KRUNVM_ROSETTA_FILE: &str = ".krunvm-rosetta"; + fn fix_resolv_conf(rootfs: &str, dns: &str) -> Result<(), std::io::Error> { let resolvconf_dir = format!("{}/etc/", rootfs); fs::create_dir_all(resolvconf_dir)?; @@ -62,7 +67,7 @@ } pub fn create(cfg: &mut KrunvmConfig, matches: &ArgMatches) { - let cpus = match matches.value_of("cpus") { + let mut cpus = match matches.value_of("cpus") { Some(c) => match c.parse::<u32>() { Err(_) => { println!("Invalid value for \"cpus\""); @@ -114,6 +119,47 @@ } let mut args = get_buildah_args(cfg, BuildahCommand::From); + + #[cfg(target_os = "macos")] + let force_x86 = matches.is_present("x86"); + + #[cfg(target_os = "macos")] + if force_x86 { + let home = match std::env::var("HOME") { + Err(e) => { + println!("Error reading \"HOME\" enviroment variable: {}", e); + std::process::exit(-1); + } + Ok(home) => home, + }; + + let path = format!("{}/{}", home, KRUNVM_ROSETTA_FILE); + if !Path::new(&path).is_file() { + println!( + " +To use Rosetta for Linux you need to create the file... + +{} + +...with the contents that the \"rosetta\" binary expects to be served from +its specific ioctl. + +For more information, please refer to this post: +https://threedots.ovh/blog/2022/06/quick-look-at-rosetta-on-linux/ +", + path + ); + std::process::exit(-1); + } + + if cpus != 1 { + println!("x86 microVMs on Aarch64 are restricted to 1 CPU"); + cpus = 1; + } + args.push("--arch".to_string()); + args.push("x86_64".to_string()); + } + args.push(image.to_string()); let output = match Command::new("buildah") @@ -161,6 +207,10 @@ let rootfs = mount_container(cfg, &vmcfg).unwrap(); export_container_config(cfg, &rootfs, image).unwrap(); fix_resolv_conf(&rootfs, dns).unwrap(); + #[cfg(target_os = "macos")] + if force_x86 { + _ = fs::create_dir(format!("{}/.rosetta", rootfs)); + } umount_container(cfg, &vmcfg).unwrap(); cfg.vmconfig_map.insert(name.clone(), vmcfg); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunvm-0.2.2+gite67d0ea/src/main.rs new/krunvm-0.2.3+git12dac81/src/main.rs --- old/krunvm-0.2.2+gite67d0ea/src/main.rs 2022-08-16 18:03:53.000000000 +0200 +++ new/krunvm-0.2.3+git12dac81/src/main.rs 2022-11-07 16:27:45.000000000 +0100 @@ -247,65 +247,6 @@ ), ) .subcommand( - App::new("create") - .about("Create a new microVM") - .arg( - Arg::with_name("cpus") - .long("cpus") - .help("Number of vCPUs") - .takes_value(true), - ) - .arg( - Arg::with_name("mem") - .long("mem") - .help("Amount of RAM in MiB") - .takes_value(true), - ) - .arg( - Arg::with_name("dns") - .long("dns") - .help("DNS server to use in the microVM") - .takes_value(true), - ) - .arg( - Arg::with_name("workdir") - .long("workdir") - .short("w") - .help("Working directory inside the microVM") - .takes_value(true) - .default_value(""), - ) - .arg( - Arg::with_name("volume") - .long("volume") - .short("v") - .help("Volume in form \"host_path:guest_path\" to be exposed to the guest") - .takes_value(true) - .multiple(true) - .number_of_values(1), - ) - .arg( - Arg::with_name("port") - .long("port") - .short("p") - .help("Port in format \"host_port:guest_port\" to be exposed to the host") - .takes_value(true) - .multiple(true) - .number_of_values(1), - ) - .arg( - Arg::with_name("name") - .long("name") - .help("Assign a name to the VM") - .takes_value(true), - ) - .arg( - Arg::with_name("IMAGE") - .help("OCI image to use as template") - .required(true), - ), - ) - .subcommand( App::new("delete").about("Delete an existing microVM").arg( Arg::with_name("NAME") .help("Name of the microVM to be deleted") @@ -348,6 +289,75 @@ ), ); + let mut create = App::new("create") + .about("Create a new microVM") + .arg( + Arg::with_name("cpus") + .long("cpus") + .help("Number of vCPUs") + .takes_value(true), + ) + .arg( + Arg::with_name("mem") + .long("mem") + .help("Amount of RAM in MiB") + .takes_value(true), + ) + .arg( + Arg::with_name("dns") + .long("dns") + .help("DNS server to use in the microVM") + .takes_value(true), + ) + .arg( + Arg::with_name("workdir") + .long("workdir") + .short("w") + .help("Working directory inside the microVM") + .takes_value(true) + .default_value(""), + ) + .arg( + Arg::with_name("volume") + .long("volume") + .short("v") + .help("Volume in form \"host_path:guest_path\" to be exposed to the guest") + .takes_value(true) + .multiple(true) + .number_of_values(1), + ) + .arg( + Arg::with_name("port") + .long("port") + .short("p") + .help("Port in format \"host_port:guest_port\" to be exposed to the host") + .takes_value(true) + .multiple(true) + .number_of_values(1), + ) + .arg( + Arg::with_name("name") + .long("name") + .help("Assign a name to the VM") + .takes_value(true), + ) + .arg( + Arg::with_name("IMAGE") + .help("OCI image to use as template") + .required(true), + ); + + if cfg!(target_os = "macos") { + create = create.arg( + Arg::with_name("x86") + .long("x86") + .short("x") + .help("Create a x86_64 microVM even on an Aarch64 host"), + ); + } + + app = app.subcommand(create); + let matches = app.clone().get_matches(); #[cfg(target_os = "macos")] ++++++ krunvm.obsinfo ++++++ --- /var/tmp/diff_new_pack.ZQrBxU/_old 2023-01-10 15:00:06.169303167 +0100 +++ /var/tmp/diff_new_pack.ZQrBxU/_new 2023-01-10 15:00:06.173303190 +0100 @@ -1,5 +1,5 @@ name: krunvm -version: 0.2.2+gite67d0ea -mtime: 1660665833 -commit: e67d0ea06536f0e5559811fe46d240101bd47350 +version: 0.2.3+git12dac81 +mtime: 1667834865 +commit: 12dac810ecdc1a2519ac46d82e0c2739cef9f165 ++++++ vendor.tar.zst ++++++ Binary files /var/tmp/diff_new_pack.ZQrBxU/_old and /var/tmp/diff_new_pack.ZQrBxU/_new differ