mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
virt-convert: Don't print 'convert' output with --print-xml
This commit is contained in:
parent
ceab99cf7b
commit
eca6cd9471
@ -1,5 +1,3 @@
|
||||
Copying test.ovf-disk1.vmdk to /tmp/test.ovf-disk1
|
||||
Copying testfile to /tmp/testfile
|
||||
<domain type="kvm">
|
||||
<name>test.ovf</name>
|
||||
<uuid>00000000-1111-2222-3333-444444444444</uuid>
|
||||
|
@ -1,4 +1,3 @@
|
||||
Running /usr/bin/qemu-img convert -O qcow2 fedora.vmdk /var/lib/libvirt/images/fedora.qcow2
|
||||
<domain type="kvm">
|
||||
<name>fedora</name>
|
||||
<uuid>00000000-1111-2222-3333-444444444444</uuid>
|
||||
|
@ -97,9 +97,12 @@ def main(conn=None):
|
||||
options.quiet = True
|
||||
|
||||
conscb = options.autoconsole and cli.show_console_for_guest or None
|
||||
print_cb = print_stdout
|
||||
if options.quiet:
|
||||
print_cb = None
|
||||
|
||||
converter = VirtConverter(conn, options.input,
|
||||
input_name=options.input_format, print_cb=print_stdout)
|
||||
input_name=options.input_format, print_cb=print_cb)
|
||||
try:
|
||||
converter.convert_disks(options.disk_format or "none",
|
||||
destdir=options.destination, dry=options.dry)
|
||||
|
@ -174,15 +174,20 @@ class VirtConverter(object):
|
||||
"""
|
||||
Public interface for actually performing the conversion
|
||||
"""
|
||||
def __init__(self, conn, input_file, print_cb=None, input_name=None):
|
||||
def __init__(self, conn, input_file, print_cb=-1, input_name=None):
|
||||
self.conn = conn
|
||||
self._err_clean = []
|
||||
self._force_clean = []
|
||||
|
||||
if print_cb is None:
|
||||
if print_cb == -1:
|
||||
def cb(msg):
|
||||
print msg
|
||||
print_cb = cb
|
||||
if print_cb is None:
|
||||
def cb(msg):
|
||||
ignore = msg
|
||||
pass
|
||||
print_cb = cb
|
||||
self.print_cb = print_cb
|
||||
|
||||
parser = None
|
||||
|
Loading…
Reference in New Issue
Block a user