[libvirt] Libvirt 0.9.4rc2 + qemu 0.15 : shutdown domain
by Radek Hladik
Hi again,
while experimenting with new libvirt and qemu I discovered different
behavior than with my previous versions.
When I shutdown machine with shutdown (virsh) or virDomainShutdown (via
php) the domain is shutdown but it ends up paused instead of destroyed.
The OS is shut down, CPU probably stopped and I can connect to VNC.
I would suppose its because of the new reboot feature and the
-no-shutdown option for qemu. I am curious whether it is a bug or
expected behavior. It would make perfect sense to be able to
"semi"shutdown machine like this. But I was not able to reboot the
machine from this state by any means. The best I could do was to resume
(unpause) the CPU.
Radek
13 years, 3 months
[libvirt] Libvirt 0.9.4rc2 + qemu 0.15 VNC/TLS not working
by Radek Hladik
Hi all,
I am trying new versions of software for my libvirt/qemu farm. I
upgraded libvirt to 0.9.3 and I had problems with loading certificates
for libvirt itself (probably GNUTLS related). Upgrade to 0.9.4rc2 solved
the problem.
Now I am trying to upgrade qemu (from 0.12.5) to 0.15. I compiled the
SRPM from rawhide for Fedora 13 (OS on my farms) and I copied the binary
to one farm, so I can choose qemu version by <emulator> element in guest
XML. I had problem with booting off virtio disk, but upgrade of seabios
to 0.6.2 solved it (I had to make a wrapper for qemu to be able to add
-bios option though).
But main issue that I am not able to solve is that VNC is not using TLS.
I've found out these:
* qemu 0.12.5 is working without problems
* there is no error in libvirt or qemu machine log
* If I copy the command from libvirt log, remove the network and monitor
definition and start it under root, TLS works as expected
* the vnc definition on command line is quite simple: -vnc
0.0.0.0:0,password,tls,x509=/etc/pki/libvirt/pki-vnc -k en-us
I am thinking whether there is not a problem with monitor setting
something after the machine starts. Libvirt does the same with password,
so maybe it does something with TLS. Unfortunately I do not know whether
there is any option how to debug the monitor libvirt<->qemu communication.
And I have one other question. Is there any way how to interact directly
with monitor? Qemu has new guest agent that seems to provide some nice
functions and expose them via monitor and I would like to test it.
Radek
13 years, 3 months
[libvirt] [PATCH 2/3] qemu: When reserving all functions on a slot don't reserve function 0 on the next slot.
by Shradha Shah
Signed-off-by: Steve Hodgson <shodgson(a)solarflare.com>
---
src/qemu/qemu_command.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index dbfc7d9..12adcc0 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -878,7 +878,7 @@ int qemuDomainPCIAddressReserveSlot(qemuDomainPCIAddressSetPtr addrs,
{
int function;
- for (function = 0; function <= QEMU_PCI_ADDRESS_LAST_FUNCTION; function++) {
+ for (function = 0; function < QEMU_PCI_ADDRESS_LAST_FUNCTION; function++) {
if (qemuDomainPCIAddressReserveFunction(addrs, slot, function) < 0)
goto cleanup;
}
@@ -956,7 +956,7 @@ int qemuDomainPCIAddressReleaseSlot(qemuDomainPCIAddressSetPtr addrs, int slot)
dev.addr.pci.bus = 0;
dev.addr.pci.slot = slot;
- for (*function = 0; *function <= QEMU_PCI_ADDRESS_LAST_FUNCTION; (*function)++) {
+ for (*function = 0; *function < QEMU_PCI_ADDRESS_LAST_FUNCTION; (*function)++) {
addr = qemuPCIAddressAsString(&dev);
if (!addr)
return -1;
--
1.7.4.4
13 years, 3 months
[libvirt] [PATCH 1/3] pci: Fix callers of pciDeviceListSteal() when there's more than one device
by Shradha Shah
pciDeviceListSteal(pcidevs, dev) removes dev from pcidevs reducing
the length of pcidevs, so moving onto what was the next dev is wrong.
Instead callers should pop entry 0 repeatedly until pcidevs is empty.
Signed-off-by: Steve Hodgson <shodgson(a)solarflare.com>
Signed-off-by: Shradha Shah <sshah(a)solarflare.com>
---
src/qemu/qemu_hostdev.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index 7f5ad51..6f77717 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -74,7 +74,6 @@ int qemuUpdateActivePciHostdevs(struct qemud_driver *driver,
virDomainDefPtr def)
{
pciDeviceList *pcidevs;
- int i;
int ret = -1;
if (!def->nhostdevs)
@@ -83,8 +82,8 @@ int qemuUpdateActivePciHostdevs(struct qemud_driver *driver,
if (!(pcidevs = qemuGetPciHostDeviceList(def->hostdevs, def->nhostdevs)))
return -1;
- for (i = 0; i < pciDeviceListCount(pcidevs); i++) {
- pciDevice *dev = pciDeviceListGet(pcidevs, i);
+ while (pciDeviceListCount(pcidevs) > 0) {
+ pciDevice *dev = pciDeviceListGet(pcidevs, 0);
pciDeviceListSteal(pcidevs, dev);
if (pciDeviceListAdd(driver->activePciHostdevs, dev) < 0) {
pciFreeDevice(dev);
@@ -152,8 +151,8 @@ int qemuPrepareHostdevPCIDevices(struct qemud_driver *driver,
}
/* Now steal all the devices from pcidevs */
- for (i = 0; i < pciDeviceListCount(pcidevs); i++) {
- pciDevice *dev = pciDeviceListGet(pcidevs, i);
+ while (pciDeviceListCount(pcidevs) > 0) {
+ pciDevice *dev = pciDeviceListGet(pcidevs, 0);
pciDeviceListSteal(pcidevs, dev);
}
@@ -164,8 +163,8 @@ inactivedevs:
/* Only steal all the devices from driver->activePciHostdevs. We will
* free them in pciDeviceListFree().
*/
- for (i = 0; i < pciDeviceListCount(pcidevs); i++) {
- pciDevice *dev = pciDeviceListGet(pcidevs, i);
+ while (pciDeviceListCount(pcidevs) > 0) {
+ pciDevice *dev = pciDeviceListGet(pcidevs, 0);
pciDeviceListSteal(driver->activePciHostdevs, dev);
}
--
1.7.4.4
13 years, 3 months
[libvirt] [PATCH v2] daemon: Move TLS initialization to virInitialize
by Michal Privoznik
My previous patch 74c75671331d284e1f777f9692b72e9737520bf0
introduced a regression by removing TLS initialization from client.
---
diff to v1:
-remove virNetTLSDeinit()
daemon/libvirtd.c | 2 --
src/libvirt.c | 3 +++
src/rpc/virnettlscontext.c | 8 --------
src/rpc/virnettlscontext.h | 1 -
4 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 5969a82..423c3d7 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -1516,7 +1516,6 @@ int main(int argc, char **argv) {
virHookCall(VIR_HOOK_DRIVER_DAEMON, "-", VIR_HOOK_DAEMON_OP_START,
0, "start", NULL);
- virNetTLSInit();
if (daemonSetupNetworking(srv, config,
sock_file, sock_file_ro,
ipsock, privileged) < 0) {
@@ -1555,7 +1554,6 @@ cleanup:
virNetServerProgramFree(qemuProgram);
virNetServerClose(srv);
virNetServerFree(srv);
- virNetTLSDeinit();
if (statuswrite != -1) {
if (ret != 0) {
/* Tell parent of daemon what failed */
diff --git a/src/libvirt.c b/src/libvirt.c
index c8af3e1..fdf3923 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -40,6 +40,7 @@
#include "memory.h"
#include "configmake.h"
#include "intprops.h"
+#include "rpc/virnettlscontext.h"
#ifndef WITH_DRIVER_MODULES
# ifdef WITH_TEST
@@ -409,6 +410,8 @@ virInitialize(void)
virLogSetFromEnv();
+ virNetTLSInit();
+
VIR_DEBUG("register drivers");
#if HAVE_WINSOCK2_H
diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c
index 8482eaf..e901b63 100644
--- a/src/rpc/virnettlscontext.c
+++ b/src/rpc/virnettlscontext.c
@@ -1410,11 +1410,3 @@ void virNetTLSInit(void)
{
gnutls_global_init();
}
-
-/*
- * See virNetTLSInit
- */
-void virNetTLSDeinit(void)
-{
- gnutls_global_deinit();
-}
diff --git a/src/rpc/virnettlscontext.h b/src/rpc/virnettlscontext.h
index 99f31b9..fdfce6d 100644
--- a/src/rpc/virnettlscontext.h
+++ b/src/rpc/virnettlscontext.h
@@ -31,7 +31,6 @@ typedef virNetTLSSession *virNetTLSSessionPtr;
void virNetTLSInit(void);
-void virNetTLSDeinit(void);
virNetTLSContextPtr virNetTLSContextNewServerPath(const char *pkipath,
bool tryUserPkiPath,
--
1.7.3.4
13 years, 3 months
[libvirt] [PATCH] util: only fchown newly created files in virFileOpenAs
by Laine Stump
virFileOpenAs takes desired uid:gid as arguments, and not only uses
them for a fork/setuid/setgid when retrying failed open operations,
but additionally always forces the opened file to be owned by the
given uid:gid.
One example of the problems this causes is that, when restoring a
domain from a file that is owned by the qemu user, opening the file
chowns it to root. if dynamic_ownership=1 this is coincidentally
expected, but if dynamic_ownership=0, no existing file should ever
have its ownership changed.
This patch adds an extra check before calling fchown() - it only does
it if O_CREAT was passed to virFileOpenAs() in the openflags.
---
src/util/util.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/util/util.c b/src/util/util.c
index b278165..9556bdb 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -697,6 +697,7 @@ virFileOpenAsNoFork(const char *path, int openflags, mode_t mode,
goto error;
}
if (((st.st_uid != uid) || (st.st_gid != gid))
+ && (openflags & O_CREAT)
&& (fchown(fd, uid, gid) < 0)) {
ret = -errno;
virReportSystemError(errno, _("cannot chown '%s' to (%u, %u)"),
--
1.7.3.4
13 years, 3 months
[libvirt] [PATCH 3/3] If VIR_MIGRATE_PERSIST_DEF is set then make the live configuration transient
by Shradha Shah
Make the migrated VM config as transient. Ensures transient hotplug operations
do not persist past shutdown.
Currently the running VM config is transient but that of a migrated VM is
persistent.
Signed-off-by: Steve Hodgson <shodgson(a)solarflare.com>
Signed-off-by: Shradha Shah <sshah(a)solarflare.com>
---
src/qemu/qemu_migration.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index a84faf6..aa458c3 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2509,6 +2509,9 @@ qemuMigrationFinish(struct qemud_driver *driver,
goto endjob;
}
+ /* Make the VM transient again to match qemuProcessStart */
+ virDomainObjSetDefTransient(driver->caps, vm, true);
+
event = virDomainEventNewFromObj(vm,
VIR_DOMAIN_EVENT_DEFINED,
newVM ?
--
1.7.4.4
13 years, 3 months
[libvirt] [PATCH] daemon: Move TLS initialization to virInitialize
by Michal Privoznik
My previous patch 74c75671331d284e1f777f9692b72e9737520bf0
introduced a regression by removing TLS initialization from client.
---
daemon/libvirtd.c | 1 -
src/libvirt.c | 3 +++
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 5969a82..8f04a99 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -1516,7 +1516,6 @@ int main(int argc, char **argv) {
virHookCall(VIR_HOOK_DRIVER_DAEMON, "-", VIR_HOOK_DAEMON_OP_START,
0, "start", NULL);
- virNetTLSInit();
if (daemonSetupNetworking(srv, config,
sock_file, sock_file_ro,
ipsock, privileged) < 0) {
diff --git a/src/libvirt.c b/src/libvirt.c
index c8af3e1..fdf3923 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -40,6 +40,7 @@
#include "memory.h"
#include "configmake.h"
#include "intprops.h"
+#include "rpc/virnettlscontext.h"
#ifndef WITH_DRIVER_MODULES
# ifdef WITH_TEST
@@ -409,6 +410,8 @@ virInitialize(void)
virLogSetFromEnv();
+ virNetTLSInit();
+
VIR_DEBUG("register drivers");
#if HAVE_WINSOCK2_H
--
1.7.3.4
13 years, 3 months
[libvirt] [PATCHv2 00/26] revised round of snapshot patches
by Eric Blake
Many, but not all, of these patches have been previously
submitted. I've rebased the series, and added in some
additional patches throughout. It still isn't complete,
and could probably use more testing after about patch 20 or
so, but I'd like to get reviews on some of these to start
getting these off the queue.
Eric Blake (26):
virsh: concatenate qemu-monitor-command arguments
snapshot: better event when reverting qemu to paused snapshot
snapshot: improve reverting to qemu paused snapshots
snapshot: properly revert qemu to offline snapshots
snapshot: one less point of failure in qemu
snapshot: only pass snapshot to qemu command line when reverting
snapshot: track current snapshot across restarts
snapshot: allow deletion of just snapshot metadata
snapshot: avoid crash when deleting qemu snapshots
snapshot: simplify acting on just children
snapshot: let qemu discard only snapshot metadata
snapshot: identify which snapshots have metadata
snapshot: identify qemu snapshot roots
snapshot: prevent stranding snapshot data on domain destruction
snapshot: refactor some qemu code
snapshot: cache qemu-img location
snapshot: support new undefine flags in qemu
snapshot: teach virsh about new undefine flags
snapshot: prevent migration from stranding snapshot data
snapshot: refactor domain xml output
snapshot: allow full domain xml in snapshot
snapshot: update rng to support full domain in xml
snapshot: store qemu domain details in xml
snapshot: add 2 attributes to domain xml for disks
snapshot: reject transient disks where code is not ready
snapshot: wire up new qemu monitor command
docs/formatdomain.html.in | 40 +-
docs/formatsnapshot.html.in | 45 +-
docs/schemas/Makefile.am | 1 +
docs/schemas/domain.rng | 2555 +-----------------------
docs/schemas/{domain.rng => domaincommon.rng} | 25 +-
docs/schemas/domainsnapshot.rng | 19 +-
include/libvirt/libvirt.h.in | 40 +-
src/conf/domain_conf.c | 503 ++++--
src/conf/domain_conf.h | 41 +-
src/esx/esx_driver.c | 35 +-
src/libvirt.c | 91 +-
src/libvirt_private.syms | 4 +
src/libxl/libxl_conf.c | 5 +
src/qemu/qemu_command.c | 12 +-
src/qemu/qemu_conf.h | 1 +
src/qemu/qemu_driver.c | 839 +++++---
src/qemu/qemu_migration.c | 2 +-
src/qemu/qemu_monitor.c | 24 +
src/qemu/qemu_monitor.h | 4 +
src/qemu/qemu_monitor_json.c | 33 +
src/qemu/qemu_monitor_json.h | 4 +
src/qemu/qemu_monitor_text.c | 40 +
src/qemu/qemu_monitor_text.h | 4 +
src/qemu/qemu_process.c | 10 +-
src/qemu/qemu_process.h | 1 +
src/vbox/vbox_tmpl.c | 40 +-
src/xenxs/xen_sxpr.c | 5 +
src/xenxs/xen_xm.c | 5 +
tests/domainsnapshotxml2xmlout/full_domain.xml | 35 +
tools/virsh.c | 419 ++++-
tools/virsh.pod | 42 +-
31 files changed, 1780 insertions(+), 3144 deletions(-)
copy docs/schemas/{domain.rng => domaincommon.rng} (99%)
create mode 100644 tests/domainsnapshotxml2xmlout/full_domain.xml
--
1.7.4.4
13 years, 3 months