[libvirt] error: Failed to start pool (already mounted)
by Ragnar Skúlason
Hi everyone,
I'm not sure if this belongs here, I sent a question to the users list
yesterday without getting a response, so I'm trying here.
I have storage-pool that for some reason became inactive (possibly due to
an error with pool-refresh in an old version of a Java API binding).
I want to restart the pool but am unable to, due to the volume being
mounted:
# virsh pool-start [uuid]
error: Failed to start pool [uuid]
error: Requested operation is not valid: Target '/mnt/[uuid]' is already
mounted
We have tested this with versions 0.9.12 and 0.9.13.
This did work in versions 0.8.x
Is it possible to bypass this mount check and start the storage pool
(forcefully)?
Many thanks,
Ragnar Skúlason
12 years, 2 months
[libvirt] [libvirt-perl PATCH] Fix several APIs
by Osier Yang
These APIs accept one more argument (flags), which was ignored in
the XS implementations.
---
Virt.xs | 46 ++++++++++++++++++++++++++--------------------
1 files changed, 26 insertions(+), 20 deletions(-)
diff --git a/Virt.xs b/Virt.xs
index 2b8d74c..100ca43 100644
--- a/Virt.xs
+++ b/Virt.xs
@@ -2844,19 +2844,20 @@ set_scheduler_parameters(dom, newparams, flags=0)
HV *
-get_memory_parameters(dom)
+get_memory_parameters(dom, flags=0)
virDomainPtr dom;
+ unsigned int flags;
PREINIT:
virMemoryParameter *params;
int nparams;
CODE:
nparams = 0;
- if (virDomainGetMemoryParameters(dom, NULL, &nparams, 0) < 0)
+ if (virDomainGetMemoryParameters(dom, NULL, &nparams, flags) < 0)
_croak_error();
Newx(params, nparams, virMemoryParameter);
- if (virDomainGetMemoryParameters(dom, params, &nparams, 0) < 0) {
+ if (virDomainGetMemoryParameters(dom, params, &nparams, flags) < 0) {
Safefree(params);
_croak_error();
}
@@ -2868,45 +2869,47 @@ get_memory_parameters(dom)
void
-set_memory_parameters(dom, newparams)
+set_memory_parameters(dom, newparams, flags=0)
virDomainPtr dom;
HV *newparams;
+ unsigned int flags;
PREINIT:
virTypedParameter *params;
int nparams;
PPCODE:
nparams = 0;
- if (virDomainGetMemoryParameters(dom, NULL, &nparams, 0) < 0)
+ if (virDomainGetMemoryParameters(dom, NULL, &nparams, flags) < 0)
_croak_error();
Newx(params, nparams, virMemoryParameter);
- if (virDomainGetMemoryParameters(dom, params, &nparams, 0) < 0) {
+ if (virDomainGetMemoryParameters(dom, params, &nparams, flags) < 0) {
Safefree(params);
_croak_error();
}
vir_typed_param_from_hv(newparams, params, nparams);
- if (virDomainSetMemoryParameters(dom, params, nparams, 0) < 0)
+ if (virDomainSetMemoryParameters(dom, params, nparams, flags) < 0)
_croak_error();
Safefree(params);
HV *
-get_numa_parameters(dom)
+get_numa_parameters(dom, flags)
virDomainPtr dom;
+ unsigned int flags;
PREINIT:
virTypedParameter *params;
int nparams;
CODE:
nparams = 0;
- if (virDomainGetNumaParameters(dom, NULL, &nparams, 0) < 0)
+ if (virDomainGetNumaParameters(dom, NULL, &nparams, flags) < 0)
_croak_error();
Newx(params, nparams, virTypedParameter);
- if (virDomainGetNumaParameters(dom, params, &nparams, 0) < 0) {
+ if (virDomainGetNumaParameters(dom, params, &nparams, flags) < 0) {
Safefree(params);
_croak_error();
}
@@ -2918,45 +2921,47 @@ get_numa_parameters(dom)
void
-set_numa_parameters(dom, newparams)
+set_numa_parameters(dom, newparams, flags=0)
virDomainPtr dom;
HV *newparams;
+ unsigned int flags;
PREINIT:
virTypedParameter *params;
int nparams;
PPCODE:
nparams = 0;
- if (virDomainGetNumaParameters(dom, NULL, &nparams, 0) < 0)
+ if (virDomainGetNumaParameters(dom, NULL, &nparams, flags) < 0)
_croak_error();
Newx(params, nparams, virTypedParameter);
- if (virDomainGetNumaParameters(dom, params, &nparams, 0) < 0) {
+ if (virDomainGetNumaParameters(dom, params, &nparams, flags) < 0) {
Safefree(params);
_croak_error();
}
vir_typed_param_from_hv(newparams, params, nparams);
- if (virDomainSetNumaParameters(dom, params, nparams, 0) < 0)
+ if (virDomainSetNumaParameters(dom, params, nparams, flags) < 0)
_croak_error();
Safefree(params);
HV *
-get_blkio_parameters(dom)
+get_blkio_parameters(dom, flags=0)
virDomainPtr dom;
+ unsigned int flags;
PREINIT:
virTypedParameter *params;
int nparams;
CODE:
nparams = 0;
- if (virDomainGetBlkioParameters(dom, NULL, &nparams, 0) < 0)
+ if (virDomainGetBlkioParameters(dom, NULL, &nparams, flags) < 0)
_croak_error();
Newx(params, nparams, virBlkioParameter);
- if (virDomainGetBlkioParameters(dom, params, &nparams, 0) < 0) {
+ if (virDomainGetBlkioParameters(dom, params, &nparams, flags) < 0) {
Safefree(params);
_croak_error();
}
@@ -2968,21 +2973,22 @@ get_blkio_parameters(dom)
void
-set_blkio_parameters(dom, newparams)
+set_blkio_parameters(dom, newparams, flags=0)
virDomainPtr dom;
HV *newparams;
+ unsigned int flags;
PREINIT:
virTypedParameter *params;
int nparams;
int needString;
PPCODE:
nparams = 0;
- if (virDomainGetBlkioParameters(dom, NULL, &nparams, 0) < 0)
+ if (virDomainGetBlkioParameters(dom, NULL, &nparams, flags) < 0)
_croak_error();
Newx(params, nparams, virBlkioParameter);
- if (virDomainGetBlkioParameters(dom, params, &nparams, 0) < 0) {
+ if (virDomainGetBlkioParameters(dom, params, &nparams, flags) < 0) {
Safefree(params);
_croak_error();
}
--
1.7.7.3
12 years, 2 months
[libvirt] [PATCH] qemu: Don't update graphic definitions on password change failure
by Peter Krempa
When the password change failed we updated the graphic definition
anyways, which is not desired.
---
src/qemu/qemu_hotplug.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 1251d6b..a8a904c 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1517,6 +1517,8 @@ qemuDomainChangeGraphics(struct qemud_driver *driver,
VIR_DOMAIN_GRAPHICS_TYPE_VNC,
&dev->data.vnc.auth,
driver->vncPassword);
+ if (ret < 0)
+ return ret;
/* Steal the new dev's char * reference */
VIR_FREE(olddev->data.vnc.auth.passwd);
@@ -1576,6 +1578,9 @@ qemuDomainChangeGraphics(struct qemud_driver *driver,
&dev->data.spice.auth,
driver->spicePassword);
+ if (ret < 0)
+ return ret;
+
/* Steal the new dev's char * reference */
VIR_FREE(olddev->data.spice.auth.passwd);
olddev->data.spice.auth.passwd = dev->data.spice.auth.passwd;
--
1.7.12
12 years, 2 months
[libvirt] Problen in cloning of thin LVM
by Pankaj Rawat
Hi all,
I have create a Thin lvm and installed a guest os on it,
Now when i cloned that lvm using virt-clone
# virt-clone --prompt --force --original lvm_thin1 --name lvm_thin2 --file /dev/volgrp/lvm_thin2
The cloned Disk lvm_thin2 size is fully expanded , But I want a thin Lvm cloned image
Well according to my best of knowledge , It could be because the when lvm is getting cloned, The zero are read from the original image
#lvs
LV
VG
Attr
LSize
Pool Origin
Data%
lvm_thin1
Volgrp
Vwi-aotz
8.00g
pool
12.18
lvm_thin2
volgrp
Vwi-a-tz
8.00g
pool
100.00
pool
volgrp
twi-a-tz
100.00g
8.97
As you can see above the original LVM utilize only 12.18% disk space from the pool, but the cloned lvm_thin2 is fully expanded.
Is there is any way how can I clone a THIN LVM without fully expanding it ? Or Is there any way to shrink the cloned LVM to that size without loss of data.
Regards
Pankaj Rawat
DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and
intended
for the named recipient(s) only.
It shall not attach any liability on the originator or NECHCL or its
affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the
opinions of NECHCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is
strictly prohibited. If you have
received this email in error please delete it and notify the sender
immediately. .
-----------------------------------------------------------------------------------------------------------------------
12 years, 2 months
[libvirt] make check failure
by Shradha Shah
Hello All,
I wanted to ask a question regarding the tests that are run during make check.
If a particular test fails when running make check, how do we which test failed
and why?
Is there a log that helps when debugging such errors?
--
Many Thanks,
Regards,
Shradha Shah
12 years, 2 months
[libvirt] [PATCH 0/4] Initial OpenBSD support
by Jasper Lievisse Adriaanse
Hi,
Here are some patches to get libvirt building on OpenBSD. I tested basic functionality
with virt-manager though there appear to be some rough edges to fix/polish (could also be
in virt-manager). At least basic libvirt usage should work on OpenBSD now.
Jasper Lievisse Adriaanse (4):
Define DYNLIB_NAME on OpenBSD.
Fixup some headers in virnetdevbridge.c, needed for OpenBSD.
Check for sys/ucred.h and adjust virnetsocket.c for OpenBSD
compilation.
There's no librt on OpenBSD.
configure.ac | 10 ++++++++--
src/rpc/virnetsocket.c | 10 ++++++++++
src/util/virnetdevbridge.c | 9 +++++++++
src/vbox/vbox_XPCOMCGlue.c | 2 +-
4 files changed, 28 insertions(+), 3 deletions(-)
--
1.7.6
12 years, 2 months
[libvirt] [libvirt-tck PATCH] New test to test numa parameters tuning APIs
by Osier Yang
To make sure the domain config is not broken after the API calls.
---
This depends on https://www.redhat.com/archives/libvir-list/2012-August/msg01792.html
---
scripts/domain/202-numa-set-parameters.t | 99 ++++++++++++++++++++++++++++++
1 files changed, 99 insertions(+), 0 deletions(-)
create mode 100644 scripts/domain/202-numa-set-parameters.t
diff --git a/scripts/domain/202-numa-set-parameters.t b/scripts/domain/202-numa-set-parameters.t
new file mode 100644
index 0000000..fd96866
--- /dev/null
+++ b/scripts/domain/202-numa-set-parameters.t
@@ -0,0 +1,99 @@
+# -*- perl -*-
+#
+# Copyright (C) 2009-2012 Red Hat, Inc.
+# Copyright (C) 2012 Osier Yang
+#
+# This program is free software; You can redistribute it and/or modify
+# it under the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any
+# later version
+#
+# The file "LICENSE" distributed along with this file provides full
+# details of the terms and conditions
+#
+
+=pod
+
+=head1 NAME
+
+domain/212-set-numa-parameters.t - Set NUMA parameters
+
+=head1 DESCRIPTION
+
+The test case validates the internal data structure is consistent
+after the API call to set NUMA parameters for a domain.
+
+=cut
+
+use strict;
+use warnings;
+
+use Test::More tests => 10;
+
+use Sys::Virt::TCK;
+use Test::Exception;
+
+my $tck = Sys::Virt::TCK->new();
+my $conn = eval { $tck->setup(); };
+BAIL_OUT "failed to setup test harness: $@" if $@;
+END {
+ $tck->cleanup if $tck;
+ unlink "tck.img" if -f "tck.img";
+}
+
+
+my $xml = $tck->generic_domain("tck")->as_xml;
+
+diag "Creating a new persistent domain";
+my $dom;
+ok_domain(sub { $dom = $conn->define_domain($xml) }, "created persistent domain object");
+
+diag "Starting inactive domain";
+$dom->create;
+ok($dom->get_id > 0, "running domain with ID > 0");
+
+# NUMA mode can't be changed for a live domain
+my %params = (
+ Sys::Virt::Domain::NUMA_NODESET => '0',
+);
+
+diag "Set numa parameters, affects live config";
+lives_ok(sub {$dom->set_numa_parameters(\%params, Sys::Virt::Domain::AFFECT_LIVE)}, "set_numa_parameters");
+
+diag "Destroy the domain";
+$dom->destroy;
+
+diag "Make sure the domain can be started after setting numa parameters";
+$dom->create;
+ok($dom->get_id > 0, "running domain with ID > 0");
+
+diag "Get numa parameters";
+my $params = $dom->get_numa_parameters(Sys::Virt::Domain::AFFECT_LIVE);
+ok($params->{Sys::Virt::Domain::NUMA_NODESET} eq '0', 'Check nodeset');
+
+diag "Destroy the domain";
+$dom->destroy;
+
+$params{Sys::Virt::Domain::NUMA_MODE} = Sys::Virt::Domain::NUMATUNE_MEM_STRICT;
+
+diag "Set numa parameters, affects next boot";
+lives_ok(sub {$dom->set_numa_parameters(\%params, Sys::Virt::Domain::AFFECT_CONFIG)}, "set_numa_parameters");
+
+diag "Get numa parameters";
+my $params = $dom->get_numa_parameters(Sys::Virt::Domain::AFFECT_LIVE);
+ok($params->{Sys::Virt::Domain::NUMA_MODE} == Sys::Virt::Domain::NUMATUNE_MEM_STRICT, 'Check mode');
+ok($params->{Sys::Virt::Domain::NUMA_NODESET} eq '0', 'Check nodeset');
+
+diag "Make sure the domain can be started after setting numa parameters";
+$dom->create;
+ok($dom->get_id > 0, "running domain with ID > 0");
+
+diag "Destroying the persistent domain";
+$dom->destroy;
+$dom->undefine;
+
+diag "Checking that transient domain has gone away";
+ok_error(sub { $conn->get_domain_by_name("tck") }, "NO_DOMAIN error raised from missing domain",
+ Sys::Virt::Error::ERR_NO_DOMAIN);
+
+# end
--
1.7.7.3
12 years, 2 months
[libvirt] [PATCH 0/4] Support to set disk wwn
by Osier Yang
This introduces new element <wwn> for disk, to allow to set wwn
(just like setting serial number) for the virtual disk (Only QEMU
devices like ide-drive, ide-hd, ide-cd, scsi-disk, scsi-hd, and
scsi-cd support it).
Osier Yang (4):
schema: Add schema for disk <wwn>
conf: Parse and format disk <wwn>
qemu: Add caps to indentify if setting wwn is supported by qemu
qemu: Use disk wwn in qemu command line
docs/formatdomain.html.in | 5 +++
docs/schemas/basictypes.rng | 6 +++
docs/schemas/domaincommon.rng | 5 +++
docs/schemas/nodedev.rng | 6 ---
src/conf/domain_conf.c | 8 ++++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 4 ++
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_command.c | 35 ++++++++++++++++++++
.../qemuxml2argv-disk-ide-wwn.args | 6 +++
.../qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.xml | 28 ++++++++++++++++
.../qemuxml2argv-disk-scsi-disk-wwn.args | 10 ++++++
.../qemuxml2argv-disk-scsi-disk-wwn.xml | 35 ++++++++++++++++++++
tests/qemuxml2argvtest.c | 7 ++++
14 files changed, 152 insertions(+), 6 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-wwn.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-wwn.xml
--
1.7.7.3
12 years, 2 months
[libvirt] [RFC PATCH v1 0/4] Add cpu hotplug support to libvirt.
by Tang Chen
It seems that libvirt is not cpu hotplug aware.
Please refer to the following problem.
1. At first, we have 2 cpus.
# cat /cgroup/cpuset/cpuset.cpus
0-1
# cat /cgroup/cpuset/libvirt/qemu/cpuset.cpus
0-1
2. And we have a vm1 with following configuration.
<cputune>
<vcpupin vcpu='0' cpuset='1'/>
<hypervisorpin cpuset='1'/>
</cputune>
3. Offline cpu1.
# echo 0 > /sys/devices/system/cpu/cpu1/online
# cat /sys/devices/system/cpu/cpu1/online
0
# cat /cgroup/cpuset/cpuset.cpus
0
# cat /cgroup/cpuset/libvirt/qemu/cpuset.cpus
0
# cat /cgroup/cpuset/libvirt/lxc/cpuset.cpus
0
4. Online cpu1.
# echo 1 > /sys/devices/system/cpu/cpu1/online
# cat /sys/devices/system/cpu/cpu1/online
1
# cat /cgroup/cpuset/cpuset.cpus
0-1
# cat /cgroup/cpuset/libvirt/cpuset.cpus
0
# cat /cgroup/cpuset/libvirt/qemu/cpuset.cpus
0
# cat /cgroup/cpuset/libvirt/lxc/cpuset.cpus
0
Here,cgroup updated cpuset.cpus,but not for libvirt directory,and also qemu and lxc directory.
vm1 cannot be started again.
# virsh start vm1
error: Failed to start domain vm1
error: Unable to set cpuset.cpus: Permission denied
And libvird gave the following errors.
2012-07-17 07:30:22.478+0000: 3118: error : qemuSetupCgroupVcpuPin:498 : Unable to set cpuset.cpus: Permission denied
These patches resolves this problem by listening on the netlink for cpu hotplug event.
When the netlink service gets the cpu hotplug event, it will attract the cpuid in the message,
and add it into cpuset.cpus in:
/cgroup/cpuset/libvirt
/cgroup/cpuset/libvirt/qemu
/cgroup/cpuset/libvirt/lxc
Tang Chen (4):
Add cpu hotplug handler for netlink service.
Register cpu hotplug netlink handler for libvirtd.
Register cpu hotplug netlink handler for qemu driver.
Register cpu hotplug netlink handler for lxc driver.
daemon/libvirtd.c | 11 +++
include/libvirt/virterror.h | 2 +
src/Makefile.am | 1 +
src/libvirt_private.syms | 5 +
src/lxc/lxc_driver.c | 8 ++
src/qemu/qemu_driver.c | 8 ++
src/util/cgroup.c | 6 +-
src/util/cgroup.h | 4 +
src/util/hotplug.c | 221 +++++++++++++++++++++++++++++++++++++++++++
src/util/hotplug.h | 32 +++++++
src/util/virterror.c | 3 +-
11 files changed, 297 insertions(+), 4 deletions(-)
create mode 100644 src/util/hotplug.c
create mode 100644 src/util/hotplug.h
--
1.7.10.1
12 years, 2 months
[libvirt] [PATCH] pci: Read bridge control register from the bridge
by Osier Yang
Though I don't quite understand it well enough, but it looks
wrong to read the control register from the device, and then
write to its parent twice, while doing the secondary bus reset.
---
src/util/pci.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/util/pci.c b/src/util/pci.c
index 0742d07..c3f1b2b 100644
--- a/src/util/pci.c
+++ b/src/util/pci.c
@@ -642,7 +642,7 @@ pciTrySecondaryBusReset(pciDevice *dev,
/* Read the control register, set the reset flag, wait 200ms,
* unset the reset flag and wait 200ms.
*/
- ctl = pciRead16(dev, PCI_BRIDGE_CONTROL);
+ ctl = pciRead16(parent, PCI_BRIDGE_CONTROL);
pciWrite16(parent, PCI_BRIDGE_CONTROL, ctl | PCI_BRIDGE_CTL_RESET);
--
1.7.7.3
12 years, 2 months