[PATCH] p2v: Allow virt-v2v input and output drivers containing '-' (RHBZ#1590220).
by Richard W.M. Jones
The new ‘-o rhv-upload’ output mode contains a '-' character in the
name, but the regular expression which matched the output of the
virt-v2v command did not recognize '-' as a valid character. It ended
up mapping this to just "rhv" meaning two "rhv" entries would appear
in the list of output drivers.
Thanks: Ming Xie.
---
p2v/ssh.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/p2v/ssh.c b/p2v/ssh.c
index d2699fffd..2fcf0ef3e 100644
--- a/p2v/ssh.c
+++ b/p2v/ssh.c
@@ -181,8 +181,8 @@ compile_regexps (void)
0);
COMPILE (feature_libguestfs_rewrite_re, "libguestfs-rewrite", 0);
COMPILE (feature_colours_option_re, "colours-option", 0);
- COMPILE (feature_input_re, "input:((?:\\w)*)", 0);
- COMPILE (feature_output_re, "output:((?:\\w)*)", 0);
+ COMPILE (feature_input_re, "input:((?:[-\\w])*)", 0);
+ COMPILE (feature_output_re, "output:((?:[-\\w])*)", 0);
COMPILE (portfwd_re, "Allocated port ((?:\\d)+) for remote forward", 0);
}
--
2.16.2
6 years, 5 months
Fwd: virt-v2v-copy-to-local failed if dd does not support status=progress
by 朱金贺
On Tue, Jun 12, 2018 at 04:51:57AM -0700, zhujinhe wrote: > If dd does not support status=progress, copy process will abort at the end. This is totally misguided. > We can use -q as a workaround in this circumstance, but it is frightening to newbee like me. Maybe we should improve this. > > suspicion: > ``` > if shell_command cmd <> 0 then > error (f_"ssh copy command failed, see earlier errors"); > ``` > > detail: > ``` > shell > virt-v2v-copy-to-local -v -ic xen+ssh://myxen_server guest > [ 0.0] Fetching the remote libvirt XML metadata ... > [ 1.6] Parsing the remote libvirt XML metadata ... > [ 1.6] Copying remote disk 1/2 to guest-disk1 > dd: invalid status flag: ‘progress’ > Try 'dd --help' for more information. > 40960+0 records in > 40960+0 records out > 42949672960 bytes (43 GB) copied, 876.05 seconds, 49.0 MB/s > virt-v2v-copy-to-local: error: ssh copy command failed, see earlier errors > > ``` This feature was added to the dd command in coreutils in Sept 2014, nearly 4 years ago. Which Linux distribution are you using? Rich.-----------------------------------------------------------------
[root@localhost /]# rpm -qf /bin/dd
coreutils-8.22-11.el7.x86_64
[root@localhost /]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
6 years, 5 months
Fwd: virt-v2v-copy-to-local failed if dd does not support status=progress
by Richard W.M. Jones
On Tue, Jun 12, 2018 at 04:51:57AM -0700, zhujinhe wrote:
> If dd does not support status=progress, copy process will abort at the end. This is totally misguided.
> We can use -q as a workaround in this circumstance, but it is frightening to newbee like me. Maybe we should improve this.
>
> suspicion:
> ```
> if shell_command cmd <> 0 then
> error (f_"ssh copy command failed, see earlier errors");
> ```
>
> detail:
> ```
> shell > virt-v2v-copy-to-local -v -ic xen+ssh://myxen_server guest
> [ 0.0] Fetching the remote libvirt XML metadata ...
> [ 1.6] Parsing the remote libvirt XML metadata ...
> [ 1.6] Copying remote disk 1/2 to guest-disk1
> dd: invalid status flag: ‘progress’
> Try 'dd --help' for more information.
> 40960+0 records in
> 40960+0 records out
> 42949672960 bytes (43 GB) copied, 876.05 seconds, 49.0 MB/s
> virt-v2v-copy-to-local: error: ssh copy command failed, see earlier errors
>
> ```
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/
6 years, 5 months
Bug report.
by Yingtong Liu
SELinux: sh: 1: getenforce: not found
guestfs_get_append: (null)
guestfs_get_autosync: 1
guestfs_get_backend: direct
guestfs_get_backend_settings: []
guestfs_get_cachedir: /var/tmp
guestfs_get_direct: 0
guestfs_get_hv: /usr/bin/qemu-system-x86_64
guestfs_get_memsize: 500
guestfs_get_network: 0
guestfs_get_path: /usr/lib/x86_64-linux-gnu/guestfs
guestfs_get_pgroup: 0
guestfs_get_program: libguestfs-test-tool
guestfs_get_recovery_proc: 1
guestfs_get_selinux: 0
guestfs_get_smp: 1
guestfs_get_tmpdir: /tmp
guestfs_get_trace: 0
guestfs_get_verbose: 1
host_cpu: x86_64
Launching appliance, timeout set to 600 seconds.
libguestfs: launch: program=libguestfs-test-tool
libguestfs: launch: version=1.32.2
libguestfs: launch: backend registered: unix
libguestfs: launch: backend registered: uml
libguestfs: launch: backend registered: libvirt
libguestfs: launch: backend registered: direct
libguestfs: launch: backend=direct
libguestfs: launch: tmpdir=/tmp/libguestfsDmE6MS
libguestfs: launch: umask=0002
libguestfs: launch: euid=1000
libguestfs: [00000ms] begin building supermin appliance
libguestfs: [00000ms] run supermin
libguestfs: command: run: /usr/bin/supermin
libguestfs: command: run: \ --build
libguestfs: command: run: \ --verbose
libguestfs: command: run: \ --if-newer
libguestfs: command: run: \ --lock /var/tmp/.guestfs-1000/lock
libguestfs: command: run: \ --copy-kernel
libguestfs: command: run: \ -f ext2
libguestfs: command: run: \ --host-cpu x86_64
libguestfs: command: run: \ /usr/lib/x86_64-linux-gnu/guestfs/supermin.d
libguestfs: command: run: \ -o /var/tmp/.guestfs-1000/appliance.d
supermin: version: 5.1.14
supermin: package handler: debian/dpkg
supermin: acquiring lock on /var/tmp/.guestfs-1000/lock
supermin: if-newer: output does not need rebuilding
libguestfs: [00010ms] finished building supermin appliance
libguestfs: [00010ms] begin testing qemu features
libguestfs: command: run: /usr/bin/qemu-system-x86_64
libguestfs: command: run: \ -display none
libguestfs: command: run: \ -help
libguestfs: command: run: /usr/bin/qemu-system-x86_64
libguestfs: command: run: \ -display none
libguestfs: command: run: \ -version
libguestfs: qemu version 2.5
libguestfs: command: run: /usr/bin/qemu-system-x86_64
libguestfs: command: run: \ -display none
libguestfs: command: run: \ -machine accel=kvm:tcg
libguestfs: command: run: \ -device ?
libguestfs: [00149ms] finished testing qemu features
[00150ms] /usr/bin/qemu-system-x86_64 \
-global virtio-blk-pci.scsi=off \
-nodefconfig \
-enable-fips \
-nodefaults \
-display none \
-machine accel=kvm:tcg \
-cpu host \
-m 500 \
-no-reboot \
-rtc driftfix=slew \
-no-hpet \
-global kvm-pit.lost_tick_policy=discard \
-kernel /var/tmp/.guestfs-1000/appliance.d/kernel \
-initrd /var/tmp/.guestfs-1000/appliance.d/initrd \
-device virtio-scsi-pci,id=scsi \
-drive
file=/tmp/libguestfsDmE6MS/scratch.1,cache=unsafe,format=raw,id=hd0,if=none
\
-device scsi-hd,drive=hd0 \
-drive
file=/var/tmp/.guestfs-1000/appliance.d/root,snapshot=on,id=appliance,cache=unsafe,if=none
\
-device scsi-hd,drive=appliance \
-device virtio-serial-pci \
-serial stdio \
-device sga \
-chardev socket,path=/tmp/libguestfsDmE6MS/guestfsd.sock,id=channel0 \
-device virtserialport,chardev=channel0,name=org.libguestfs.channel.0 \
-append 'panic=1 console=ttyS0 udevtimeout=6000 udev.event-timeout=6000
no_timer_check acpi=off printk.time=1 cgroup_disable=memory root=/dev/sdb
selinux=0 guestfs_verbose=1 TERM=xterm-256color'
Could not open option rom 'sgabios.bin': No such file or directory
KVM_GET_IRQCHIP failed: Unknown error -25
libguestfs: error: appliance closed the connection unexpectedly, see
earlier error messages
libguestfs: child_cleanup: 0x16a12d0: child process died
libguestfs: sending SIGTERM to process 36548
libguestfs: error: /usr/bin/qemu-system-x86_64 killed by signal 6
(Aborted), see debug messages above
libguestfs: error: guestfs_launch failed, see earlier error messages
libguestfs-test-tool: failed to launch appliance
libguestfs: closing guestfs handle 0x16a12d0 (state 0)
libguestfs: command: run: rm
libguestfs: command: run: \ -rf /tmp/libguestfsDmE6MS
6 years, 5 months
[PATCH] v2v: -o rhv-upload: Set inactivity timeout (RHBZ#1586198).
by Richard W.M. Jones
This increases the inactivity timeout for transfers from the default
(60 seconds) to 1 hour, so that we should never hit it for ordinary
transfers.
Note this requires oVirt >= 4.3.0 although the same change was
backported to the 4.2 branch in later releases. The corresponding
oVirt fix was in https://bugzilla.redhat.com/1563278
I also replaced the deprecated ‘image’ parameter with ‘disk’.
Thanks: Nir Soffer, Daniel Erez.
---
v2v/rhv-upload-plugin.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
index c3de7d555..44972de21 100644
--- a/v2v/rhv-upload-plugin.py
+++ b/v2v/rhv-upload-plugin.py
@@ -123,9 +123,8 @@ def open(readonly):
# Create a new image transfer.
transfer = transfers_service.add(
types.ImageTransfer(
- image = types.Image(
- id = disk.id
- )
+ disk = types.Disk(id = disk.id),
+ inactivity_timeout = 0,
)
)
debug("transfer.id = %r" % transfer.id)
--
2.16.2
6 years, 5 months
[PATCH] v2v: parse_libvirt_xml: Simplify code by using xpath_get_nodes utility fn.
by Richard W.M. Jones
No functional change.
---
v2v/parse_libvirt_xml.ml | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/v2v/parse_libvirt_xml.ml b/v2v/parse_libvirt_xml.ml
index 57e741574..03a201e77 100644
--- a/v2v/parse_libvirt_xml.ml
+++ b/v2v/parse_libvirt_xml.ml
@@ -123,14 +123,8 @@ let parse_libvirt_xml ?conn xml =
| _, _, _ -> None in
let features =
- let features = ref [] in
- let obj = Xml.xpath_eval_expression xpathctx "/domain/features/*" in
- let nr_nodes = Xml.xpathobj_nr_nodes obj in
- for i = 0 to nr_nodes-1 do
- let node = Xml.xpathobj_node obj i in
- List.push_front (Xml.node_name node) features
- done;
- !features in
+ let nodes = xpath_get_nodes xpathctx "/domain/features/*" in
+ List.map Xml.node_name nodes in
let display =
let obj = Xml.xpath_eval_expression xpathctx "/domain/devices/graphics" in
--
2.16.2
6 years, 5 months