[libvirt] [PATCH 0/3] revert publicly visible parts of IP address "peer" patches
by Laine Stump
Due to the feature not working, and a couple questions about the
design that haven't been resolved and may require publicly visible
changes, these patches temporarily revert the three patches that add
support for the ip element "peer" attribute to qemu and lxc. (Note
that I left in the patch that changes virNetDevSetIPAddress(), because
it is correct (except a problem on FreeBSD that only occurs at
runtime, and only if a peer address is given, which won't happen as
long as this feature is removed).
I posted patches yesterday that fixed most of the problems, but they
are too numerous to consider pushing before release, and anyway don't
fix everything.
Laine Stump (3):
Revert "qemu domain allow to set ip address, peer address and route"
Revert "lxc domain allow to set peer address"
Revert "libvirt domain xml allow to set peer address"
docs/formatdomain.html.in | 12 +-----------
docs/schemas/domaincommon.rng | 5 -----
src/conf/domain_conf.c | 14 +-------------
src/conf/domain_conf.h | 1 -
src/lxc/lxc_container.c | 2 +-
src/qemu/qemu_interface.c | 41 +----------------------------------------
6 files changed, 4 insertions(+), 71 deletions(-)
--
2.5.5
8 years, 8 months
[libvirt] [PATCH 0/2] virsh: Properly handle detach-interface --live --config.
by Nitesh Konkar
The virsh attach/detach interface command fails
when both live and config are set and when the interface
gets attached to different pci slots on live and config
xml respectively.
When we attach an interface with both --live and --config,
the first time they get the same PCI slots, but the second time
onwards it differs and hence the virsh detach-interface --live
--config command fails. This patch makes sure that when both
--live --config are set , qemuDomainDetachDeviceFlags is called
twice, once with config xml and once with live xml.
Steps to see the issue:
virsh attach-interface --domain DomainName --type network --source default --mac 52:54:00:4b:76:5f --live --config
virsh detach-interface --domain DomainName --type network --mac 52:54:00:4b:76:5f --live --config
virsh attach-interface --domain DomainName --type network --source default --mac 52:54:00:4b:76:5f --live --config
virsh detach-interface --domain DomainName --type network --mac 52:54:00:4b:76:5f --live --config
Nitesh Konkar (2):
virsh: Introduce virshDomainDetachInterface function.
virsh: Pass the corect live/config xml to virshDomainDetachInterface.
tools/virsh-domain.c | 107 +++++++++++++++++++++++++++++++--------------------
1 file changed, 65 insertions(+), 42 deletions(-)
--
1.8.3.1
8 years, 8 months
[libvirt] [PATCH v3] tools: Fix connect command
by Martin Kletzander
The man page says: "(Re)-Connect to the hypervisor. When the shell is
first started, this is automatically run with the URI parameter
requested by the "-c" option on the command line." However, if you run:
virsh -c 'test://default' 'connect; uri'
the output will not be 'test://default'. That's because the 'connect'
command does not care about any virsh-only related settings and if it is
run without parameters, it connects with @uri == NULL. Not only that
doesn't comply to what the man page describes, but it also doesn't make
sense. It also means you aren't able to reconnect to whatever you are
connected currently.
So let's fix that in both virsh and virt-admin add a test case for it.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
v3:
- Don't say "error: Reconnected..." when connected by a user request
(by using the 'connect' command)
v2:
- rebased on top of Cole's changes
- https://www.redhat.com/archives/libvir-list/2016-April/msg01551.html
v1:
- https://www.redhat.com/archives/libvir-list/2016-April/msg01462.html
tests/test-lib.sh | 6 ++++++
tests/virsh-uriprecedence | 54 +++++++++++++++++++++++++++++++++++------------
tools/virsh.c | 50 +++++++++++--------------------------------
tools/virt-admin.c | 6 ++++--
4 files changed, 63 insertions(+), 53 deletions(-)
diff --git a/tests/test-lib.sh b/tests/test-lib.sh
index 8e0ce83e118c..49e8d2209572 100644
--- a/tests/test-lib.sh
+++ b/tests/test-lib.sh
@@ -232,6 +232,12 @@ if test -n "$VIR_TEST_DEBUG" || test -n "$VIR_TEST_VERBOSE" ; then
verbose=1
fi
+debug() { :; }
+
+if test "$VIR_TEST_DEBUG" = "2"; then
+ debug() { echo "$@"; }
+fi
+
# This is a stub function that is run upon trap (upon regular exit and
# interrupt). Override it with a per-test function, e.g., to unmount
# a partition, or to undo any other global state changes.
diff --git a/tests/virsh-uriprecedence b/tests/virsh-uriprecedence
index 1cf3d22ec74c..564e3dc42c72 100755
--- a/tests/virsh-uriprecedence
+++ b/tests/virsh-uriprecedence
@@ -7,7 +7,8 @@
test_intro "virsh-uriprecedence"
virsh_bin="$abs_top_builddir/tools/virsh"
-counter=1
+virsh_cmd="$virsh_bin"
+counter=0
ret=0
cleanup_() { rm -rf "$tmphome"; }
@@ -22,16 +23,44 @@ mkdir -p "$XDG_CONFIG_HOME/libvirt" "$XDG_CONFIG_HOME/virsh"
mkdir -p "$XDG_CACHE_HOME/libvirt" "$XDG_CACHE_HOME/virsh"
mkdir -p "$XDG_RUNTIME_HOME/libvirt" "$XDG_RUNTIME_HOME/virsh"
-# Main function checking for the proper uri being returned
+is_uri_good()
+{
+ echo "$1" | grep -q -F "$good_uri"
+}
+
+test_uri_internal()
+{
+ test_name=$1
+ test_cmd="$virsh_cmd \"$2\""
+ result=0
+
+ debug "Running '$test_cmd'"
+ out="$($virsh_cmd "$2")"
+
+ if ! is_uri_good "$out"; then
+ debug "Invalid output: '$out'"
+ result=1
+ ret=1
+ fi
+
+ counter="$((counter+1))"
+ test_result "$counter" "$1" "$result"
+}
+
+test_uri_connect()
+{
+ test_uri_internal "$1" "connect; uri"
+}
+
+test_uri_noconnect()
+{
+ test_uri_internal "$1" "uri"
+}
+
test_uri()
{
- result=0
- if [ "$($virsh_bin uri)" != "$good_uri" ]; then
- result=1
- ret=1
- fi
- test_result "$counter" "$1" "$result"
- counter="$((counter+1))"
+ test_uri_connect "$1"
+ test_uri_noconnect "$1"
}
# Precedence is the following (lowest priority first):
@@ -56,6 +85,7 @@ good_uri="test:///default?good_uri"
printf "uri_default=\"%s\"\n" "$good_uri" >"$XDG_CONFIG_HOME/libvirt/libvirt.conf"
if uid_is_privileged_; then
+ counter="$((counter+1))"
test_skip_case "$counter" "User config file" "must not be run as root"
else
test_uri "User config file"
@@ -70,10 +100,8 @@ export VIRSH_DEFAULT_CONNECT_URI="$good_uri"
test_uri "VIRSH_DEFAULT_CONNECT_URI"
export VIRSH_DEFAULT_CONNECT_URI="$bad_uri"
-virsh_bin="$virsh_bin --connect $good_uri"
+virsh_cmd="$virsh_bin --connect $good_uri"
test_uri "Parameter"
-# test_uri() increases $counter even for the last test, so we must
-# decrement it
-test_final "$((counter-1))" "$ret"
+test_final "$counter" "$ret"
(exit "$ret"); exit "$ret"
diff --git a/tools/virsh.c b/tools/virsh.c
index af072510870d..2a807d99af71 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -211,10 +211,11 @@ virshConnect(vshControl *ctl, const char *uri, bool readonly)
*
*/
static void
-virshReconnect(vshControl *ctl)
+virshReconnect(vshControl *ctl, const char *name, bool readonly, bool force)
{
bool connected = false;
virshControlPtr priv = ctl->privData;
+ bool ro = name ? readonly : priv->readonly;
if (priv->conn) {
int ret;
@@ -229,7 +230,7 @@ virshReconnect(vshControl *ctl)
"disconnect from the hypervisor"));
}
- priv->conn = virshConnect(ctl, ctl->connname, priv->readonly);
+ priv->conn = virshConnect(ctl, name ? name : ctl->connname, ro);
if (!priv->conn) {
if (disconnected)
@@ -237,10 +238,15 @@ virshReconnect(vshControl *ctl)
else
vshError(ctl, "%s", _("failed to connect to the hypervisor"));
} else {
+ if (name) {
+ VIR_FREE(ctl->connname);
+ ctl->connname = vshStrdup(ctl, name);
+ priv->readonly = readonly;
+ }
if (virConnectRegisterCloseCallback(priv->conn, virshCatchDisconnect,
ctl, NULL) < 0)
vshError(ctl, "%s", _("Unable to register disconnect callback"));
- if (connected)
+ if (connected && !force)
vshError(ctl, "%s", _("Reconnected to the hypervisor"));
}
disconnected = 0;
@@ -291,43 +297,11 @@ cmdConnect(vshControl *ctl, const vshCmd *cmd)
{
bool ro = vshCommandOptBool(cmd, "readonly");
const char *name = NULL;
- virshControlPtr priv = ctl->privData;
- virConnectPtr conn;
if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0)
return false;
- conn = virshConnect(ctl, name, ro);
-
- if (!conn) {
- vshError(ctl, "%s", _("Failed to connect to the hypervisor"));
- return false;
- }
-
- if (priv->conn) {
- int ret;
-
- virConnectUnregisterCloseCallback(priv->conn, virshCatchDisconnect);
- ret = virConnectClose(priv->conn);
- if (ret < 0)
- vshError(ctl, "%s", _("Failed to disconnect from the hypervisor"));
- else if (ret > 0)
- vshError(ctl, "%s", _("One or more references were leaked after "
- "disconnect from the hypervisor"));
- }
- priv->conn = conn;
-
- VIR_FREE(ctl->connname);
- ctl->connname = vshStrdup(ctl, name);
-
- priv->useGetInfo = false;
- priv->useSnapshotOld = false;
- priv->blockJobNoBytes = false;
- priv->readonly = ro;
-
- if (virConnectRegisterCloseCallback(priv->conn, virshCatchDisconnect,
- ctl, NULL) < 0)
- vshError(ctl, "%s", _("Unable to register disconnect callback"));
+ virshReconnect(ctl, name, ro, true);
return true;
}
@@ -360,7 +334,7 @@ virshConnectionHandler(vshControl *ctl)
virshControlPtr priv = ctl->privData;
if (!priv->conn || disconnected)
- virshReconnect(ctl);
+ virshReconnect(ctl, NULL, false, false);
if (virshConnectionUsability(ctl, priv->conn))
return priv->conn;
@@ -431,7 +405,7 @@ virshInit(vshControl *ctl)
return false;
if (ctl->connname) {
- virshReconnect(ctl);
+ virshReconnect(ctl, NULL, false, false);
/* Connecting to a named connection must succeed, but we delay
* connecting to the default connection until we need it
* (since the first command might be 'connect' which allows a
diff --git a/tools/virt-admin.c b/tools/virt-admin.c
index 22160ad929d0..4275aa37a1bf 100644
--- a/tools/virt-admin.c
+++ b/tools/virt-admin.c
@@ -291,8 +291,10 @@ cmdConnect(vshControl *ctl, const vshCmd *cmd)
if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0)
return false;
- VIR_FREE(ctl->connname);
- ctl->connname = vshStrdup(ctl, name);
+ if (name) {
+ VIR_FREE(ctl->connname);
+ ctl->connname = vshStrdup(ctl, name);
+ }
vshAdmReconnect(ctl);
if (!connected)
--
2.8.1
8 years, 8 months
[libvirt] [PATCH 0/2] qemu: fixes for empty ejectable media drives
by Peter Krempa
Peter Krempa (2):
qemu: process: Refresh ejectable media tray state on VM start
qemu: hotplug: Skip waiting for tray opening if qemu doesn't notify us
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_hotplug.c | 19 +++++++++++++++++--
src/qemu/qemu_process.c | 4 ++++
tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.4.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.5.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.6.0-1.caps | 1 +
14 files changed, 34 insertions(+), 2 deletions(-)
--
2.8.1
8 years, 8 months
[libvirt] [PATCH] send default USB controller in xml to destination during migration on PPC64
by Shivaprasad G Bhat
The default USB controller is not sent to destination as the older versions
of libvirt(0.9.4 or earlier as I see in commit log of 409b5f54) didn't
support them. For some archs where the support started much later can
safely send the USB controllers without this worry. For now, changing the
checks to allow PPC64 here. If we can track the historical support for
other archs, the changes can be extrapolated to them too.
The patch fixes a bug that, if the USB controller happens to occupy
a slot after disks/interfaces and one of them is hot-unplugged, then
the default USB controller added on destination takes the smallest slot
number and that would lead to savestate mismatch and migration
failure.
Signed-off-by: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
---
src/qemu/qemu_domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 9044792..6ecc0e2 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2226,7 +2226,7 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
usb = def->controllers[i];
}
}
- if (usb && usb->idx == 0 && usb->model == -1) {
+ if (!ARCH_IS_PPC64(def->os.arch) && usb && usb->idx == 0 && usb->model == -1) {
VIR_DEBUG("Removing default USB controller from domain '%s'"
" for migration compatibility", def->name);
toremove++;
8 years, 8 months
[libvirt] [PATCH 0/2] configure: Improve init script choice
by Andrea Bolognani
If not init script type is explicitly chosen by the user, we
try to pick a good default based on the compilation OS.
Unfortunately, in that situation our code only really does
the right thing for old RHEL releases. Our reporting is
sub-par, too.
This series makes it so more distributions get the right
init script installed by default and improves reporting.
Andrea Bolognani (2):
configure: Improve --with-init-script=check
configure: Add systemd detection to --with-init-script=check
configure.ac | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
--
2.5.5
8 years, 8 months
[libvirt] [PATCH 0/6] qemu: Yet another set of fixes for the 'perf' event feature
by Peter Krempa
More broken stuff ... sigh.
Peter Krempa (6):
qemu: perf: Don't ignore perf setup if allocation fails
util: perf: Use 'error' label in virPerfCmtEnable
util: perf: Adhere to coding style of error checks in
virPerfEventEnable
util: perf: Adhere to coding style of error checks in
qemuDomainSetPerfEvents
qemu: process: Fix failure semantics for perf events
qemu: process: Don't needlesly clear the perf events in
qemuDomainPerfRestart
src/qemu/qemu_driver.c | 4 ++--
src/qemu/qemu_process.c | 29 ++++++++++++-----------------
src/util/virperf.c | 16 ++++++++--------
3 files changed, 22 insertions(+), 27 deletions(-)
--
2.8.1
8 years, 8 months
[libvirt] [PATCH 0/3] qemu: Fix checks when changing disk media
by Peter Krempa
Few fields were missing and few fields can be actually changed.
The last two patches actually fix
https://bugzilla.redhat.com/show_bug.cgi?id=1326660 since we reported incorrect
error message.
Peter Krempa (3):
qemu: domain: Fix error message in qemuDomainDiskChangeSupported
qemu: domain: Check few more fields for when changing disk source
qemu: hotplug: Allow update of disk default snapshot location
src/qemu/qemu_domain.c | 10 ++++++++--
src/qemu/qemu_driver.c | 4 ++++
2 files changed, 12 insertions(+), 2 deletions(-)
--
2.8.1
8 years, 8 months
[libvirt] Entering freeze for libvirt-1.3.4
by Daniel Veillard
We are in freeze ! I tagged the release candidate 1 in git and
pushed signed tarball and rpms to the usual place:
ftp://libvirt.org/libvirt/
that looks fine with my very limited testing, but that's likely
not indicative of the actual stability :)
https://ci.centos.org/view/libvirt-project/ is rather positive
though someone should look at a potential FreeBSD portability issue
based on the report (or that could be that the Jenkins test need
a bit of attention)
Plan is to have RC2 on Friday and try to push 1.3.4 final from
airport in Sunday (so there is a little bit of risk there).
Please give it a try !
Thanks,
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
8 years, 8 months
[libvirt] [PATCH] vz: fix disk enumeration
by Mikhail Feoktistov
If we want to delete all disks for container or vm
we should make a loop from 0 to NumberOfDisks and always
use zero index in PrlVmCfg_GetHardDisk to get disk handle.
When we delete first disk after that numbers of other disks
will be changed, start from 0 to NumberOfDisks-1.
That's why we should always use zero index.
---
src/vz/vz_sdk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 8cc8430..70d61e5 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -3810,7 +3810,7 @@ prlsdkDetachDomainHardDisks(PRL_HANDLE sdkdom)
prlsdkCheckRetGoto(pret, cleanup);
for (i = 0; i < hddCount; ++i) {
- pret = PrlVmCfg_GetHardDisk(sdkdom, i, &sdkdisk);
+ pret = PrlVmCfg_GetHardDisk(sdkdom, 0, &sdkdisk);
prlsdkCheckRetGoto(pret, cleanup);
pret = PrlVmDev_Remove(sdkdisk);
--
1.8.3.1
8 years, 8 months