Re: [libvirt] [Xen-devel] dom0 kenrel crashes for openstack + libvirt + libxl
by Ian Campbell
On Fri, 2014-11-21 at 14:18 +0000, David Vrabel wrote:
> On 21/11/14 14:05, Ian Campbell wrote:
> > On Fri, 2014-11-21 at 09:28 +0000, Ian Campbell wrote:
> >> I think libvirt is wrong to specify an absolute path here, IMHO by
> >> default it should just specify "pygrub" and let libxl figure out the
> >> correct path. Jim, what do you think?
> >
> > e.g. something like the following untested (but pretty obvious[0])
> > patch.
> [...]
> > +# define "pygrub"
>
> I'm going to go with pretty obviously broken. You're missing the macro
> name.
Doh! Indeed...
Lets try that again...
8<----------
>From 9f2d8da8264b426f54b92378e9e00973694193d4 Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell(a)citrix.com>
Date: Fri, 21 Nov 2014 14:00:38 +0000
Subject: [PATCH] libxl: Allow libxl to find pygrub binary.
Specifying an explicit path to pygrub (e.g. BINDIR "/pygrub") only works if
Xen and libvirt happen to be installed to the same prefix. A more flexible
approach is to simply specify "pygrub" which will cause libxl to use the
correct path which it knows (since it is built with the same prefix as pygrub).
This is particular problematic in the Debian packaging, since the Debian Xen
package relocates pygrub into a libexec dir, however I think this change makes
sense upstream.
Signed-off-by: Ian Campbell <ian.campbell(a)citrix.com>
---
.gnulib | 2 +-
src/libxl/libxl_conf.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.gnulib b/.gnulib
index 9565c3b..2d28074 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 9565c3be73eb6d76b7b42a21d68d2e00a62abb6d
+Subproject commit 2d280742a9e30088aa169f53353765d5daafe4c0
diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
index 25f77ea..d7a3971 100644
--- a/src/libxl/libxl_conf.h
+++ b/src/libxl/libxl_conf.h
@@ -53,7 +53,7 @@
# define LIBXL_LIB_DIR LOCALSTATEDIR "/lib/libvirt/libxl"
# define LIBXL_SAVE_DIR LIBXL_LIB_DIR "/save"
# define LIBXL_DUMP_DIR LIBXL_LIB_DIR "/dump"
-# define LIBXL_BOOTLOADER_PATH BINDIR "/pygrub"
+# define LIBXL_BOOTLOADER_PATH "pygrub"
/* libxl interface for setting VCPU affinity changed in 4.5. In fact, a new
* parameter has been added, representative of 'VCPU soft affinity'. If one
--
1.7.10.4
10 years
Re: [libvirt] [Xen-devel] dom0 kenrel crashes for openstack + libvirt + libxl
by Ian Campbell
On Fri, 2014-11-21 at 09:28 +0000, Ian Campbell wrote:
> I think libvirt is wrong to specify an absolute path here, IMHO by
> default it should just specify "pygrub" and let libxl figure out the
> correct path. Jim, what do you think?
e.g. something like the following untested (but pretty obvious[0])
patch.
I'm currently rebuilding Debian's libvirt package with this included so
I can give it a go.
Ian.
[0] famous last words, I know!
8<---------------
>From 4edbcbdc7e28896121832d8e226e7aeccf30633c Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell(a)citrix.com>
Date: Fri, 21 Nov 2014 14:00:38 +0000
Subject: [PATCH] libxl: Allow libxl to find pygrub binary.
Specifying an explicit path to pygrub (e.g. BINDIR "/pygrub") only works if
Xen and libvirt happen to be installed to the same prefix. A more flexible
approach is to simply specify "pygrub" which will cause libxl to use the
correct path which it knows (since it is built with the same prefix as pygrub).
This is particular problematic in the Debian packaging, since the Debian Xen
package relocates pygrub into a libexec dir, however I think this change makes
sense upstream.
Signed-off-by: Ian Campbell <ian.campbell(a)citrix.com>
---
src/libxl/libxl_conf.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
index 25f77ea..3669e68 100644
--- a/src/libxl/libxl_conf.h
+++ b/src/libxl/libxl_conf.h
@@ -53,7 +53,7 @@
# define LIBXL_LIB_DIR LOCALSTATEDIR "/lib/libvirt/libxl"
# define LIBXL_SAVE_DIR LIBXL_LIB_DIR "/save"
# define LIBXL_DUMP_DIR LIBXL_LIB_DIR "/dump"
-# define LIBXL_BOOTLOADER_PATH BINDIR "/pygrub"
+# define "pygrub"
/* libxl interface for setting VCPU affinity changed in 4.5. In fact, a new
* parameter has been added, representative of 'VCPU soft affinity'. If one
--
1.7.10.4
10 years
[libvirt] [PATCH 00/12] Unbreak vm's backed by RBD disks
by Peter Krempa
After recent refactors, starting a VM whose disk is backed by RBD storage would
fail as the parser for the backing file specification string was not
implemented in the metadata crawler.
Reuse qemu's parser to do this and fix a few things around.
Peter Krempa (12):
docs: domain: Move docs for storage hosts under the <source> element
test: virstoragetest: Add testing of network disk details
util: buffer: Clarify scope of the escape operation in virBufferEscape
util: storage: Add notice for extension of struct virStorageSource
util: storage: Copy hosts of a storage file only if they exist
qemu: Refactor qemuBuildNetworkDriveURI to take a virStorageSourcePtr
tests: Reflow the expected output from RBD disk test
util: split out qemuParseRBDString into a common helper
util: storagefile: Split out parsing of NBD string into a separate
func
storage: Allow parsing of RBD backing strings when building backing
chain
storage: rbd: qemu: Add support for specifying internal RBD snapshots
storage: rbd: Implement support for passing config file option
docs/formatdomain.html.in | 128 +++++----
docs/schemas/domaincommon.rng | 16 ++
src/conf/domain_conf.c | 52 +++-
src/conf/domain_conf.h | 1 +
src/conf/snapshot_conf.c | 6 +-
src/libvirt_private.syms | 1 +
src/qemu/qemu_command.c | 268 +++++-------------
src/util/virbuffer.c | 5 +-
src/util/virstoragefile.c | 313 +++++++++++++++++----
src/util/virstoragefile.h | 14 +-
.../qemuxml2argv-disk-drive-network-rbd.args | 16 +-
.../qemuxml2argv-disk-drive-network-rbd.xml | 25 ++
tests/virstoragetest.c | 65 ++++-
13 files changed, 587 insertions(+), 323 deletions(-)
--
2.1.0
10 years
[libvirt] [PATCH] virsh: sync domdisplay help and manual
by Martin Kletzander
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
tools/virsh-domain.c | 2 +-
tools/virsh.pod | 8 +++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index cf45a88..0572275 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -9915,7 +9915,7 @@ static const vshCmdOptDef opts_domdisplay[] = {
},
{.name = "type",
.type = VSH_OT_DATA,
- .help = N_("select particular graphics display "
+ .help = N_("select particular graphical display "
"(e.g. \"vnc\", \"spice\", \"rdp\")")
},
{.name = NULL}
diff --git a/tools/virsh.pod b/tools/virsh.pod
index d5608cc..5a577f6 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -1138,11 +1138,13 @@ I<size> is a scaled integer (see B<NOTES> above) which defaults to KiB
"B" to get bytes (note that for historical reasons, this differs from
B<vol-resize> which defaults to bytes without a suffix).
-=item B<domdisplay> I<domain> [I<--include-password>]
+=item B<domdisplay> I<domain> [I<--include-password>] [[I<--type>] B<type>]
Output a URI which can be used to connect to the graphical display of the
-domain via VNC, SPICE or RDP. If I<--include-password> is specified, the
-SPICE channel password will be included in the URI.
+domain via VNC, SPICE or RDP. The particular graphical display type can
+be selected using the B<type> parameter (e.g. "vnc", "spice", "rdp"). If
+I<--include-password> is specified, the SPICE channel password will be
+included in the URI.
=item B<domfsfreeze> I<domain> [[I<--mountpoint>] B<mountpoint>...]
--
2.1.3
10 years
[libvirt] [PATCH 00/11] Introduce guest agent lifecycle event and impl for qemu
by Peter Krempa
Peter Krempa (11):
qemu: process: report useful error if alias formatting fails
conf: Annotate source enums for character device struct members
test: xml2xml: Print full filenames if xml2xml test fails
qemu: monitor: Rename and improve qemuMonitorGetPtyPaths
conf: Add channel state for virtio channels to the XML
qemu: Add handling for VSERPORT_CHANGE event
qemu: chardev: Extract more information about character devices
qemu: process: Refresh virtio channel guest state when connecting to
mon
event: Add guest agent lifecycle event
examples: Add support for the guest agent lifecycle event
qemu: Emit the guest agent lifecycle event
daemon/remote.c | 36 +++++
docs/formatdomain.html.in | 9 +-
docs/schemas/domaincommon.rng | 3 +
examples/object-events/event-test.c | 43 +++++-
include/libvirt/libvirt-domain.h | 28 ++++
src/conf/domain_conf.c | 35 ++++-
src/conf/domain_conf.h | 19 ++-
src/conf/domain_event.c | 78 ++++++++++
src/conf/domain_event.h | 9 ++
src/libvirt_private.syms | 2 +
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_driver.c | 62 ++++++++
src/qemu/qemu_monitor.c | 56 ++++++--
src/qemu/qemu_monitor.h | 20 ++-
src/qemu/qemu_monitor_json.c | 84 ++++++++---
src/qemu/qemu_monitor_json.h | 4 +-
src/qemu/qemu_monitor_text.c | 21 ++-
src/qemu/qemu_monitor_text.h | 4 +-
src/qemu/qemu_process.c | 157 ++++++++++++++++++---
src/remote/remote_driver.c | 31 ++++
src/remote/remote_protocol.x | 16 ++-
src/remote_protocol-structs | 7 +
tests/qemumonitorjsontest.c | 59 +++++---
.../qemuxml2argv-channel-virtio-state.args | 17 +++
.../qemuxml2argv-channel-virtio-state.xml | 42 ++++++
tests/qemuxml2argvtest.c | 2 +
.../qemuxml2xmlout-channel-virtio-state-active.xml | 43 ++++++
...emuxml2xmlout-channel-virtio-state-inactive.xml | 42 ++++++
tests/qemuxml2xmltest.c | 3 +-
tests/testutils.c | 35 ++++-
tests/testutils.h | 5 +
tools/virsh-domain.c | 40 ++++++
32 files changed, 922 insertions(+), 91 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-state.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-state.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-state-active.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-state-inactive.xml
--
2.1.0
10 years
[libvirt] [PATCH] docs: fix a typo in formatdomain.html
by Chen Fan
Signed-off-by: Chen Fan <chen.fan.fnst(a)cn.fujitsu.com>
---
docs/formatdomain.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 9364eb5..6a15074 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3413,7 +3413,7 @@
setting for the attribute is <code>no</code> for security
reasons and support depends on the guest network device model as
well as the type of connection on the host - currently it is
- only supported for the virtio ddevice model and for macvtap
+ only supported for the virtio device model and for macvtap
connections on the host.
</p>
<p>
--
1.9.3
10 years
[libvirt] [PATCH] storage: qemu: Fix security labelling of new image chain elements
by Peter Krempa
When creating a disk image snapshot the libvirt code would blindly copy
the parents label to the newly created image. This runs into problems
when you start a VM from an image hosted on NFS (or other storage system
that doesn't support selinux labels) and the snapshot destination is on
a storage system that does support selinux labels. Libvirt's code in
that case generates a different security label for the image hosted on
NFS. This label is valid only for NFS images and doesn't allow access in
case of a locally stored image.
To fix this issue libvirt needs to refrain from copying security
information in cases where the default domain seclabel is a better
choice.
This patch repurposes the now unused @force argument of
virStorageSourceInitChainElement to denote whether a copy of the
security labelling stuff should be attempted or not. This allows to
fine-control the copy operation for cases where we need to keep the
label of the old disk vs. the cases where we need to keep the label
unset to use the default domain imagelabel.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1151718
---
Note:
I've opted not to change to use the default label when doing a block-copy via
the old API as there is no way to specify a new label all other options now
allow to provide a different label via the XML that was provided by the user.
src/qemu/qemu_driver.c | 14 ++++++++------
src/qemu/qemu_process.c | 2 +-
src/util/virstoragefile.c | 16 +++++++---------
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 74d1bdc..0343713 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15861,7 +15861,8 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
unsigned long long bandwidth,
unsigned int granularity,
unsigned long long buf_size,
- unsigned int flags)
+ unsigned int flags,
+ bool keepParentLabel)
{
virQEMUDriverPtr driver = conn->privateData;
qemuDomainObjPrivatePtr priv;
@@ -15992,7 +15993,8 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
if (mirror->format > 0)
format = virStorageFileFormatTypeToString(mirror->format);
- if (virStorageSourceInitChainElement(mirror, disk->src, false) < 0)
+ if (virStorageSourceInitChainElement(mirror, disk->src,
+ keepParentLabel) < 0)
goto endjob;
if (qemuDomainPrepareDiskChainElement(driver, vm, mirror,
@@ -16104,7 +16106,7 @@ qemuDomainBlockRebase(virDomainPtr dom, const char *path, const char *base,
flags &= (VIR_DOMAIN_BLOCK_REBASE_SHALLOW |
VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT);
ret = qemuDomainBlockCopyCommon(vm, dom->conn, path, dest,
- bandwidth, 0, 0, flags);
+ bandwidth, 0, 0, flags, true);
vm = NULL;
dest = NULL;
@@ -16177,8 +16179,8 @@ qemuDomainBlockCopy(virDomainPtr dom, const char *disk, const char *destxml,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
- ret = qemuDomainBlockCopyCommon(vm, dom->conn, disk, dest,
- bandwidth, granularity, buf_size, flags);
+ ret = qemuDomainBlockCopyCommon(vm, dom->conn, disk, dest, bandwidth,
+ granularity, buf_size, flags, false);
vm = NULL;
cleanup:
@@ -16353,7 +16355,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
goto endjob;
if (virStorageSourceInitChainElement(mirror,
disk->src,
- false) < 0)
+ true) < 0)
goto endjob;
}
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index b782984..1f22bd0 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1064,7 +1064,7 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
copy = virStorageSourceCopy(disk->mirror, false);
if (virStorageSourceInitChainElement(copy,
persistDisk->src,
- false) < 0) {
+ true) < 0) {
VIR_WARN("Unable to update persistent definition "
"on vm %s after block job",
vm->def->name);
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index aa97f75..5287c51 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -1900,28 +1900,26 @@ virStorageSourceCopy(const virStorageSource *src,
* virStorageSourceInitChainElement:
* @newelem: New backing chain element disk source
* @old: Existing top level disk source
- * @force: Force-copy the information
+ * @transferLabels: Transfer security lables.
*
* Transfers relevant information from the existing disk source to the new
* backing chain element if they weren't supplied so that labelling info
* and possibly other stuff is correct.
*
- * If @force is true, user-supplied information for the new backing store
- * element is overwritten from @old instead of keeping it.
+ * If @transferLabels is true, security labels from the existing disk are copied
+ * to the new disk. Otherwise the default domain imagelabel label will be used.
*
* Returns 0 on success, -1 on error.
*/
int
virStorageSourceInitChainElement(virStorageSourcePtr newelem,
virStorageSourcePtr old,
- bool force)
+ bool transferLables)
{
int ret = -1;
- if (force)
- virStorageSourceSeclabelsClear(newelem);
-
- if (!newelem->seclabels &&
+ if (transferLables &&
+ !newelem->seclabels &&
virStorageSourceSeclabelsCopy(newelem, old) < 0)
goto cleanup;
@@ -2367,7 +2365,7 @@ virStorageSourceNewFromBacking(virStorageSourcePtr parent)
}
/* copy parent's labelling and other top level stuff */
- if (virStorageSourceInitChainElement(ret, parent, false) < 0)
+ if (virStorageSourceInitChainElement(ret, parent, true) < 0)
goto error;
}
--
2.1.0
10 years
[libvirt] [PATCH v2 0/5] Guest filesystem information API
by Tomoki Sekiyama
Hi,
This is v2 of patchset to add virDomainGetFSInfo API.
* changes in v1->v2:
-[all] removed redundant NULL element at the last of returned info array
-[3/5] make error messages in qemu_agent.c consistent with other commands
-[4/5] added a test case for 2 items in info->devAliases
-[5/5] added a pod document for virsh domfsinfo command
(v1: http://www.redhat.com/archives/libvir-list/2014-October/msg00001.html )
* summary
This series implements a new virDomainGetFSInfo API, that returns a list of
mounted filesystems information in the guest, collected via the guest agent.
The returned info contains mountpoints and disk device alias named in
libvirt, so we can know which mountpoints should be frozen by
virDomainFSFreeze to take snapshots of a part of disks.
---
Tomoki Sekiyama (5):
Implement public API for virDomainGetFSInfo
remote: Implement the remote protocol for virDomainGetFSInfo
qemu: Implement the qemu driver for virDomainGetFSInfo
qemu: add test for qemuAgentGetFSInfo
virsh: expose virDomainGetFSInfo
daemon/remote.c | 117 ++++++++++++++++++++
include/libvirt/libvirt-domain.h | 21 ++++
src/conf/domain_conf.c | 71 ++++++++++++
src/conf/domain_conf.h | 6 +
src/driver-hypervisor.h | 6 +
src/libvirt.c | 66 +++++++++++
src/libvirt_private.syms | 1
src/libvirt_public.syms | 6 +
src/qemu/qemu_agent.c | 178 ++++++++++++++++++++++++++++++
src/qemu/qemu_agent.h | 2
src/qemu/qemu_driver.c | 48 ++++++++
src/remote/remote_driver.c | 92 ++++++++++++++++
src/remote/remote_protocol.x | 32 +++++
src/remote_protocol-structs | 21 ++++
src/rpc/gendispatch.pl | 1
tests/Makefile.am | 1
tests/qemuagentdata/qemuagent-fsinfo.xml | 39 +++++++
tests/qemuagenttest.c | 143 ++++++++++++++++++++++++
tools/virsh-domain.c | 74 ++++++++++++
tools/virsh.pod | 9 ++
20 files changed, 933 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuagentdata/qemuagent-fsinfo.xml
--
Tomoki Sekiyama
10 years
[libvirt] [PATCH] build: avoid 32-bit failure on older gcc
by Eric Blake
On 32-bit platforms with old gcc (hello RHEL 5 gcc 4.1.2), the
build fails with:
virsh-domain.c: In function 'cmdBlockCopy':
virsh-domain.c:2172: warning: comparison is always false due to limited range of data type
Adjust the code to silence the warning.
* tools/virsh-domain.c (cmdBlockCopy): Pacify RHEL 5 gcc.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule.
tools/virsh-domain.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 7184784..cf45a88 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -2169,7 +2169,8 @@ cmdBlockCopy(vshControl *ctl, const vshCmd *cmd)
if (bandwidth) {
/* bandwidth is ulong MiB/s, but the typed parameter is
* ullong bytes/s; make sure we don't overflow */
- if (bandwidth + 0ULL > ULLONG_MAX >> 20) {
+ unsigned long long limit = MIN(ULONG_MAX, ULLONG_MAX >> 20);
+ if (bandwidth > limit) {
virReportError(VIR_ERR_OVERFLOW,
_("bandwidth must be less than %llu"),
ULLONG_MAX >> 20);
--
1.9.3
10 years
[libvirt] [PATCH] build: fix build when not using dbus
by Eric Blake
Commit c0e7022 breaks on a machine that lacks dbus headers:
In file included from util/virdbus.c:24:0:
util/virdbuspriv.h:31:3: error: unknown type name 'dbus_int16_t'
* src/util/virdbuspriv.h (DBusBasicValue): Only provide fallback
when dbus is compiled.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule (I feel like I'm in whack-a-mole
mode right now, where my fix for one problem causes a failure in
another environment. Sorry for the churn)
src/util/virdbuspriv.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virdbuspriv.h b/src/util/virdbuspriv.h
index 4247746..74b395f 100644
--- a/src/util/virdbuspriv.h
+++ b/src/util/virdbuspriv.h
@@ -24,7 +24,7 @@
# include "virdbus.h"
-# if !HAVE_DBUSBASICVALUE
+# if defined(WITH_DBUS) && !HAVE_DBUSBASICVALUE
/* Copied (and simplified) from dbus 1.6.12, for use with older dbus headers */
typedef union
{
--
1.9.3
10 years