[libvirt] [PATCH] Remove the redundant parentheses in migrate help
by Yanbing Du
Signed-off-by: Yanbing Du <ydu(a)redhat.com>
---
tools/virsh-domain.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 128e516..592a6e8 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -8286,7 +8286,7 @@ static const vshCmdOptDef opts_migrate[] = {
},
{.name = "change-protection",
.type = VSH_OT_BOOL,
- .help = N_("prevent any configuration changes to domain until migration ends)")
+ .help = N_("prevent any configuration changes to domain until migration ends")
},
{.name = "unsafe",
.type = VSH_OT_BOOL,
--
1.7.1
11 years, 8 months
[libvirt] libvirt<->QEMU interfaces for CPU models
by Eduardo Habkost
Hi,
After a long time trying to figure out the proper modelling inside QEMU,
I believe the plans are now clearer in QEMU, so it's time to coordinate
more closely with libvirt to try to make use of the new stuff.
I tried to enumerate the libvirt requirements and current problems, and
how we should be able to solve those problems using the X86CPU
subclasses and properties, on the following wiki page:
http://wiki.qemu.org/Features/CPUModels#Interfaces.2Frequirements_from_li...
I am pasting the section contents below, to facilitate discussion:
= Ensuring predictable set of guest features =
Requirement: libvirt needs to ensure all features required on the command-line
are present and exposed to the guest.
Current problem: libvirt doesn't use the "enforce" flag so it can't guarantee
that a given feature will be actually exposed to the guest.
Solution: use the "enforce" flag on the "-cpu" option.
Limitation: no proper machine-friendly interface to report which features
are missing.
Workaround: See "querying for host capabilities" below.
== Future plans ==
Machine-friendly reporting of missing host features/capabilities.
= Listing CPU models =
Requirement: libvirt needs to know which CPU models are available to be used
with the "-cpu" option.
Current problem: libvirt relies on help output parsing for that.
Solution: use QMP qom-list-types command.
Dependency: X86CPU subclasses.
Limitation: needs a live QEMU process for the query.
Solution: use QMP query-cpu-definitions command.
Limitation: needs a live QEMU process for the query.
== Future plans ==
It would be interesting to get rid of the requirement for a live QEMU process
(with a complete machine being created) to be already running.
= Getting information about CPU models =
Requirement: libvirt uses the predefined CPU models from QEMU, but it needs to
be able to query for CPU model details, to find out how it can create a VM that
matches what was requested by the user.
Current problem: libvirt has a copy of the CPU model definitions on its
cpu_map.xml file, and the copy can be out of sync in case CPU models in QEMU
change. libvirt also assumes that the set of features on each model is always
the same on all machine-types, which is not true.
Challenge: the resulting CPU features depend on lots of factors, including
the machine-type.
Workaround: start a paused VM and query for the CPU device information
after the CPU was created.
Solution: start a paused VM with no devices, but with the right
machine-type and right CPU model. Use QMP QOM commands to query for CPU
flags (especially the properties starting with the "f-" prefix).
Dependency: X86CPU feature properties ("f-*" properties).
Limitation: requires a live QEMU process with the right machine-type/
CPU-model to be started, to make the query.
Requirement: libvirt needs to know if a specific CPU model can be used in the
current host.
See "Ensuring predictable set of guest features" above
See "Querying host capabilities" below
= Querying host capabilities =
Requirement: libvirt needs to know which feature can really be enabled, before
it tries to start a VM, and before it tries to start a live-migration process.
The set of available capabilities depend on:
• Host CPU (hardware) capabilities;
• Kernel capabilities (reported by GET_SUPPORTED_CPUID);
• QEMU capabilities;
• Specific configuration options (e.g. in-kernel IRQ chip is required for
some features).
Current problem: libvirt uses the CPUID intruction directly and assumes that
the presence of a feature in the host CPU means it can be enabled and exposed
to the guest. This breaks when virtualization of a feature requires:
• Additional hardware support (e.g. INVPCID);
• Additional host kernel code (this applies to _all_ CPU features, that need
to be reported as supported by GET_SUPPORTED_CPUID);
• Additional QEMU-side code;
• Specific configuration options (e.g. in-kernel IRQ chip).
Challenge: QEMU doesn't have a generic capability-querying interface, and host
capability querying depends on KVM to be initialized.
Workaround: start a paused VM using the "host" CPU model, that has every
single CPU feature supported by the host enabled by default, and query for
the information about the CPU though QMP, using the QOM commands.
Current solution: start a paused VM with no devices but with "host" CPU model
and use QMP QOM commands to query for the enabled CPU features.
Dependency: X86CPU feature properties
== Future plans ==
It would be interesting to have a more generic capability-querying interface
that doesn't require starting a whole machine with a live QEMU process.
See also: -query-capabilities RFC series from Anthony
Message-Id: <1332169763-30665-9-git-send-email-aliguori(a)us.ibm.com>
--
Eduardo
11 years, 8 months
[libvirt] [PATCH] Revert "qemu: detect multi-head qxl via more than version check"
by Eric Blake
This reverts commit 5ac846e42e5b7e0475f6aa9cc1e0b0c8dac84d44.
After further discussions with Alon Levy, I learned the following:
The use of '-vga qxl' vs. '-device qxl-vga' is completely orthogonal
to whether ram_size can be exposed. Downstream distros are interested
in backporting support for multi-head qxl, but this can be done in
one of two ways:
1. Support one head per PCI device. If you do this, then it makes
sense to have full control over the PCI address of each device. For
full control, you need '-device qxl-vga' instead of '-vga qxl'.
2. Support multiple heads through a single PCI device. If you do
this, then you need to allocate more RAM to that PCI device (enough
ram to cover the multiple screens). Here, the device is hard-coded
to 0:0:2.0, both in qemu and libvirt code.
Apparently, backporting ram_size changes to allow multiple heads in
a single device is much easier than backporting multiple device
support. Furthermore, the presence or absence of qxl-vga.surfaces
is no different than the presence or absence of qxl-vga.ram_size;
both properties can be applied regardless of whether you have one
PCI device (-vga qxl) or multiple (-device qxl-vga), so this property
is NOT a good witness of whether '-device qxl-vga' support has been
backported.
Downstream RHEL will NOT be using this patch; and worse, leaving this
patch in risks doing the wrong thing if compiling upstream libvirt
on RHEL, so the best course of action is to revert it. That means
that libvirt will go back to only using '-device qxl-vga' for qemu
>= 1.2, but this is just fine because we know of no distros that plan
on backporting multiple PCI address support to any older version of
qemu. Meanwhile, downstream can still use ram_size to pack multiple
heads through a single PCI device.
---
src/qemu/qemu_capabilities.c | 7 -------
tests/qemuhelpdata/qemu-1.2.0-device | 16 ----------------
tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta-device | 10 ----------
tests/qemuhelpdata/qemu-kvm-1.2.0-device | 16 ----------------
4 files changed, 49 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 519d2c5..9a1b781 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1387,10 +1387,6 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUsbHost[] = {
{ "bootindex", QEMU_CAPS_USB_HOST_BOOTINDEX },
};
-static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxlVga[] = {
- { "surfaces", QEMU_CAPS_DEVICE_VIDEO_PRIMARY },
-};
-
struct virQEMUCapsObjectTypeProps {
const char *type;
struct virQEMUCapsStringFlags *props;
@@ -1424,8 +1420,6 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
ARRAY_CARDINALITY(virQEMUCapsObjectPropsUsbRedir) },
{ "usb-host", virQEMUCapsObjectPropsUsbHost,
ARRAY_CARDINALITY(virQEMUCapsObjectPropsUsbHost) },
- { "qxl-vga", virQEMUCapsObjectPropsQxlVga,
- ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxlVga) },
};
@@ -1623,7 +1617,6 @@ virQEMUCapsExtractDeviceStr(const char *qemu,
"-device", "usb-redir,?",
"-device", "ide-drive,?",
"-device", "usb-host,?",
- "-device", "qxl-vga,?",
NULL);
/* qemu -help goes to stdout, but qemu -device ? goes to stderr. */
virCommandSetErrorBuffer(cmd, &output);
diff --git a/tests/qemuhelpdata/qemu-1.2.0-device b/tests/qemuhelpdata/qemu-1.2.0-device
index 027d99a..5613e00 100644
--- a/tests/qemuhelpdata/qemu-1.2.0-device
+++ b/tests/qemuhelpdata/qemu-1.2.0-device
@@ -208,19 +208,3 @@ usb-host.bootindex=int32
usb-host.pipeline=on/off
usb-host.port=string
usb-host.full-path=on/off
-qxl-vga.ram_size=uint32
-qxl-vga.vram_size=uint32
-qxl-vga.revision=uint32
-qxl-vga.debug=uint32
-qxl-vga.guestdebug=uint32
-qxl-vga.cmdlog=uint32
-qxl-vga.ram_size_mb=uint32
-qxl-vga.vram_size_mb=uint32
-qxl-vga.vram64_size_mb=uint32
-qxl-vga.vgamem_mb=uint32
-qxl-vga.surfaces=int32
-qxl-vga.addr=pci-devfn
-qxl-vga.romfile=string
-qxl-vga.rombar=uint32
-qxl-vga.multifunction=on/off
-qxl-vga.command_serr_enable=on/off
diff --git a/tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta-device b/tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta-device
index 5eab539..ee0fd78 100644
--- a/tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta-device
+++ b/tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta-device
@@ -118,13 +118,3 @@ virtio-net-pci.addr=pci-devfn
virtio-net-pci.romfile=string
virtio-net-pci.rombar=uint32
virtio-net-pci.multifunction=on/off
-qxl-vga.ram_size=uint32
-qxl-vga.vram_size=uint32
-qxl-vga.revision=uint32
-qxl-vga.debug=uint32
-qxl-vga.guestdebug=uint32
-qxl-vga.cmdlog=uint32
-qxl-vga.addr=pci-devfn
-qxl-vga.romfile=string
-qxl-vga.rombar=uint32
-qxl-vga.multifunction=on/off
diff --git a/tests/qemuhelpdata/qemu-kvm-1.2.0-device b/tests/qemuhelpdata/qemu-kvm-1.2.0-device
index ebc27f0..879a049 100644
--- a/tests/qemuhelpdata/qemu-kvm-1.2.0-device
+++ b/tests/qemuhelpdata/qemu-kvm-1.2.0-device
@@ -220,19 +220,3 @@ usb-host.bootindex=int32
usb-host.pipeline=on/off
usb-host.port=string
usb-host.full-path=on/off
-qxl-vga.ram_size=uint32
-qxl-vga.vram_size=uint32
-qxl-vga.revision=uint32
-qxl-vga.debug=uint32
-qxl-vga.guestdebug=uint32
-qxl-vga.cmdlog=uint32
-qxl-vga.ram_size_mb=uint32
-qxl-vga.vram_size_mb=uint32
-qxl-vga.vram64_size_mb=uint32
-qxl-vga.vgamem_mb=uint32
-qxl-vga.surfaces=int32
-qxl-vga.addr=pci-devfn
-qxl-vga.romfile=string
-qxl-vga.rombar=uint32
-qxl-vga.multifunction=on/off
-qxl-vga.command_serr_enable=on/off
--
1.8.1.4
11 years, 8 months
[libvirt] [PATCH] libvirt-guests: newline between output sentences
by Eric Blake
Right now, libvirt-guests gives awkward output. It's possible to
force faster failure by setting /etc/sysconfig/libvirt-guests to use:
ON_SHUTDOWN=shutdown
PARALLEL_SHUTDOWN=0
SHUTDOWN_TIMEOUT=1
ON_BOOT=ignore
at which point, we see:
$ service libvirt-guests restart
Running guests on default URI: a, b, d, c
Shutting down guests on default URI...
Starting shutdown on guest: a
Shutdown of guest a failed to complete in time.Starting shutdown on guest: b
Shutdown of guest b failed to complete in time.Starting shutdown on guest: d
Shutdown of guest d failed to complete in time.Starting shutdown on guest: c
Shutdown of guest c failed to complete in time.libvirt-guests is configured not to start any guests on boot
* tools/libvirt-guests.sh.in (shutdown_guest): Add missing newline.
Reported off-list by Xuesong Zhang.
---
tools/libvirt-guests.sh.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in
index 1c9c46b..4f2e203 100644
--- a/tools/libvirt-guests.sh.in
+++ b/tools/libvirt-guests.sh.in
@@ -269,6 +269,7 @@ shutdown_guest()
else
eval_gettext "Shutdown of guest \$name complete."
fi
+ echo
fi
}
--
1.8.1.4
11 years, 8 months
[libvirt] [PATCH] virsh: Fix docs for "virsh setmaxmem"
by Peter Krempa
The docs assumed the command works always for QEMU and other
hypervisors. Unfortunately until qemu will add memory hotplug
this can't be done. Fix the docs to mention this limitation.
---
tools/virsh.pod | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index b5e632e..07e7c24 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -1469,23 +1469,24 @@ paravirtualized or running the PV balloon driver.
=item B<setmaxmem> I<domain> B<size> [[I<--config>] [I<--live>] |
[I<--current>]]
Change the maximum memory allocation limit for a guest domain.
If I<--live> is specified, affect a running guest.
If I<--config> is specified, affect the next boot of a persistent guest.
If I<--current> is specified, affect the current guest state.
Both I<--live> and I<--config> flags may be given, but I<--current> is
exclusive. If no flag is specified, behavior is different depending
on hypervisor.
-This command works for at least the Xen, QEMU/KVM and vSphere/ESX hypervisors.
+Some hypervisors such as QEMU/KVM don't support live changes (especially
+increasing) of the maximum memory limit.
I<size> is a scaled integer (see B<NOTES> above); it defaults to kibibytes
(blocks of 1024 bytes) unless you provide a suffix (and the older option
name I<--kilobytes> is available as a deprecated synonym) . Libvirt rounds
up to the nearest kibibyte. Some hypervisors require a larger granularity
than KiB, and requests that are not an even multiple will be rounded up.
For example, vSphere/ESX rounds the parameter up to mebibytes (1024 kibibytes).
=item B<memtune> I<domain> [I<--hard-limit> B<size>]
[I<--soft-limit> B<size>] [I<--swap-hard-limit> B<size>]
[I<--min-guarantee> B<size>] [[I<--config>] [I<--live>] | [I<--current>]]
--
1.8.1.5
11 years, 8 months
[libvirt] [PATCH] lxc: Prevent shutting down the host
by Martin Kletzander
When the container has the same '/dev' mount as host (no chroot),
calling domainShutdown(WithFlags) shouldn't shutdown the host it is
running on.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
This is also valid for 1.0.[23]-maint branches, so in case this gets
ACK'd I'll either send a follow-up for those or push it there as well
(if the ACK says so).
src/lxc/lxc_driver.c | 45 ++++++++++++++++++++++++++++-----------------
1 file changed, 28 insertions(+), 17 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 8603078..ba14db7 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2012 Red Hat, Inc.
+ * Copyright (C) 2010-2013 Red Hat, Inc.
* Copyright IBM Corp. 2008
*
* lxc_driver.c: linux container driver functions
@@ -2778,13 +2778,19 @@ lxcDomainShutdownFlags(virDomainPtr dom,
virLXCDriverPtr driver = dom->conn->privateData;
virLXCDomainObjPrivatePtr priv;
virDomainObjPtr vm;
+ virDomainFSDefPtr root;
char *vroot = NULL;
int ret = -1;
- int rc;
+ int rc = 0;
+ bool methodSignal;
+ bool methodInitctl;
virCheckFlags(VIR_DOMAIN_SHUTDOWN_INITCTL |
VIR_DOMAIN_SHUTDOWN_SIGNAL, -1);
+ methodSignal = !!(flags & VIR_DOMAIN_SHUTDOWN_SIGNAL);
+ methodInitctl = !!(flags & VIR_DOMAIN_SHUTDOWN_INITCTL);
+
lxcDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
lxcDriverUnlock(driver);
@@ -2798,6 +2804,7 @@ lxcDomainShutdownFlags(virDomainPtr dom,
}
priv = vm->privateData;
+ root = virDomainGetRootFilesystem(vm->def);
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_OPERATION_INVALID,
@@ -2817,27 +2824,31 @@ lxcDomainShutdownFlags(virDomainPtr dom,
goto cleanup;
}
- if (flags == 0 ||
- (flags & VIR_DOMAIN_SHUTDOWN_INITCTL)) {
- if ((rc = virInitctlSetRunLevel(VIR_INITCTL_RUNLEVEL_POWEROFF,
- vroot)) < 0) {
+ if (root && root->src) {
+ if (flags == 0)
+ methodSignal = methodInitctl = true;
+ } else if (methodInitctl) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+ _("Cannot shutdown container using initctl "
+ "without separated namespace"));
+ goto cleanup;
+ } else {
+ methodSignal = true;
+ }
+
+ if (methodInitctl) {
+ rc = virInitctlSetRunLevel(VIR_INITCTL_RUNLEVEL_POWEROFF, vroot);
+ if (rc < 0)
goto cleanup;
- }
- if (rc == 0 && flags != 0 &&
- ((flags & ~VIR_DOMAIN_SHUTDOWN_INITCTL) == 0)) {
+ if (rc == 0 && !methodSignal) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("Container does not provide an initctl pipe"));
goto cleanup;
}
- } else {
- rc = 0;
}
-
- if (rc == 0 &&
- (flags == 0 ||
- (flags & VIR_DOMAIN_SHUTDOWN_SIGNAL))) {
- if (kill(priv->initpid, SIGTERM) < 0 &&
- errno != ESRCH) {
+ if (rc == 0 && methodSignal) {
+ ret = kill(priv->initpid, SIGTERM);
+ if (ret < 0 && errno != ESRCH) {
virReportSystemError(errno,
_("Unable to send SIGTERM to init pid %llu"),
(unsigned long long)priv->initpid);
--
1.8.1.5
11 years, 8 months
[libvirt] [PATCH] make: obey WITH_TESTS; do not run test suite when --enable-test-suite=no
by TJ
make: obey WITH_TESTS; do not run test suite when --enable-test-suite=no
Even when --enable-test-suite=no a build would run the test suite. Fix the Makefile so that
tests are conditional on WITH_TESTS.
Signed-off-by: TJ <libvirt(a)iam.tj>
---
Makefile.am | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index 5b1e27e..3b5e7a2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,10 +7,14 @@ LCOV = lcov
GENHTML = genhtml
SUBDIRS = gnulib/lib include src daemon tools docs gnulib/tests \
- python tests po examples/domain-events/events-c examples/hellolibvirt \
+ python po examples/domain-events/events-c examples/hellolibvirt \
examples/dominfo examples/domsuspend examples/python examples/apparmor \
examples/xml/nwfilter examples/openauth examples/systemtap
+if WITH_TESTS
+SUBDIRS += tests
+endif
+
ACLOCAL_AMFLAGS = -I m4 -I gnulib/m4
XML_EXAMPLES = \
--
1.8.1.2.433.g9808ce0.dirty
11 years, 8 months
[libvirt] [PATCH v2 0/4]Add startupPolicy attribute support for hard disks
by Guannan Ren
v1 to v2: added relax schema for disk of block and dir type
removed original patch 3/5.
The set of patches is trying to add 'startupPolicy' attribute support
to the source element of hard disks. Policy levels are using the
mandatory, requisite, optional levels as originally documented.
For the 'optional' policy, there is a little difference from CDROM and
Floppy which only drop its source path, for disks, if missing, the
checking function will drop their definitions, because qemu doesn't
allow missing source path for hard disk.
If guest is using per-device boot element for its devices, after dropping
one or more bootable device, the boot order will not be contiguous, the way
here I use is to reorder them to make them contiguous. In this way, I
introduce two new bit-operating functions
virBitmapNextLastSetBit: Search for the last set bit before
certain position.
virBitmapNextLastClearBit: Search for the last clear bit before
certain position.
Guannan Ren
[PATCH v2 1/4] conf: add startupPolicy attribute for harddisk
[PATCH v2 2/4] util: add two functions to find last set or unset bit in bitmap
[PATCH v2 3/4] qemu: drop disk definition if missing and reorder per-device boot sequence
[PATCH v2 4/4] event: add hard disk dropping event reason enum
docs/formatdomain.html.in | 9 ++++++---
docs/schemas/domaincommon.rng | 6 ++++++
include/libvirt/libvirt.h.in | 1 +
src/conf/domain_conf.c | 21 +++++++++++++++------
src/conf/domain_conf.h | 1 +
src/libvirt_private.syms | 2 ++
src/qemu/qemu_domain.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
src/util/virbitmap.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/util/virbitmap.h | 6 ++++++
tests/virbitmaptest.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
10 files changed, 278 insertions(+), 21 deletions(-)
11 years, 8 months
[libvirt] [libvirt-sandbox][PATCH] Avoid segfault in gvir_sandbox_config_add_host_include_file
by Alex Jia
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=924574
Valgrind defects memory error:
==19297== Invalid free() / delete / delete[] / realloc()
==19297== at 0x4A077A6: free (vg_replace_malloc.c:446)
==19297== by 0x350F24D79E: g_free (in /usr/lib64/libglib-2.0.so.0.3400.2)
==19297== by 0x4C2C03F: gvir_sandbox_config_add_host_include_file (libvirt-sandbox-config.c:1319)
==19297== by 0x401FB7: main (virt-sandbox.c:171)
==19297== Address 0x4f2094c is 12 bytes inside a block of size 18 alloc'd
==19297== at 0x4A0883C: malloc (vg_replace_malloc.c:270)
==19297== by 0x350F24D68E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3400.2)
==19297== by 0x350F263F0B: g_strdup (in /usr/lib64/libglib-2.0.so.0.3400.2)
==19297== by 0x4C2BF95: gvir_sandbox_config_add_host_include_file (libvirt-sandbox-config.c:1292)
==19297== by 0x401FB7: main (virt-sandbox.c:171)
Signed-off-by: Alex Jia <ajia(a)redhat.com>
---
libvirt-sandbox/libvirt-sandbox-config.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/libvirt-sandbox/libvirt-sandbox-config.c b/libvirt-sandbox/libvirt-sandbox-config.c
index 665a9fb..135eef1 100644
--- a/libvirt-sandbox/libvirt-sandbox-config.c
+++ b/libvirt-sandbox/libvirt-sandbox-config.c
@@ -1285,6 +1285,7 @@ gboolean gvir_sandbox_config_add_host_include_file(GVirSandboxConfig *config,
error))) {
const gchar *host;
gchar *guest;
+ const gchar *relguest;
GVirSandboxConfigMount *mnt = NULL;
GList *mnts = NULL;
gchar *tmp;
@@ -1302,7 +1303,7 @@ gboolean gvir_sandbox_config_add_host_include_file(GVirSandboxConfig *config,
mnt = GVIR_SANDBOX_CONFIG_MOUNT(mnts->data);
const gchar *target = gvir_sandbox_config_mount_get_target(mnt);
if (g_str_has_prefix(guest, target)) {
- guest = guest + strlen(target);
+ relguest = guest + strlen(target);
break;
}
mnt = NULL;
@@ -1315,7 +1316,7 @@ gboolean gvir_sandbox_config_add_host_include_file(GVirSandboxConfig *config,
return FALSE;
}
- gvir_sandbox_config_mount_add_include(GVIR_SANDBOX_CONFIG_MOUNT(mnt), host, guest);
+ gvir_sandbox_config_mount_add_include(GVIR_SANDBOX_CONFIG_MOUNT(mnt), host, relguest);
g_free(guest);
g_free(line);
}
--
1.7.1
11 years, 8 months
[libvirt] [PATCH] Move FUSE mount to /var/lib/libvirt/lxc/$NAME.fuse
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Instead of using /var/lib/libvirt/lxc/$NAME for the FUSE
filesystem, use /var/lib/libvirt/lxc/$NAME.fuse. This allows
room for other temporary mounts in the same directory
---
src/lxc/lxc_container.c | 2 +-
src/lxc/lxc_fuse.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 4d09791..bf17a38 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -604,7 +604,7 @@ static int lxcContainerMountProcFuse(virDomainDefPtr def,
char *meminfo_path = NULL;
if ((ret = virAsprintf(&meminfo_path,
- "%s/%s/%s/meminfo",
+ "%s/%s/%s.fuse/meminfo",
srcprefix ? srcprefix : "", LXC_STATE_DIR,
def->name)) < 0)
return ret;
diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c
index c4be58e..fbd0d56 100644
--- a/src/lxc/lxc_fuse.c
+++ b/src/lxc/lxc_fuse.c
@@ -291,7 +291,7 @@ int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def)
if (virMutexInit(&fuse->lock) < 0)
goto cleanup2;
- if (virAsprintf(&fuse->mountpoint, "%s/%s/", LXC_STATE_DIR,
+ if (virAsprintf(&fuse->mountpoint, "%s/%s.fuse/", LXC_STATE_DIR,
def->name) < 0) {
virReportOOMError();
goto cleanup1;
--
1.7.11.7
11 years, 8 months