Francesco Romani has posted comments on this change.
Change subject: virt: Make BIOS messages available on vmconsole
......................................................................
Patch Set 1:
(1 comment)
https://gerrit.ovirt.org/#/c/48404/1/vdsm/virt/vm.py
File vdsm/virt/vm.py:
Line 1590:
Line 1591: def _buildDomainXML(self):
Line 1592: for consoleDev in self._devices[hwclass.CONSOLE]:
Line 1593: if consoleDev.isSerial:
Line 1594: break
> nice refactoring, but not needed for this patch.
please discard this comment.
Line 1595: else:
Line 1596: consoleDev = None
Line 1597: self.conf['_serialConsoleAvailable'] = consoleDev is not None
Line 1598:
--
To view, visit https://gerrit.ovirt.org/48404
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc560d2562a913b7dba9a5c01952429459595973
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes
Francesco Romani has posted comments on this change.
Change subject: virt: Make BIOS messages available on vmconsole
......................................................................
Patch Set 1:
(1 comment)
https://gerrit.ovirt.org/#/c/48404/1/tests/vmTests.py
File tests/vmTests.py:
Line 1: #
Line 2: # Copyright IBM Corp. 2012
Line 3: # Copyright 2013-2015 Red Hat, Inc.
correct, but unneeded for this patch.
Line 4: #
Line 5: # This program is free software; you can redistribute it and/or modify
Line 6: # it under the terms of the GNU General Public License as published by
Line 7: # the Free Software Foundation; either version 2 of the License, or
--
To view, visit https://gerrit.ovirt.org/48404
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc560d2562a913b7dba9a5c01952429459595973
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes
Francesco Romani has posted comments on this change.
Change subject: virt: Make BIOS messages available on vmconsole
......................................................................
Patch Set 1:
(7 comments)
https://gerrit.ovirt.org/#/c/48404/1//COMMIT_MSG
Commit Message:
Line 14: This change is the first step towards the goal. It enables BIOS serial
Line 15: console interaction in a VM's XML domain description when a serial
Line 16: console is available.
Line 17:
Line 18: Note that at least oVirt Engine 3.6 snapshot is required to make the
this is true for oVirt/RHEV. For VDSM, is sufficient that the console is 'type'='serial'.
I think you should either mention both or just the latter in the commit message.
Line 19: functionality actually working. The reason is that access to BIOS
Line 20: messages requires presence of serial (not virtio) console.
Line 21:
Line 22: Change-Id: Ifc560d2562a913b7dba9a5c01952429459595973
https://gerrit.ovirt.org/#/c/48404/1/tests/vmTests.py
File tests/vmTests.py:
Line 1418: 'specParams': {'consoleType': console_type}},
Line 1419: with fake.VM(devices=devices, create_device_objects=True) as v:
Line 1420: dom_xml = v._buildDomainXML()
Line 1421: self.assertEqual('<bios useserial="yes"/>' in dom_xml,
Line 1422: use_serial)
Kudos for the test. However, I'd prefer something more like
testOSXMLBootMenu, which is more focused and doesn't test internal methods (_buildDomainXML)
Line 1423:
Line 1424:
Line 1425: def _load_xml(name):
Line 1426: test_path = os.path.realpath(__file__)
https://gerrit.ovirt.org/#/c/48404/1/vdsm/virt/vm.py
File vdsm/virt/vm.py:
Line 1: #
Line 2: # Copyright 2008-2015 Red Hat, Inc.
correct, but unneeded here
Line 3: #
Line 4: # This program is free software; you can redistribute it and/or modify
Line 5: # it under the terms of the GNU General Public License as published by
Line 6: # the Free Software Foundation; either version 2 of the License, or
Line 1590:
Line 1591: def _buildDomainXML(self):
Line 1592: for consoleDev in self._devices[hwclass.CONSOLE]:
Line 1593: if consoleDev.isSerial:
Line 1594: break
nice refactoring, but not needed for this patch.
Line 1595: else:
Line 1596: consoleDev = None
Line 1597: self.conf['_serialConsoleAvailable'] = consoleDev is not None
Line 1598:
Line 1593: if consoleDev.isSerial:
Line 1594: break
Line 1595: else:
Line 1596: consoleDev = None
Line 1597: self.conf['_serialConsoleAvailable'] = consoleDev is not None
we should avoid to add attributes to Vm.conf unless it is really needed. _hidden attributes are particularly troublesome, especially if short lived.
We need a better way to notify appendOs here.
Line 1598:
Line 1599: domxml = vmxml.Domain(self.conf, self.log, self.arch)
Line 1600: domxml.appendOs()
Line 1601:
https://gerrit.ovirt.org/#/c/48404/1/vdsm/virt/vmxml.py
File vdsm/virt/vmxml.py:
Line 1: #
Line 2: # Copyright 2008-2015 Red Hat, Inc.
correct, but unneeded for this patch.
Line 3: #
Line 4: # This program is free software; you can redistribute it and/or modify
Line 5: # it under the terms of the GNU General Public License as published by
Line 6: # the Free Software Foundation; either version 2 of the License, or
Line 276: if utils.tobool(self.conf.get('bootMenuEnable', False)):
Line 277: oselem.appendChildWithArgs('bootmenu', enable='yes')
Line 278:
Line 279: if self.conf.get('_serialConsoleAvailable'):
Line 280: oselem.appendChildWithArgs('bios', useserial='yes')
what happens if we inconditionally enable useserial?
Line 281:
Line 282: def appendSysinfo(self, osname, osversion, serialNumber):
Line 283: """
Line 284: Add <sysinfo> element to domain:
--
To view, visit https://gerrit.ovirt.org/48404
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc560d2562a913b7dba9a5c01952429459595973
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes
Shahar Havivi has uploaded a new change for review.
Change subject: v2v: ova should support zip and extracted directory formats
......................................................................
v2v: ova should support zip and extracted directory formats
Change-Id: I494b88709c4c23fd39690b589eff1134e74f81ba
Bug-Url: https://bugzilla.redhat.com/1277879
Signed-off-by: Shahar Havivi <shaharh(a)redhat.com>
---
M vdsm/v2v.py
1 file changed, 35 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/48402/1
diff --git a/vdsm/v2v.py b/vdsm/v2v.py
index 5daa4f0..63df7e2 100644
--- a/vdsm/v2v.py
+++ b/vdsm/v2v.py
@@ -31,8 +31,10 @@
import os
import re
import signal
+import tarfile
import threading
import xml.etree.ElementTree as ET
+import zipfile
import libvirt
@@ -734,6 +736,39 @@
def _read_ovf_from_ova(ova_path):
+ '''
+ virt-v2v support ova in tar, zip formats as well as
+ extracted directory
+ '''
+ if os.path.isdir(ova_path):
+ return _read_ovf_from_ova_dir(ova_path)
+ elif zipfile.is_zipfile(ova_path):
+ return _read_ovf_from_zip_ova(ova_path)
+ elif tarfile.is_tarfile(ova_path):
+ return _read_ovf_from_tar_ova(ova_path)
+ raise ClientError('Unknown ova format, supported formats:'
+ ' tar, zip or a directory')
+
+
+def _read_ovf_from_ova_dir(ova_path):
+ files = os.listdir(ova_path)
+ for ova_file in files:
+ if '.ovf' == os.path.splitext(ova_file)[1].lower():
+ with open(os.path.join(ova_path, ova_file), 'r') as ovf_file:
+ return ovf_file.read()
+ raise ClientError('OVA directory %s does not contain ovf file' % ova_path)
+
+
+def _read_ovf_from_zip_ova(ova_path):
+ with open(ova_path, 'rb') as fh:
+ zf = zipfile.ZipFile(fh)
+ for name in zf.namelist():
+ if '.ovf' == os.path.splitext(name)[1].lower():
+ return zf.read(name)
+ raise ClientError('OVA does not contains file with .ovf suffix')
+
+
+def _read_ovf_from_tar_ova(ova_path):
# FIXME: change to tarfile package when support --to-stdout
cmd = ['/usr/bin/tar', 'xf', ova_path, '*.ovf', '--to-stdout']
rc, output, error = execCmd(cmd)
--
To view, visit https://gerrit.ovirt.org/48402
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I494b88709c4c23fd39690b589eff1134e74f81ba
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Shahar Havivi <shavivi(a)redhat.com>
automation(a)ovirt.org has posted comments on this change.
Change subject: virt: Make BIOS messages available on vmconsole
......................................................................
Patch Set 1:
* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
--
To view, visit https://gerrit.ovirt.org/48404
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc560d2562a913b7dba9a5c01952429459595973
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Moving cpopen import to compat to allow working with python 3
......................................................................
Moving cpopen import to compat to allow working with python 3
Once python3-copen will be available we'll be able to use it. Till then
this import trick will allow us to work with the python Popen
Change-Id: I181cd2e52706bfe7b24073d0f0eb42fec15ac490
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M lib/vdsm/compat.py
M lib/vdsm/infra/zombiereaper/tests.py
M lib/vdsm/qemuimg.py
M lib/vdsm/utils.py
M vdsm/storage/remoteFileHandler.py
5 files changed, 13 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/84/48384/1
diff --git a/lib/vdsm/compat.py b/lib/vdsm/compat.py
index 8ac5201..5c785a9 100644
--- a/lib/vdsm/compat.py
+++ b/lib/vdsm/compat.py
@@ -38,3 +38,8 @@
# no big deal, fallback to standard libary
import json
json # yep, this is needed twice.
+
+try:
+ from cpopen import CPopen as Popen
+except ImportError:
+ from subprocess import Popen
diff --git a/lib/vdsm/infra/zombiereaper/tests.py b/lib/vdsm/infra/zombiereaper/tests.py
index 681579f..9392758 100644
--- a/lib/vdsm/infra/zombiereaper/tests.py
+++ b/lib/vdsm/infra/zombiereaper/tests.py
@@ -22,7 +22,7 @@
import os
from .. import zombiereaper
-from cpopen import CPopen
+from vdsm.compat import Popen
from unittest import TestCase
@@ -36,7 +36,7 @@
zombiereaper.unregisterSignalHandler()
def testProcessDiesAfterBeingTracked(self):
- p = CPopen(["sleep", "1"])
+ p = Popen(["sleep", "1"])
zombiereaper.autoReapPID(p.pid)
# wait for the grim reaper to arrive
sleep(4)
@@ -45,7 +45,7 @@
self.assertRaises(OSError, os.waitpid, p.pid, os.WNOHANG)
def testProcessDiedBeforeBeingTracked(self):
- p = CPopen(["sleep", "0"])
+ p = Popen(["sleep", "0"])
# wait for the process to die
sleep(1)
diff --git a/lib/vdsm/qemuimg.py b/lib/vdsm/qemuimg.py
index bce9973..49ea43d 100644
--- a/lib/vdsm/qemuimg.py
+++ b/lib/vdsm/qemuimg.py
@@ -24,7 +24,7 @@
import re
import signal
-from cpopen import CPopen
+from vdsm.compat import Popen
from . import utils
from . import cmdutils
@@ -223,7 +223,7 @@
cmd = cmdutils.wrap_command(cmd, with_nice=utils.NICENESS.HIGH,
with_ioclass=utils.IOCLASS.IDLE)
_log.debug(cmdutils.command_log_line(cmd, cwd=cwd))
- self._command = CPopen(cmd, cwd=cwd, deathSignal=signal.SIGKILL)
+ self._command = Popen(cmd, cwd=cwd, deathSignal=signal.SIGKILL)
self._stream = utils.CommandStream(
self._command, self._recvstdout, self._recvstderr)
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index 9ebef54..0b14e59 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -52,6 +52,7 @@
import string
import threading
import time
+from vdsm.compat import Popen
import vdsm.infra.zombiereaper as zombiereaper
from cpopen import CPopen
@@ -629,7 +630,6 @@
a temporary thread, spawn a sync=False sub-process, and have the thread
finish, the new subprocess would die immediately.
"""
-
command = cmdutils.wrap_command(command, with_ioclass=ioclass,
ioclassdata=ioclassdata, with_nice=nice,
with_setsid=setsid, with_sudo=sudo,
diff --git a/vdsm/storage/remoteFileHandler.py b/vdsm/storage/remoteFileHandler.py
index e69ae8c..2123777 100644
--- a/vdsm/storage/remoteFileHandler.py
+++ b/vdsm/storage/remoteFileHandler.py
@@ -33,7 +33,7 @@
if __name__ != "__main__":
# The following modules are not used by the newly spawned child porcess.
# Do not import them in the child to save memory.
- from cpopen import CPopen
+ from vdsm.compat import Popen
from vdsm import constants
else:
# We add the parent directory so that imports that import the storage
@@ -231,7 +231,7 @@
env.get("PYTHONPATH", ""), constants.P_VDSM)
env['PYTHONPATH'] = ":".join(map(os.path.abspath,
env['PYTHONPATH'].split(":")))
- self.process = CPopen([constants.EXT_PYTHON, __file__,
+ self.process = Popen([constants.EXT_PYTHON, __file__,
str(hisRead), str(hisWrite)],
close_fds=False, env=env)
--
To view, visit https://gerrit.ovirt.org/48384
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I181cd2e52706bfe7b24073d0f0eb42fec15ac490
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>