Such a default seems reasonable for most phys-to-virt conversions.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1590721
Signed-off-by: Laszlo Ersek <ler...@redhat.com>
Acked-by: Richard W.M. Jones <rjo...@redhat.com>
---

Notes:
    v2:
    
    - pick up Rich's A-b
    
    - resolve rebase conflicts due to dense_topo -> phys_topo renaming
    
    - we can drop this patch, per Daniel's comment
      
<https://listman.redhat.com/archives/libguestfs/2022-September/029841.html>

 generate-p2v-config.pl   | 2 +-
 main.c                   | 2 +-
 test-virt-p2v-cmdline.sh | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/generate-p2v-config.pl b/generate-p2v-config.pl
index 47487f7b0f35..625f62ad399e 100755
--- a/generate-p2v-config.pl
+++ b/generate-p2v-config.pl
@@ -238,7 +238,7 @@ use a randomly generated name.",
     shortopt => "", # ignored for booleans
     description => "
 Copy the physical machine's complete CPU topology (sockets, cores and
-threads) to the guest.  Disabled by default.  If disabled, the
+threads) to the guest.  This is the default.  If disabled, the
 C<p2v.vcpu.cores> setting takes effect.",
   ),
   "p2v.vcpu.cores" => manual_entry->new(
diff --git a/main.c b/main.c
index 6c44183b65b3..0fc837b4e0aa 100644
--- a/main.c
+++ b/main.c
@@ -291,7 +291,7 @@ set_config_defaults (struct config *config)
   }
   config->guestname = strdup (hostname);
 
-  config->vcpu.phys_topo = false;
+  config->vcpu.phys_topo = true;
 
   /* Defaults for #vcpus and memory are taken from the physical machine. */
   i = sysconf (_SC_NPROCESSORS_ONLN);
diff --git a/test-virt-p2v-cmdline.sh b/test-virt-p2v-cmdline.sh
index 79c3061b1e7c..d14302e65b4f 100755
--- a/test-virt-p2v-cmdline.sh
+++ b/test-virt-p2v-cmdline.sh
@@ -26,7 +26,7 @@ out=test-virt-p2v-cmdline.out
 rm -f $out
 
 # The Linux kernel command line.
-$VG virt-p2v --cmdline='p2v.server=localhost p2v.port=123 p2v.username=user 
p2v.password=secret p2v.skip_test_connection p2v.name=test p2v.vcpu.cores=4 
p2v.memory=1G p2v.disks=sda,sdb,sdc p2v.removable=sdd p2v.interfaces=eth0,eth1 
p2v.o=local p2v.oa=sparse p2v.oc=qemu:///session p2v.of=raw p2v.os=/var/tmp 
p2v.network=em1:wired,other p2v.dump_config_and_exit' > $out
+$VG virt-p2v --cmdline='p2v.server=localhost p2v.port=123 p2v.username=user 
p2v.password=secret p2v.skip_test_connection p2v.name=test 
p2v.vcpu.phys_topo=false p2v.vcpu.cores=4 p2v.memory=1G p2v.disks=sda,sdb,sdc 
p2v.removable=sdd p2v.interfaces=eth0,eth1 p2v.o=local p2v.oa=sparse 
p2v.oc=qemu:///session p2v.of=raw p2v.os=/var/tmp p2v.network=em1:wired,other 
p2v.dump_config_and_exit' > $out
 
 # For debugging purposes.
 cat $out

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs

Reply via email to