[libvirt] [PATCH] virtlockd: fix socket path
by Ján Tomko
Change the socket path to match the one used by lockd driver.
https://bugzilla.redhat.com/show_bug.cgi?id=968128
---
src/locking/virtlockd.socket.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/locking/virtlockd.socket.in b/src/locking/virtlockd.socket.in
index a6eef4f..a38b1f4 100644
--- a/src/locking/virtlockd.socket.in
+++ b/src/locking/virtlockd.socket.in
@@ -2,7 +2,7 @@
Description=Virtual machine lock manager socket
[Socket]
-ListenStream=@localstatedir(a)/run/libvirt/virtlockd/virtlockd.sock
+ListenStream=@localstatedir@/run/libvirt/virtlockd-sock
[Install]
WantedBy=multi-user.target
--
1.8.1.5
11 years, 5 months
[libvirt] [PATCH] snapshot: remove mutually exclusive memory and disk-only duplicate check
by Guannan Ren
The work was done at the time of snapshot xmlstring parsing
if (offline && def->memory &&
def->memory != VIR_DOMAIN_SNAPSHOT_LOCATION_NONE) {
virReportError(...);
}
---
src/qemu/qemu_driver.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9d3f632..db56823 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -11730,14 +11730,6 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
"with external checkpoints"));
goto cleanup;
}
- if ((def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL ||
- def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL) &&
- flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) {
- virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
- _("disk-only snapshot creation is not compatible with "
- "memory snapshot"));
- goto cleanup;
- }
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE) {
/* Prevent circular chains */
--
1.8.1.4
11 years, 5 months
[libvirt] [PATCH] Ensure non-root can read /proc/meminfo file in LXC containers
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
By default files in a FUSE mount can only be accessed by the
user which created them, even if the file permissions would
otherwise allow it. To allow other users to access the FUSE
mount the 'allow_other' mount option must be used. This bug
prevented non-root users in an LXC container from reading
the /proc/meminfo file.
https://bugzilla.redhat.com/show_bug.cgi?id=967977
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/lxc/lxc_fuse.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c
index b6df99c..32886cd 100644
--- a/src/lxc/lxc_fuse.c
+++ b/src/lxc/lxc_fuse.c
@@ -307,6 +307,7 @@ int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def)
/* process name is libvirt_lxc */
if (fuse_opt_add_arg(&args, "libvirt_lxc") == -1 ||
fuse_opt_add_arg(&args, "-odirect_io") == -1 ||
+ fuse_opt_add_arg(&args, "-oallow_other") == -1 ||
fuse_opt_add_arg(&args, "-ofsname=libvirt") == -1)
goto cleanup1;
--
1.8.1.4
11 years, 5 months
[libvirt] [PATCH v2] nwfilter: grab driver lock earlier during init (bz96649)
by Stefan Berger
This patch is in _relation_ to Bug 966449:
https://bugzilla.redhat.com/show_bug.cgi?id=966449
Below is a possible patch addressing the coredump.
Thread 1 must be calling nwfilterDriverRemoveDBusMatches(). It does so with
nwfilterDriverLock held. In the patch below I am now moving the
nwfilterDriverLock(driverState) further up so that the initialization, which
seems to either take a long time or is entirely stuck, occurs with the lock
held and the shutdown cannot occur at the same time.
Remove the lock in virNWFilterDriverIsWatchingFirewallD to avoid trying to
lock the same lock again.
---
src/nwfilter/nwfilter_driver.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
Index: libvirt/src/nwfilter/nwfilter_driver.c
===================================================================
--- libvirt.orig/src/nwfilter/nwfilter_driver.c
+++ libvirt/src/nwfilter/nwfilter_driver.c
@@ -191,6 +191,8 @@ nwfilterStateInitialize(bool privileged,
if (!privileged)
return 0;
+ nwfilterDriverLock(driverState);
+
if (virNWFilterIPAddrMapInit() < 0)
goto err_free_driverstate;
if (virNWFilterLearnInit() < 0)
@@ -203,8 +205,6 @@ nwfilterStateInitialize(bool privileged,
if (virNWFilterConfLayerInit(virNWFilterDomainFWUpdateCB) < 0)
goto err_techdrivers_shutdown;
- nwfilterDriverLock(driverState);
-
/*
* startup the DBus late so we don't get a reload signal while
* initializing
@@ -316,16 +316,10 @@ nwfilterStateReload(void) {
bool
virNWFilterDriverIsWatchingFirewallD(void)
{
- bool ret;
-
if (!driverState)
return false;
- nwfilterDriverLock(driverState);
- ret = driverState->watchingFirewallD;
- nwfilterDriverUnlock(driverState);
-
- return ret;
+ return driverState->watchingFirewallD;
}
/**
11 years, 5 months
[libvirt] [PATCH] Ensure non-root can read /proc/meminfo file in LXC containers
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
By default files in a FUSE mount can only be accessed by the
user which created them, even if the file permissions would
otherwise allow it. To allow other users to access the FUSE
mount the 'allow_other' mount option must be used. This bug
prevented non-root users in an LXC container from reading
the /proc/meminfo file.
https://bugzilla.redhat.com/show_bug.cgi?id=967977
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/lxc/lxc_fuse.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c
index b6df99c..32886cd 100644
--- a/src/lxc/lxc_fuse.c
+++ b/src/lxc/lxc_fuse.c
@@ -307,6 +307,7 @@ int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def)
/* process name is libvirt_lxc */
if (fuse_opt_add_arg(&args, "libvirt_lxc") == -1 ||
fuse_opt_add_arg(&args, "-odirect_io") == -1 ||
+ fuse_opt_add_arg(&args, "-oallow_other") == -1 ||
fuse_opt_add_arg(&args, "-ofsname=libvirt") == -1)
goto cleanup1;
--
1.8.1.4
11 years, 5 months
[libvirt] [PATCH] docs: add spaces to formatstorage.html
by Ján Tomko
Let the pool types breathe.
---
Trivial.
docs/formatstorage.html.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/formatstorage.html.in b/docs/formatstorage.html.in
index 9c3be67..1a45915 100644
--- a/docs/formatstorage.html.in
+++ b/docs/formatstorage.html.in
@@ -17,9 +17,9 @@
<p>
The top level tag for a storage pool document is 'pool'. It has
a single attribute <code>type</code>, which is one of <code>dir</code>,
- <code>fs</code>,<code>netfs</code>,<code>disk</code>,<code>iscsi</code>,
- <code>logical</code>. This corresponds to the storage backend drivers
- listed further along in this document.
+ <code>fs</code>, <code>netfs</code>, <code>disk</code>,
+ <code>iscsi</code>, <code>logical</code>. This corresponds to the
+ storage backend drivers listed further along in this document.
The storage pool XML format is available <span class="since">since 0.4.1</span>
</p>
<h3><a name="StoragePoolFirst">General metadata</a></h3>
--
1.8.1.5
11 years, 5 months
[libvirt] [PATCH] qemu: Report the offset from host UTC for RTC_CHANGE event
by Osier Yang
https://bugzilla.redhat.com/show_bug.cgi?id=964177
Though both libvirt and QEMU's document say RTC_CHANGE returns
the offset from the host UTC, qemu actually returns the offset
from the specified date instead when specific date is privided
(-rtc base=$date).
It's not safe for qemu to fix it in code, it worked like that
for 3 years, changing it now may break other QEMU use cases.
What qemu tries to do is to fix the document:
http://lists.gnu.org/archive/html/qemu-devel/2013-05/msg04782.html
And in libvirt side, instead of reply on the qemu, this covert
the offset returned from qemu to the offset from host UTC, by:
/*
* a: the offset from qemu RTC_CHANGE event
* b: The specified date (-rtc base=$date)
* c: the host date when libvirt gets the RTC_CHANGE event
* offset: What libvirt will report
*/
offset = a + (b - c);
The specified date (-rtc base=$date) is recorded in clock's def as
an internal only member (may be useful to exposed outside?).
---
src/conf/domain_conf.h | 3 +++
src/qemu/qemu_command.c | 3 +++
src/qemu/qemu_process.c | 12 ++++++++++++
3 files changed, 18 insertions(+)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 3a71d6c..3947a56 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1767,6 +1767,9 @@ struct _virDomainClockDef {
struct {
long long adjustment;
int basis;
+
+ /* Store the start time of guest process, internaly only */
+ time_t starttime;
} variable;
/* Timezone name, when
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index c4a162a..9254525 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5518,6 +5518,9 @@ qemuBuildClockArgStr(virDomainClockDefPtr def)
now += def->data.variable.adjustment;
gmtime_r(&now, &nowbits);
+ /* Store the starttime of qemu process */
+ def->data.variable.starttime = now;
+
virBufferAsprintf(&buf, "base=%d-%02d-%02dT%02d:%02d:%02d",
nowbits.tm_year + 1900,
nowbits.tm_mon + 1,
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index d4fd4fb..e6f0b6d 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -796,6 +796,18 @@ qemuProcessHandleRTCChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virObjectLock(vm);
+
+ /* QEMU's RTC_CHANGE event returns the offset from the specified
+ * date instead of the host UTC if a specific date is provided
+ * (-rtc base=$date). We need to convert it to be offset from
+ * host UTC.
+ */
+ if (vm->def->clock.offset == VIR_DOMAIN_CLOCK_OFFSET_VARIABLE) {
+ time_t now = time(NULL);
+
+ offset += vm->def->clock.data.variable.starttime - now;
+ }
+
event = virDomainEventRTCChangeNewFromObj(vm, offset);
if (vm->def->clock.offset == VIR_DOMAIN_CLOCK_OFFSET_VARIABLE)
--
1.8.1.4
11 years, 5 months
[libvirt] [PATCH] Remove legacy code for single-instance devpts filesystem
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
An earlier commit dropped support for using LXC with kernels
having single-instance devpts filesystem from the LXC
controller. It forgot to remove the same code from the LXC
container setup.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/lxc/lxc_container.c | 25 +++++++------------------
1 file changed, 7 insertions(+), 18 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index c74e3ca..181f6c8 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -869,25 +869,14 @@ static int lxcContainerPopulateDevices(char **ttyPaths, size_t nttyPaths)
}
}
- if (access("/dev/pts/ptmx", W_OK) == 0) {
- /* We have private devpts capability, so bind that */
- if (virFileTouch("/dev/ptmx", 0666) < 0)
- return -1;
+ /* We have private devpts capability, so bind that */
+ if (virFileTouch("/dev/ptmx", 0666) < 0)
+ return -1;
- if (mount("/dev/pts/ptmx", "/dev/ptmx", "ptmx", MS_BIND, NULL) < 0) {
- virReportSystemError(errno, "%s",
- _("Failed to bind /dev/pts/ptmx on to /dev/ptmx"));
- return -1;
- }
- } else {
- /* Legacy devpts, so we need to just use shared one */
- dev_t dev = makedev(LXC_DEV_MAJ_TTY, LXC_DEV_MIN_PTMX);
- if (mknod("/dev/ptmx", S_IFCHR, dev) < 0 ||
- chmod("/dev/ptmx", 0666)) {
- virReportSystemError(errno, "%s",
- _("Failed to make device /dev/ptmx"));
- return -1;
- }
+ if (mount("/dev/pts/ptmx", "/dev/ptmx", "ptmx", MS_BIND, NULL) < 0) {
+ virReportSystemError(errno, "%s",
+ _("Failed to bind /dev/pts/ptmx on to /dev/ptmx"));
+ return -1;
}
for (i = 0; i < nttyPaths; i++) {
--
1.8.1.4
11 years, 5 months
[libvirt] ARM libvirt compiling error
by Michele Paolino
Hello,
I'm trying to set up a development environment on an Arndale (ARM Samsung
Exynos 5250) board to work on sVirt. I'm using Debian 7.0, I've downloaded
the source code from GIT and than:
./autogen.sh --prefix=$HOME/usr
make
but in the middle of make execution, the program fails with this error:
conf/domain_conf.c: In function 'virDomainHostdevDefParseXML':
conf/domain_conf.c:3915:36: error: 'next_unit' may be used uninitialized in
this function [-Werror=uninitialized]
conf/domain_conf.c:3886:9: note: 'next_unit' was declared here
conf/domain_conf.c: At top level:
cc1: error: unrecognized command line option
"-Wno-unused-command-line-argument" [-Werror]
I've solved this problem simply initializing the "next_unit" variable (file
src/conf/domain_conf.c, line 3886). This is the diff between the original
file and the modified one:
3886c3886
< int next_unit;
---
> int next_unit = -1;
Another way to solve is obviously with --disable-werror, but I guess this
is not the best way.
My gcc version is 4.6.3 (Debian 4.6.3-14), kernel version is 3.8.0-rc4.
Maybe it's only a compiler problem, but can anyone confirm this?
Is it worth to submit a new bug report/patch the source?
Regards,
Michele
--
*Michele Paolino **
*Virtual Open Systems*
**Open Source KVM Virtualization Developments
Multicore Systems Virtualization Porting Services
*Web*:* *www.virtualopensystems.com*
11 years, 5 months