[libvirt] [sandbox PATCH 0/2] v1.1 bugfix: support dhcp network interfaces
by Gene Czarcinski
Resubmitted to add "sandbox PATCH" to Subject
v1.1 adds some documentation changes.
Support for a network such as -N dhcp,source=default was not working
in that dhclient was not being started. Although I am not sure what
the real problem is, the solution is to use g_spawn_sync() instead of
g_spawn_async() to start /sbin/dhclient.
The second patch addes "-v" to the dhclient arguments to improve debugging
info. The dhclient into will be in /var/log/messages the Secure Contrainer
host system and not in the container itself.
Gene Czarcinski (2):
v1.1 for dhclient use g_spawn_sync()
v1.1 add -v to dhclient parameter arguments
libvirt-sandbox/libvirt-sandbox-init-common.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
--
1.9.3
10 years
[libvirt] [libvirt-sandbox][PATCH 0/4] Couple of fixes to compile again
by Michal Privoznik
It's been a while that I tried to build libvirt-sandbox. And
guess what, it doesn't compile cleanly so here are some patches
to fix the issues I met.
Michal Privoznik (4):
virt-selinux.m4: Define SELINUX variables
Makefile: link SELINUX into libvirt-sandbox-1.0.so
m4: sync macros with libvirt
libvirt-sandbox-config.c: Fix comment
libvirt-sandbox/Makefile.am | 4 +-
libvirt-sandbox/libvirt-sandbox-config.c | 2 +-
m4/manywarnings.m4 | 217 ++++++++++++++++++++-----------
m4/virt-compile-warnings.m4 | 216 ++++++++++++++++++++++--------
m4/virt-selinux.m4 | 6 +-
m4/warnings.m4 | 82 +++++++++---
6 files changed, 369 insertions(+), 158 deletions(-)
--
2.0.4
10 years
[libvirt] [PATCH] Require at least one console for LXC domain
by Ján Tomko
A domain without a console quietly dies soon after start,
because we try to set /dev/null as a controlling TTY
2014-10-30 15:10:59.705+0000: 1: error : lxcContainerSetupFDs:283 :
ioctl(TIOCSTTY) failed: Inappropriate ioctl for device
Report an error early instead of trying to start it.
https://bugzilla.redhat.com/show_bug.cgi?id=1155410
---
src/lxc/lxc_container.c | 6 ++++--
src/lxc/lxc_process.c | 6 ++++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index f02b959..8aba3ba 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -2093,8 +2093,10 @@ static int lxcContainerChild(void *data)
if (virAsprintf(&ttyPath, "%s/%s.devpts/%s",
LXC_STATE_DIR, vmDef->name, tty) < 0)
goto cleanup;
- } else if (VIR_STRDUP(ttyPath, "/dev/null") < 0) {
- goto cleanup;
+ } else {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("At least one tty is required"));
+ goto cleanup;
}
VIR_DEBUG("Container TTY path: %s", ttyPath);
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index ed30c37..6c83fdb 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -1144,6 +1144,12 @@ int virLXCProcessStart(virConnectPtr conn,
vm->def, NULL) < 0)
goto cleanup;
+ if (vm->def->nconsoles == 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("At least one PTY console is required"));
+ goto cleanup;
+ }
+
for (i = 0; i < vm->def->nconsoles; i++) {
char *ttyPath;
if (vm->def->consoles[i]->source.type != VIR_DOMAIN_CHR_TYPE_PTY) {
--
2.0.4
10 years
[libvirt] [v5][Patch 0/4] Libvirt CPU enhancements for Power KVM
by Prerna Saxena
This patch series is a collection of enhancements for PowerPC CPUs on PowerKVM.
In this iteration, I have followed Dan's suggestion on using existing cpu mode
format to describe powerPC compatibility mode.
Hope this can finally make it for 1.2.10 !
Series Summary:
==========
Patch 1/4 : Introduce a new architecture 'ppc64le' for libvirt.
Patch 2/4 : Add libvirt support for VMs running in 'compat' mode on Power KVM.
Patch 3/4 : Improve PVR handling to fall back to cpu generation.
Patch 4/4 : Add documentation describing compat mode usage for PowerPC guests.
Detail:
====
* PowerPC has traditionally been a Big-endian architecture. However, with PowerPC ISA version 2.07, it can run in Little-endian mode as well. IBM Power8 processors, compliant with ISA 2.07 allow launching VMs in little-endian mode. This is signified by 'ppc64le' architecture. Patch 1 adds this support to libvirt, to allow running VMs based on ppc64le architecture.
* Patch 2,3 tweak libvirt to correctly model PowerPC CPUs based on recent PowerKVM implementation.
PowerKVM permits VMs with vcpus in the following allowed modes :
i) Host native mode:
where the vcpu seen in the VM belongs to the same processor generation as the host.
Example: A POWER7 host, conforming to PowerISA version 2.06, will run VMs with "power7" vcpus.
ii) Binary Compatibility ("compat") mode:
PowerISA allows processors to run VMs in binary compatibility ("compat") mode supporting an older version of ISA.
As an example: In compatibility mode, a POWER7 host can run a "power6" VM, conforming to power ISA v2.05.
Similarly, a POWER8 host can run a "power7" VM conforming to PowerISA v2.06.
QEMU has recently added support to explicitly denote a VM running in compatibility mode through commits 6d9412ea & 8dfa3a5e85. Henceforth, VMs of type (i) will be invoked with the QEMU invocation "-cpu host", while VMs of type (ii) will be invoked using "-cpu host, compat=power6".
Now, an explicit cpu selection using "-cpu POWER6" is not valid. Instead, the recommended practice is to use the matching compat mode, if the requested cpu type differs from the host.
Patches 2-3 address various aspects of this change.
* Patch 2 : Adds support for generating the correct command line for QEMU. Existing xml semantics of 'host-model' are interpreted differently on PowerPc architecture to signify this type.
* Patch 3 : PowerKVM vCPUs differ uniquely across generations ( such as power6, power7, power8). Each generation signifies a new PowerISA version that exhibits features unique to that generation. The higher order 16 bits of PVR denote the processor generation and the lower order 16 bits denote the cpu chip (sub)version.
For all practical purposes of launching a VM, we care about the generation the vCPU will belong to, and not specifically the chip version. In fact, PowerKVM does not seek out specification of a unique chip version(such as POWER7_v2.3) for running a vCPU. This patch updates the libvirt PVR check to reflect this relationship.
* Patch 4 : Documentation is added to explain functionality introduced by Patch 2.
Changelog:
=========
v1 : https://www.redhat.com/archives/libvir-list/2014-June/msg01338.html
v2 : http://www.redhat.com/archives/libvir-list/2014-October/msg00351.html
v3 : http://www.mail-archive.com/libvir-list@redhat.com/msg104010.html
v4: http://www.mail-archive.com/libvir-list@redhat.com/msg104067.html
Changes since v4:
================
* Patches 1,3 already ack'ed by Michal, and have been posted unchanged.
* In Patch 2,Discarded fallback=compat, and implemented Dan's suggestion to overload cpu mode "host-model".
Now, on PowerPc, a VM with this XML schema will automatically be a compat-mode VM:
<cpu mode='host-model'>
<model>power7</model>
</cpu>
* Introduced a new patch '4' to add documentation that explains this.
Regards,
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
10 years
[libvirt] Release of libvirt-python-1.2.10
by Daniel Veillard
I also tagged and pushed a new version of libvirt-python,
it is available at:
ftp://libvirt.org/libvirt/python
it handle the new header split in libvirt-1.2.10 and fixes a
number of issues:
Documentation:
d Change the comment in getPyNodeCPUCount method reflecting correct called methods (Pradipta Kr. Banerjee)
Bug Fixes:
b virDomainBlockCopy: initialize flags to 0 (Pavel Hrdina)
b flags cannot get right value for blockCopy function (Pavel Hrdina)
b Fix rest of unsigned integer handling (Peter Krempa)
b Fix parsing of 'flags' argument for bulk stats functions (Luyao Huang)
b Fix function name when parsing arguments in libvirt_virNodeAllocPages (Peter Krempa)
Improvements:
i fix libvirt headers list (Dmitry Guryanov)
i Improve error output when use getTime with a nonzero flags. (Luyao Huang)
i setup.py: fix rpm build to return 1 on error (Pavel Hrdina)
i sanitytest: define long for python version >= 3 (Martin Kletzander)
i sanitytest: count with the fact that large enums can be long (Martin Kletzander)
i sanitytest: check for exported enums (Martin Kletzander)
Thanks everybody who contributed to this release !
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
10 years
[libvirt] [PATCH] domain: Improve error output for virDomainListGetStats
by Luyao Huang
When pass flags --domain and --list-* to cmdDomstats,
a unsupport error will output from qemuConnectGetAllDomainStats.
error: unsupported flags (0x1) in function qemuConnectGetAllDomainStats
>From manual of virsh: The approaches can't be combined.
Improve error to:
error: --domain and --list-* flags are mutually exclusive
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/libvirt-domain.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 7dc3146..6ae6dd2 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -11053,6 +11053,19 @@ virDomainListGetStats(virDomainPtr *doms,
goto cleanup;
}
+ if (flags & (VIR_CONNECT_LIST_DOMAINS_ACTIVE |
+ VIR_CONNECT_LIST_DOMAINS_INACTIVE |
+ VIR_CONNECT_LIST_DOMAINS_PERSISTENT |
+ VIR_CONNECT_LIST_DOMAINS_TRANSIENT |
+ VIR_CONNECT_LIST_DOMAINS_RUNNING |
+ VIR_CONNECT_LIST_DOMAINS_SHUTOFF |
+ VIR_CONNECT_LIST_DOMAINS_PAUSED |
+ VIR_CONNECT_LIST_DOMAINS_OTHER)) {
+ virReportInvalidArg(flags, "%s",
+ _("--domain and --list-* flags are mutually exclusive"));
+ goto cleanup;
+ }
+
conn = doms[0]->conn;
virCheckConnectReturn(conn, -1);
--
1.8.3.1
10 years
[libvirt] [v2 PATCH] qemu: Improve error output for virDomainListGetStats
by Luyao Huang
A unsupport error will output from qemuConnectGetAllDomainStats. Add a
check for the flags in qemuConnectGetAllDomainStats and improve the error
in the current implementation.From manual of virsh:
The approaches can't be combined.
Improve error to:
error: --domain and --list-* flags are mutually exclusive
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/qemu/qemu_driver.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 6acaea8..60c3882 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -18487,13 +18487,18 @@ qemuConnectGetAllDomainStats(virConnectPtr conn,
unsigned int privflags = 0;
unsigned int domflags = 0;
- if (ndoms)
- virCheckFlags(VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS, -1);
- else
- virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE |
- VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT |
- VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE |
- VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS, -1);
+ if (ndoms && (flags & (VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE |
+ VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT |
+ VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE))) {
+ virReportInvalidArg(flags, "%s",
+ _("--domain and --list-* flags are mutually exclusive"));
+ return -1;
+ }
+
+ virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE |
+ VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT |
+ VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE |
+ VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS, -1);
if (virConnectGetAllDomainStatsEnsureACL(conn) < 0)
return -1;
--
1.8.3.1
10 years
[libvirt] internal error: Cannot find suitable CPU model for given data
by Matias Kreder
Hello,
I am having troubles with libvirt on Fedora 21 alpha.
On virt-manager:
Unable to complete install: 'internal error: Cannot find suitable CPU
model for given data'
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 89, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/create.py", line 1854, in do_install
guest.start_install(meter=meter)
File "/usr/share/virt-manager/virtinst/guest.py", line 411, in start_install
noboot)
File "/usr/share/virt-manager/virtinst/guest.py", line 475, in _create_guest
dom = self.conn.createLinux(start_xml or final_xml, 0)
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3361, in
createLinux
if ret is None:raise libvirtError('virDomainCreateLinux() failed',
conn=self)
libvirtError: internal error: Cannot find suitable CPU model for given data
On "systemctl status libvirtd" I can see:
Nov 04 10:23:41 lappie.mkeder.com libvirtd[3822]: Preferred CPU model
Westmere not allowed by hypervisor; closest supported model will be
used
Nov 04 10:23:41 lappie.mkeder.com libvirtd[3822]: internal error:
Cannot find suitable CPU model for given data
I can't create the VM using any CPU configuration on virt-manager.
Intel VT is enabled on the BIOS. This is a Lenovo Thinkpad t410 that I
got yesterday. CPU is Intel(R) Core(TM) i5 CPU M 520
[root@lappie matias]# virsh -r capabilities | grep model
<model>Westmere</model>
I haven't tried Fedora 20 on it but I might re-install it soon. Just
wanted to give my feedback for Fedora 21.
[root@lappie matias]# rpm -q libvirt-daemon
libvirt-daemon-1.2.9-4.fc21.x86_64
[root@lappie matias]# rpm -q virt-manager
virt-manager-1.1.0-3.git310f6527.fc21.noarch
Doing a google search it seems that some people had the same problem a
few months ago and they solved but by updating. Seems to be some sort
of problem between libvirt and qemu-kvm.
Regards
Matias
10 years
[libvirt] [PATCH] qemu: fix up NBD Server can not be stopped properly
by weiwei li
In qemuMigrationFinish mig->nbd can not be initialized by
qemuMigrationEatCookie without a flag QEMU_MIGRATION_COOKIE_NBD.
That cause qemuMigrationStopNBDServer return and the NBD server
can not be stopped properly.
Signed-off-by: Weiwei Li <nuonuoli(a)tencent.com>
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/qemu/qemu_migration.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 13239eb..9cb2a06 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -4822,7 +4822,8 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
VIR_FREE(priv->job.completed);
cookie_flags = QEMU_MIGRATION_COOKIE_NETWORK |
- QEMU_MIGRATION_COOKIE_STATS;
+ QEMU_MIGRATION_COOKIE_STATS |
+ QEMU_MIGRATION_COOKIE_NBD;
if (flags & VIR_MIGRATE_PERSIST_DEST)
cookie_flags |= QEMU_MIGRATION_COOKIE_PERSISTENT;
--
1.7.1
10 years
[libvirt] [PATCH] util: fix releasing pidfile in cleanup
by Martin Kletzander
Coverity found out the very obvious problem in the code. That is that
virPidFileReleasePath() was called only if
virPidFileAcquirePath() returned 0. But virPidFileAcquirePath() doesn't
return only 0 on success, but the FD that needs to be closed.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/util/virpidfile.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c
index 098458f..a77a326 100644
--- a/src/util/virpidfile.c
+++ b/src/util/virpidfile.c
@@ -592,9 +592,8 @@ virPidFileForceCleanupPath(const char *path)
if (virPidFileReadPath(path, &pid) < 0)
return -1;
- if (virPidFileAcquirePath(path, false, 0) == 0) {
- virPidFileReleasePath(path, fd);
- } else {
+ fd = virPidFileAcquirePath(path, false, 0);
+ if (fd < 0) {
virResetLastError();
/* Only kill the process if the pid is valid one. 0 means
@@ -607,5 +606,8 @@ virPidFileForceCleanupPath(const char *path)
return -1;
}
+ if (fd)
+ virPidFileReleasePath(path, fd);
+
return 0;
}
--
2.1.3
10 years