[libvirt] [PATCH v6 0/5] migration: add multithread compression
by Nikolay Shirokovskiy
Add means to turn multithread compression on during migration.
Add means to pass compression parameters in migration command.
WARNING!
This should be pushed only after
https://www.redhat.com/archives/libvir-list/2016-March/msg01506.html
or virsh domain will break.
Changes from v5
===============
Originally i just wanted to send a rebase as i discovered that automatic
rebase goes wrong for the patch 1 but later found a couple of bugs
in the patch itself. Here they are:
1. fix qemuDomainMigratePrepare2 and qemuDomainMigratePerform3
passing NULL for compression.
Changes from v4
===============
1. Clean up documentation and comments.
2. Stop keeping compression options in flags internally. Move
flags data into generic compression structure.
3. Use existing libvirt enum infrastructure to deal with
compression methods. This makes parse and dump function less
painful.
4. Use booleans for 'set' flags instead of bitsets.
5. Othes minor changes on Jiri comments.
Eli Qiao (1):
qemumonitorjsontest: add test for getting multithread compress params
Nikolay Shirokovskiy (2):
migration: qemu: add option to select compression methods
qemu: migration: support setting compession parameters
ShaoHe Feng (2):
qemu: monitor: add migration parameters accessors
virsh: add compression options for migration
include/libvirt/libvirt-domain.h | 42 +++++++
src/qemu/qemu_driver.c | 60 +++++++--
src/qemu/qemu_migration.c | 262 +++++++++++++++++++++++++++++++++++----
src/qemu/qemu_migration.h | 36 ++++++
src/qemu/qemu_monitor.c | 24 +++-
src/qemu/qemu_monitor.h | 18 +++
src/qemu/qemu_monitor_json.c | 110 ++++++++++++++++
src/qemu/qemu_monitor_json.h | 5 +
tests/qemumonitorjsontest.c | 61 +++++++++
tools/virsh-domain.c | 76 ++++++++++++
tools/virsh.pod | 18 ++-
11 files changed, 671 insertions(+), 41 deletions(-)
--
1.8.3.1
8 years, 7 months
[libvirt] [PATCH] virsh: support up to 64 migration options for command
by Nikolay Shirokovskiy
Upcoming compression options for migration command patch
series hits current limit of 32 possible options for a command.
Lets take one step further and support 64 possible options.
And all it takes is moving from 32 bit integers to 64 bit ones.
The only less then trivial change i found is moving from
'ffs' to 'ffsl'.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
tools/vsh.c | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/tools/vsh.c b/tools/vsh.c
index 6bdc082..5659110 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -40,7 +40,6 @@
#include <limits.h>
#include <sys/stat.h>
#include <inttypes.h>
-#include <strings.h>
#include <signal.h>
#if WITH_READLINE
@@ -329,8 +328,8 @@ vshCmddefGetInfo(const vshCmdDef * cmd, const char *name)
/* Validate that the options associated with cmd can be parsed. */
static int
-vshCmddefOptParse(const vshCmdDef *cmd, uint32_t *opts_need_arg,
- uint32_t *opts_required)
+vshCmddefOptParse(const vshCmdDef *cmd, uint64_t *opts_need_arg,
+ uint64_t *opts_required)
{
size_t i;
bool optional = false;
@@ -344,7 +343,7 @@ vshCmddefOptParse(const vshCmdDef *cmd, uint32_t *opts_need_arg,
for (i = 0; cmd->opts[i].name; i++) {
const vshCmdOptDef *opt = &cmd->opts[i];
- if (i > 31)
+ if (i > 63)
return -1; /* too many options */
if (opt->type == VSH_OT_BOOL) {
optional = true;
@@ -407,7 +406,7 @@ static vshCmdOptDef helpopt = {
};
static const vshCmdOptDef *
vshCmddefGetOption(vshControl *ctl, const vshCmdDef *cmd, const char *name,
- uint32_t *opts_seen, int *opt_index, char **optstr)
+ uint64_t *opts_seen, int *opt_index, char **optstr)
{
size_t i;
const vshCmdOptDef *ret = NULL;
@@ -464,8 +463,8 @@ vshCmddefGetOption(vshControl *ctl, const vshCmdDef *cmd, const char *name,
}
static const vshCmdOptDef *
-vshCmddefGetData(const vshCmdDef *cmd, uint32_t *opts_need_arg,
- uint32_t *opts_seen)
+vshCmddefGetData(const vshCmdDef *cmd, uint64_t *opts_need_arg,
+ uint64_t *opts_seen)
{
size_t i;
const vshCmdOptDef *opt;
@@ -474,7 +473,7 @@ vshCmddefGetData(const vshCmdDef *cmd, uint32_t *opts_need_arg,
return NULL;
/* Grab least-significant set bit */
- i = ffs(*opts_need_arg) - 1;
+ i = ffsl(*opts_need_arg) - 1;
opt = &cmd->opts[i];
if (opt->type != VSH_OT_ARGV)
*opts_need_arg &= ~(1 << i);
@@ -486,8 +485,8 @@ vshCmddefGetData(const vshCmdDef *cmd, uint32_t *opts_need_arg,
* Checks for required options
*/
static int
-vshCommandCheckOpts(vshControl *ctl, const vshCmd *cmd, uint32_t opts_required,
- uint32_t opts_seen)
+vshCommandCheckOpts(vshControl *ctl, const vshCmd *cmd, uint64_t opts_required,
+ uint64_t opts_seen)
{
const vshCmdDef *def = cmd->def;
size_t i;
@@ -598,8 +597,8 @@ vshCmddefHelp(vshControl *ctl, const char *cmdname)
const char *desc = vshCmddefGetInfo(def, "desc");
const char *help = _(vshCmddefGetInfo(def, "help"));
char buf[256];
- uint32_t opts_need_arg;
- uint32_t opts_required;
+ uint64_t opts_need_arg;
+ uint64_t opts_required;
bool shortopt = false; /* true if 'arg' works instead of '--opt arg' */
if (vshCmddefOptParse(def, &opts_need_arg, &opts_required)) {
@@ -1350,9 +1349,9 @@ vshCommandParse(vshControl *ctl, vshCommandParser *parser)
const vshCmdDef *cmd = NULL;
vshCommandToken tk;
bool data_only = false;
- uint32_t opts_need_arg = 0;
- uint32_t opts_required = 0;
- uint32_t opts_seen = 0;
+ uint64_t opts_need_arg = 0;
+ uint64_t opts_required = 0;
+ uint64_t opts_seen = 0;
first = NULL;
--
1.8.3.1
8 years, 7 months
[libvirt] [PATCH] virsh: use the same connection URI for reconnect
by Roman Bogorodskiy
When for some reason virsh looses connection and then tries to
reconnection, it uses the default URI instead of the one that was used
for the previous connection it got disconnected from.
In order to make it reconnect using the same URI, copy URI of the
current (disconnected) connection to vshControl 'connname' attribute.
---
tools/virsh.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/virsh.c b/tools/virsh.c
index 5a61189..07097aa 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -359,6 +359,14 @@ virshConnectionHandler(vshControl *ctl)
{
virshControlPtr priv = ctl->privData;
+ if (disconnected && priv->conn) {
+ if (!ctl->connname) {
+ char *uri = virConnectGetURI(priv->conn);
+ ctl->connname = vshStrdup(ctl, uri);
+ VIR_FREE(uri);
+ }
+ }
+
if (!priv->conn || disconnected)
virshReconnect(ctl);
--
2.7.4
8 years, 7 months
[libvirt] [PATCH REBASE 0/4] vz: use disk bus and target name as disk id
by Nikolay Shirokovskiy
This series is a preparation to implement device update functionality.
In case of disk updates disk bus and disk target name pair is considered
disk id. We already have places in vz driver code where we use disk source
as id. These places are either not critical (see boot patch) or
correct (see detach patch) so we need not to fix them immediately to use more
rubust id. But as this id will be introduced anyway for disk updates
let's move to new id in existing code. This way we have single
id for disks.
Nikolay Shirokovskiy (4):
vz: introduce vzsdk disk id function
vz: fix detach disk to use new disk id
vz: fix boot check to use new disk id
vz: cleanup: remove trivial function
src/vz/vz_sdk.c | 251 ++++++++++++++++++++++++++++----------------------------
1 file changed, 126 insertions(+), 125 deletions(-)
--
1.8.3.1
8 years, 7 months
[libvirt] [PATCH] storage: mpath: Don't error on target_type=NULL
by Cole Robinson
We use device-mapper to enumerate all dm devices, and filter out
the list of multipath devices by checking the target_type string
name. The code however cancels all scanning if we encounter
target_type=NULL
I don't know how to reproduce that situation, but a user was hitting
it in their setup, and inspecting the lvm2/device-mapper code shows
many places where !target_type is explicitly ignored and processing
continues on to the next device. So I think we should do the same
https://bugzilla.redhat.com/show_bug.cgi?id=1069317
---
src/storage/storage_backend_mpath.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c
index b5b4bb6..bf1b1ab 100644
--- a/src/storage/storage_backend_mpath.c
+++ b/src/storage/storage_backend_mpath.c
@@ -114,12 +114,7 @@ virStorageBackendIsMultipath(const char *dev_name)
dm_get_next_target(dmt, next, &start, &length, &target_type, ¶ms);
- if (target_type == NULL) {
- ret = -1;
- goto out;
- }
-
- if (STREQ(target_type, "multipath"))
+ if (STREQ_NULLABLE(target_type, "multipath"))
ret = 1;
out:
--
2.7.3
8 years, 7 months
[libvirt] [PATCH] fix build by correcting functions order and src/Makefile.am
by Maxim Nestratov
commit 30c61901 added new functions to libvirt_private.syms
not alpabetically sorted and erroneously added vz sources to
STATEFUL_DRIVER_SOURCE_FILES, which triggered check-aclrules
running while vz driver isn't ready for it yet.
Pushing under build-breaker rule.
---
src/Makefile.am | 1 -
src/libvirt_private.syms | 12 ++++++------
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 08ff301..f5e57c0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -630,7 +630,6 @@ DRIVER_SOURCE_FILES = \
$(NULL)
STATEFUL_DRIVER_SOURCE_FILES = \
- $(VZ_DRIVER_SOURCES) \
$(BHYVE_DRIVER_SOURCES) \
$(INTERFACE_DRIVER_SOURCES) \
$(LIBXL_DRIVER_SOURCES) \
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 1bcb3af..a9025f5 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -916,6 +916,11 @@ virCPUx86MakeData;
# datatypes.h
virConnectClass;
+virConnectCloseCallbackDataCall;
+virConnectCloseCallbackDataClass;
+virConnectCloseCallbackDataGetCallback;
+virConnectCloseCallbackDataRegister;
+virConnectCloseCallbackDataUnregister;
virDomainClass;
virDomainSnapshotClass;
virGetConnect;
@@ -929,20 +934,15 @@ virGetSecret;
virGetStoragePool;
virGetStorageVol;
virGetStream;
-virConnectCloseCallbackDataGetCallback;
-virNewConnectCloseCallbackData;
-virConnectCloseCallbackDataUnregister;
-virConnectCloseCallbackDataRegister;
-virConnectCloseCallbackDataCall;
virInterfaceClass;
virNetworkClass;
+virNewConnectCloseCallbackData;
virNodeDeviceClass;
virNWFilterClass;
virSecretClass;
virStoragePoolClass;
virStorageVolClass;
virStreamClass;
-virConnectCloseCallbackDataClass;
# fdstream.h
--
2.4.3
8 years, 7 months
Re: [libvirt] [libvirt-users] Libvirtd running as root tries to access oneadmin (OpenNebula) NFS mount but throws: error: can’t canonicalize path
by TomK
Adding in libvir-list.
Cheers,
Tom K.
-------------------------------------------------------------------------------------
Mobile: 416 618 8456
Home: 905 857 9652
Living on earth is expensive, but it includes a free trip around the sun.
On 4/7/2016 7:32 PM, TomK wrote:
> Hey All,
>
> I've an issue where libvirtd tries to access an NFS mount but errors
> out with: can't canonicalize path '/var/lib/one//datastores/0 . The
> unprevilidged user is able to read/write fine to the share.
> root_squash is used and for security reasons no_root_squash cannot be
> used.
>
> On the controller and node SELinux is disabled.
>
> [oneadmin@mdskvm-p01 ~]$ virsh -d 1 --connect qemu:///system create
> /var/lib/one//datastores/0/38/deployment.0
> create: file(optdata): /var/lib/one//datastores/0/38/deployment.0
> error: Failed to create domain from
> /var/lib/one//datastores/0/38/deployment.0
> error: can't canonicalize path '/var/lib/one//datastores/0/38/disk.1':
> Permission denied
>
> I added some debug flags to get more info and added -x to the deploy
> script. Closest I get to more details is this:
>
> 2016-04-06 04:15:35.945+0000: 14072: debug :
> virStorageFileBackendFileInit:1441 : initializing FS storage file
> 0x7f6aa4009000 (file:/var/lib/one//datastores/0/38/disk.1)[9869:9869]
> 2016-04-06 04:15:35.954+0000: 14072: error :
> virStorageFileBackendFileGetUniqueIdentifier:1523 : can't canonicalize
> path '/var/lib/one//datastores/0/38/disk.1':
>
> https://www.redhat.com/archives/libvir-list/2014-May/msg00194.html
>
> Comment is: "The current implementation works for local
> storage only and returns the canonical path of the volume."
>
> But it seems the logic is applied to NFS mounts. Perhaps it shouldn't
> be? Anyway to get around this problem? This is CentOS 7 .
>
> Cheers,
> Tom K.
> -------------------------------------------------------------------------------------
>
> Living on earth is expensive, but it includes a free trip around the sun.
>
> _______________________________________________
> libvirt-users mailing list
> libvirt-users(a)redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users
8 years, 7 months
[libvirt] [PATCH V5] libxl: support creating domain with VF assignment from a pool
by Chunyan Liu
Add codes to support creating domain with network defition of assigning
SRIOV VF from a pool.
Signed-off-by: Chunyan Liu <cyliu(a)suse.com>
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
Rebase and send a new version.
src/libxl/libxl_domain.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
tests/Makefile.am | 3 +++
2 files changed, 51 insertions(+)
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 04962a0..bd5deaa 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -36,6 +36,7 @@
#include "virtime.h"
#include "locking/domain_lock.h"
#include "xen_common.h"
+#include "network/bridge_driver.h"
#define VIR_FROM_THIS VIR_FROM_LIBXL
@@ -764,6 +765,10 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,
if (net->ifname &&
STRPREFIX(net->ifname, LIBXL_GENERATED_PREFIX_XEN))
VIR_FREE(net->ifname);
+
+ /* cleanup actual device */
+ virDomainNetRemoveHostdev(vm->def, net);
+ networkReleaseActualDevice(vm->def, net);
}
}
@@ -900,6 +905,46 @@ libxlDomainFreeMem(libxl_ctx *ctx, libxl_domain_config *d_config)
return -1;
}
+static int
+libxlNetworkPrepareDevices(virDomainDefPtr def)
+{
+ size_t i;
+
+ for (i = 0; i < def->nnets; i++) {
+ virDomainNetDefPtr net = def->nets[i];
+ int actualType;
+
+ /* If appropriate, grab a physical device from the configured
+ * network's pool of devices, or resolve bridge device name
+ * to the one defined in the network definition.
+ */
+ if (networkAllocateActualDevice(def, net) < 0)
+ return -1;
+
+ actualType = virDomainNetGetActualType(net);
+ if (actualType == VIR_DOMAIN_NET_TYPE_HOSTDEV &&
+ net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
+ /* Each type='hostdev' network device must also have a
+ * corresponding entry in the hostdevs array. For netdevs
+ * that are hardcoded as type='hostdev', this is already
+ * done by the parser, but for those allocated from a
+ * network / determined at runtime, we need to do it
+ * separately.
+ */
+ virDomainHostdevDefPtr hostdev = virDomainNetGetActualHostdev(net);
+ virDomainHostdevSubsysPCIPtr pcisrc = &hostdev->source.subsys.u.pci;
+
+ if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
+ hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
+ pcisrc->backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_XEN;
+
+ if (virDomainHostdevInsert(def, hostdev) < 0)
+ return -1;
+ }
+ }
+ return 0;
+}
+
static void
libxlConsoleCallback(libxl_ctx *ctx, libxl_event *ev, void *for_callback)
{
@@ -1050,6 +1095,9 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
goto cleanup;
VIR_FREE(priv->lockState);
+ if (libxlNetworkPrepareDevices(vm->def) < 0)
+ goto cleanup_dom;
+
if (libxlBuildDomainConfig(driver->reservedGraphicsPorts, vm->def,
cfg->ctx, &d_config) < 0)
goto cleanup_dom;
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b3f1144..db4f88b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -534,6 +534,9 @@ endif ! WITH_XEN
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
+if WITH_NETWORK
+libxl_LDADDS += ../src/libvirt_driver_network_impl.la
+endif WITH_NETWORK
libxl_LDADDS += $(LDADDS)
xlconfigtest_SOURCES = \
--
1.8.5.6
8 years, 7 months