[libvirt] Regression issues with libvirt DAC isolation
by Marcelo Cerri
Hi,
I was notified that the latest patches for libvirt DAC isolation is
causing some regression issues. I'm working on fixes for it but I have
some doubts of how I should handle some scenarios. I'd appreciate some
suggestions:
* Item 3.2: this is a test case that uses only SELinux driver, but
seclabels for both DAC and SELinux are dumped in guest's XML. Before my
patches, libvirt already made use of DAC driver when running in
privileged mode, but this wasn't reflected in guest's XML. I tried to
keep the same behavior and libvirt still adds DAC driver when running in
privileged mode, but I didn't realize this would impact in guest's XML.
So, I'm thinking about two alternatives:
1. Simply do not add the DAC driver when running in privileged mode.
2. Keep it as it is. Probably applications that parse guest's XML
will continue to run without problems if they just consider the first
security label.
* Item 4.1: an error is issued because model is not defined for a
seclabel inside a device definition. model is used to differentiate each
label and should only be required when more than one security driver is
used. The problem here is related to the one in item 3.2, DAC was
implicitly added because libvirt is running in privileged mode and so we
have 2 drivers in use.
I can use the order that seclabels appears in XML to match with the
order that security drivers appears in qemu.conf to avoid this kind of
error. What do you think of this solution?
Regards,
Marcelo
12 years, 2 months
[libvirt] [PATCH] docs: CPU allocation and pinning clarification
by Martin Kletzander
There was a request for clarifying this part of the
documentation. This also fixes a case used with CPU.
---
docs/formatdomain.html.in | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index e671e36..468fc62 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -369,7 +369,8 @@
if it's specified. If both <code>cpuset</code> and <code>placement</code>
are not specified, or if <code>placement</code> is "static", but no
<code>cpuset</code> is specified, the domain process will be pinned to
- all the available physical CPUs.
+ all the available physical CPUs. These settings can be superseded
+ by <a href="#elementsCPUTuning">CPU tuning</a>.
</dd>
</dl>
@@ -404,9 +405,11 @@
</dd>
<dt><code>vcpupin</code></dt>
<dd>
- The optional <code>vcpupin</code> element specifies which of host
- physical CPUS the domain VCPU will be pinned to. If this is omitted,
- each VCPU is pinned to all the physical CPUS by default. It contains two
+ The optional <code>vcpupin</code> element specifies which of host's
+ physical CPUs the domain VCPU will be pinned to. This setting supersedes
+ previous VCPU placement specified in <a href="#elementsCPUAllocation">CPU
+ Allocation</a> using <code>vcpu</code> element. If this is omitted,
+ each VCPU is pinned to all the physical CPUs by default. It contains two
required attributes, the attribute <code>vcpu</code> specifies vcpu id,
and the attribute <code>cpuset</code> is same as
attribute <code>cpuset</code>
--
1.7.12
12 years, 2 months
[libvirt] [PATCH 00/15] Hostdev and Hostdev-hybrid patches
by Shradha Shah
This patch series supports the forward mode='hostdev'. The functionality
of this mode is the same as interface type='hostdev' but with the added
benefit of using interface pools.
The patch series also contains a patch to support use of interface names
and PCI device addresses interchangeably in a network xml, and return
the appropriate one in actualDevice when networkAllocateActualDevice is
called.
At the top level managed attribute can be specified with identical results
as when it's specified for a hostdev.
Currently forward mode='hostdev' does not support USB devices.
Since the hostdev-hybrid patches are dependent on the hostdev patches,
I have also included the support for interface-type="hostdev-hybrid" and
forward mode="hostdev-hybrid" in this patch series.
The hostdev-hybrid mode makes migration possible along with PCI-passthrough.
I had posted a RFC on the hostdev-hybrid methodology earlier on the libvirt
mailing list.
The RFC can be found here:
https://www.redhat.com/archives/libvir-list/2012-February/msg00309.html
Shradha Shah (15):
Prerequisite Patch. virDomainDevicePCIAddress and respective
functions moved to a new file called conf/device_conf.ch
Moved the code to create implicit interface pool from PF to a new
function
RNG updates, new xml parser/formatter code to support forward
mode=hostdev
Code to return interface name or pci_addr of the VF in actualDevice
Forward Mode Hostdev network driver Implementation
Forward Mode 'Hostdev' qemu driver implementation
RNG updates, new xml parser/formatter code to support interface
type=hostdev-hybrid
RNG updates, new xml parser/formatter code to support forward
mode=hostdev-hybrid
Hostdev-hybrid mode requires a direct linkdev and direct mode.
ActualParent is used to store the information about the NETDEV that
contains HOSTDEV in hybrid case.
Hybrid Hostdevs should be marked as ephemeral.
Hostdev-hybrid network driver Implementation
Hostdev-hybrid qemu driver implementation
Using the Ephemeral Flag to prepare for Migration Support.
Migration support for hostdev-hybrid.
docs/formatdomain.html.in | 29 ++
docs/formatnetwork.html.in | 62 +++
docs/schemas/domaincommon.rng | 50 +++
docs/schemas/network.rng | 83 ++++-
include/libvirt/libvirt.h.in | 1 +
include/libvirt/virterror.h | 1 +
src/Makefile.am | 6 +-
src/conf/device_conf.c | 135 ++++++
src/conf/device_conf.h | 65 +++
src/conf/domain_conf.c | 286 +++++++-----
src/conf/domain_conf.h | 33 +-
src/conf/network_conf.c | 131 +++++-
src/conf/network_conf.h | 30 ++-
src/libvirt_private.syms | 11 +-
src/network/bridge_driver.c | 463 ++++++++++++++++----
src/qemu/qemu_command.c | 99 ++++-
src/qemu/qemu_domain.c | 6 +-
src/qemu/qemu_domain.h | 3 +-
src/qemu/qemu_driver.c | 6 +-
src/qemu/qemu_hostdev.c | 97 +++--
src/qemu/qemu_hotplug.c | 35 ++-
src/qemu/qemu_migration.c | 106 +++++-
src/qemu/qemu_monitor.c | 14 +-
src/qemu/qemu_monitor.h | 17 +-
src/qemu/qemu_monitor_json.c | 14 +-
src/qemu/qemu_monitor_json.h | 14 +-
src/qemu/qemu_monitor_text.c | 16 +-
src/qemu/qemu_monitor_text.h | 14 +-
src/qemu/qemu_process.c | 3 +-
src/uml/uml_conf.c | 5 +
src/util/pci.c | 2 +-
src/util/pci.h | 2 +
src/util/virnetdev.c | 65 +++-
src/util/virnetdev.h | 10 +-
src/util/virterror.c | 3 +-
src/xen/xend_internal.c | 3 +-
src/xenxs/xen_sxpr.c | 1 +
tests/networkxml2xmlin/hostdev-hybrid-pf.xml | 11 +
tests/networkxml2xmlin/hostdev-hybrid.xml | 10 +
tests/networkxml2xmlin/hostdev-pf.xml | 11 +
tests/networkxml2xmlin/hostdev.xml | 10 +
tests/networkxml2xmlout/hostdev-hybrid-pf.xml | 7 +
tests/networkxml2xmlout/hostdev-hybrid.xml | 10 +
tests/networkxml2xmlout/hostdev-pf.xml | 7 +
tests/networkxml2xmlout/hostdev.xml | 10 +
tests/networkxml2xmltest.c | 4 +
.../qemuxml2argv-net-hostdevhybrid.args | 6 +
.../qemuxml2argv-net-hostdevhybrid.xml | 35 ++
tests/qemuxml2xmltest.c | 1 +
49 files changed, 1675 insertions(+), 368 deletions(-)
create mode 100644 src/conf/device_conf.c
create mode 100644 src/conf/device_conf.h
create mode 100644 tests/networkxml2xmlin/hostdev-hybrid-pf.xml
create mode 100644 tests/networkxml2xmlin/hostdev-hybrid.xml
create mode 100644 tests/networkxml2xmlin/hostdev-pf.xml
create mode 100644 tests/networkxml2xmlin/hostdev.xml
create mode 100644 tests/networkxml2xmlout/hostdev-hybrid-pf.xml
create mode 100644 tests/networkxml2xmlout/hostdev-hybrid.xml
create mode 100644 tests/networkxml2xmlout/hostdev-pf.xml
create mode 100644 tests/networkxml2xmlout/hostdev.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-hostdevhybrid.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-hostdevhybrid.xml
--
1.7.4.4
12 years, 2 months
[libvirt] [test-API][PATCH] Fix a typo in commit b111531
by Wayne Sun
Signed-off-by: Wayne Sun <gsun(a)redhat.com>
---
src/env_inspect.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/env_inspect.py b/src/env_inspect.py
index cf036f7..222ffb1 100644
--- a/src/env_inspect.py
+++ b/src/env_inspect.py
@@ -77,7 +77,7 @@ def sharemod_init(env_parser, logger):
username = env_parser.get_value('variables', 'username')
password = env_parser.get_value('variables', 'password')
conn = utils.get_conn(uri, username, password)
- if not conn
+ if not conn:
return 1
# initialize conn object in sharedmod
--
1.7.1
12 years, 2 months
[libvirt] IVSHMEM support
by Shawn Furrow
Hi all,
Does anyone know if Libvirt supports shared memory devices such as IVSHMEM.
I know it didn't at one point but I didn't know if support for it had been
recently added.
Thanks,
Shawn
--
Virginia Tech
Bradley Department of Electrical and Computer Engineering
B.S. Electrical Engineering
B.S. Computer Engineering
12 years, 2 months
[libvirt] ANNOUNCE: libvirt 0.9.11.5 maintenance release
by Cole Robinson
libvirt 0.9.11.5 maintenance release is now available. This is
libvirt 0.9.11 with additional bugfixes that have accumulated
upstream since the initial release.
This release can be downloaded at:
http://libvirt.org/sources/stable_updates/libvirt-0.9.11.5.tar.gz
Changes in this version:
* Prep for release 0.9.11.5
* tests: avoid seclabeltest crash
* client rpc: Fix error checking after poll()
* client rpc: Send keepalive requests from IO event loop
* server rpc: Remove APIs for manipulating filters on locked client
* rpc: Remove unused parameter in virKeepAliveStopInternal
* rpc: Do not use timer for sending keepalive responses
* client rpc: Separate call creation from running IO loop
* rpc: Add APIs for direct triggering of keepalive timer
* rpc: Refactor keepalive timer code
* client rpc: Drop unused return value of virNetClientSendNonBlock
* client rpc: Just queue non-blocking call if another thread has the
buck
* client rpc: Don't drop non-blocking calls
* client rpc: Use event loop for writing
* client rpc: Improve debug messages in virNetClientIO
* keepalive: Add ability to disable keepalive messages
* conf: Remove console stream callback only when freeing console helper
* Fix typo s/AM_CLFAGS/AM_CFLAGS/ in sanlock link (cherry picked from
commit 7de158cf68cae7ab55d3cae1a01744b374810840)
* virsh: console: Avoid using stream after being freed.
* qemu: syntax fix
* qemu: fix use after free
* conf: Remove callback from stream when freeing entries in console hash
* security: Skip labeling resources when seclabel defaults to none
* fixed SegFault in virauth
* adding handling EINTR to poll to make it more robust
* doc: Fix time keeping example for the guest clock
* Fix test failure when no IPv6 is avail
* Ensure failure to talk to Xen hypervisor is fatal when privileged
* Don't autostart domains when reloading config
* build: fix compilation without struct ifreq
* remote: Fix locking in stream APIs
* qemu: Do not fail virConnectCompareCPU if host CPU is not known
* Clarify direct migration
* Fix daemon auto-spawning
* openvz: Handle domain obj hash map errors
* Fix /domain/features setting in qemuParseCommandLine
* systemd: start libvirtd after network
* Fix a string format bug in qemu_cgroup.c
* virsh: Clarify documentation for virsh dompmsuspend command
* storage_backend_fs: Don't free a part of a structure on error
* Fix one test regression on auth Ceph support
* qemu: Always set auth_supported for Ceph disks.
* qemu: add rbd to whitelist of migration-safe formats
* maint: use full author name for previous commit
* fix key error for qemuMonitorGetBlockStatsInfo
* virsh: Cleanup virsh -V output
* nwfilter: Fix memory leak
* Fix vm's outbound traffic control problem
* network_conf: Don't free uninitialized pointers while parsing DNS SRV
* storage: Error out if the target is already mounted for netfs pool
* configure: show correct default argument in help
* events: Don't fail on registering events for two different domains
* doc: fix typo in virDomainDestroy API doc (cherry picked from commit
0b7ad22ba6aaefaaa1d9792f3c236322aafe93c7)
* Add /tools/libvirt-guests.service to .gitignore
* Don't install systemd service files executable
* S390: Fixed Parser for /proc/cpuinfo needs to be adapted for your
architecture
* S390: Override QEMU_CAPS_NO_ACPI for s390x
* qemu: Improve error if setmem fails for lacking of balloon support
* virsh: Improve error when trying to change vm's cpu count 0
* Initialize random generator in lxc controller
* openvz: check pointer size instead of int
* Fix default USB controller for ppc64
* virsh: fix few typos on desc command
* domain_conf: fix possible memory leak
* virsh: make domiftune interface help string consistent
* openvz: Fix wordsize on 64 bit architectures
* LXC: fix memory leak in lxcContainerMountFSBlockHelper
* qemu_agent: Wait for events instead of agent response
* build: hoist qemu dependence on yajl to configure
* autogen: Always abide --system
* Check for errors when parsing bridge interface XML
* schema: Update domain XML schema
* qemu: fix potential dead lock
* virsh: Null terminated the string memcpy from buffer explicitly
* docs: small typo in formatdomain.html (cherry picked from commit
8b36e32c16641f09c484a32920bb9da255ea4df9)
* Remove bogus xen-devel dep from libvirt-devel RPM
* Revert "qemu: fix build when !HAVE_NUMACTL"
* daemon: Fix crash in virTypedParameterArrayClear
* libvirt-guests: systemd host shutdown does not work
* build: update to latest gnulib, for secure tarball
* Update to latest GNULIB to fix compat with Mingw64 toolchain
* build: update to latest gnulib
For info about past maintenance releases, see:
http://wiki.libvirt.org/page/Maintenance_Releases
Thanks,
Cole
12 years, 2 months
[libvirt] [PATCH V2] offline migration
by liguang
add offline migration to migrate a domain which is
only defined but not active, this implementation has
nothing to do with type of VM(qemu, xen etc.),
it transfers data by stream.
>From 634687c6ee81c784b633e4a86f3613e109ecda7c Mon Sep 17 00:00:00 2001
From: liguang <lig.fnst(a)cn.fujitsu.com>
Date: Thu, 9 Aug 2012 16:04:29 +0800
Subject: [PATCH] implement offline migration
Signed-off-by: liguang <lig.fnst(a)cn.fujitsu.com>
---
daemon/remote.c | 46 +++++++++++++++++++++++++++
docs/hvsupport.pl | 2 +
include/libvirt/libvirt.h.in | 6 +++
python/generator.py | 1 +
src/driver.h | 5 +++
src/libvirt.c | 22 +++++++++++++
src/libvirt_public.syms | 1 +
src/remote/remote_driver.c | 70
++++++++++++++++++++++++++++++++++++++++++
src/remote/remote_protocol.x | 10 +++++-
tools/virsh-domain.c | 69
+++++++++++++++++++++++++++++++++++++++++
10 files changed, 231 insertions(+), 1 deletions(-)
diff --git a/daemon/remote.c b/daemon/remote.c
index d25717c..5c175b2 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -21,6 +21,9 @@
*/
#include <config.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
#include "virterror_internal.h"
@@ -48,6 +51,7 @@
#include "virdbus.h"
#include "remote_protocol.h"
#include "qemu_protocol.h"
+#include "fdstream.h"
#define VIR_FROM_THIS VIR_FROM_RPC
@@ -1617,6 +1621,48 @@ no_memory:
goto cleanup;
}
+static int remoteDispatchDomainMigrateOffline(
+ virNetServerPtr server ATTRIBUTE_UNUSED,
+ virNetServerClientPtr client,
+ virNetMessagePtr msg ATTRIBUTE_UNUSED,
+ virNetMessageErrorPtr rerr,
+ remote_domain_migrate_offline_args *args,
+ remote_domain_migrate_offline_ret *ret ATTRIBUTE_UNUSED)
+{
+ int rv = -1;
+ virStreamPtr st = NULL;
+ daemonClientStreamPtr stream = NULL;
+ daemonClientPrivatePtr priv =
+ virNetServerClientGetPrivateData(client);
+
+ if (!priv->conn) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not
open"));
+ goto cleanup;
+ }
+
+ st = virStreamNew(priv->conn, VIR_STREAM_NONBLOCK);
+
+ if (!(stream = daemonCreateClientStream(client, st, remoteProgram,
&msg->header)))
+ goto cleanup;
+
+ if (virFDStreamCreateFile(st,
+ args->name,
+ 0, 0,
+ O_WRONLY, 0) < 0)
+ goto cleanup;
+
+
+ if (daemonAddClientStream(client, stream, false) < 0)
+ goto cleanup;
+
+ rv = 0;
+
+cleanup:
+ if (rv < 0)
+ virNetMessageSaveError(rerr);
+ return rv;
+}
+
static int
remoteDispatchDomainMigratePrepare(virNetServerPtr server
ATTRIBUTE_UNUSED,
virNetServerClientPtr client
ATTRIBUTE_UNUSED,
diff --git a/docs/hvsupport.pl b/docs/hvsupport.pl
index 4871739..47fc505 100755
--- a/docs/hvsupport.pl
+++ b/docs/hvsupport.pl
@@ -128,6 +128,8 @@ $apis{virDomainMigratePrepareTunnel3} = "0.9.2";
$apis{virDomainMigratePerform3} = "0.9.2";
$apis{virDomainMigrateFinish3} = "0.9.2";
$apis{virDomainMigrateConfirm3} = "0.9.2";
+$apis{virDomainMigrateOffline} = "0.10.1";
+
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index d21d029..e4a6e14 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -977,6 +977,7 @@ typedef enum {
* whole migration
process; this will be used automatically
* when supported */
VIR_MIGRATE_UNSAFE = (1 << 9), /* force migration even
if it is considered unsafe */
+ VIR_MIGRATE_OFFLINE = (1 << 10), /* offline migration */
} virDomainMigrateFlags;
/* Domain migration. */
@@ -1012,6 +1013,11 @@ int virDomainMigrateGetMaxSpeed(virDomainPtr
domain,
unsigned long *bandwidth,
unsigned int flags);
+int
+virDomainMigrateOffline(virConnectPtr dconn,
+ char *file);
+
+
/**
* VIR_NODEINFO_MAXCPUS:
* @nodeinfo: virNodeInfo instance
diff --git a/python/generator.py b/python/generator.py
index 6559ece..42e266b 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -427,6 +427,7 @@ skip_impl = (
'virDomainGetDiskErrors',
'virConnectUnregisterCloseCallback',
'virConnectRegisterCloseCallback',
+ 'virDomainMigrateOffline',
)
qemu_skip_impl = (
diff --git a/src/driver.h b/src/driver.h
index aab9766..d17fa22 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -865,6 +865,10 @@ typedef char *
int type,
const char *uri,
unsigned int flags);
+typedef int
+ (*virDrvDomainMigrateOffline)(virConnectPtr dconn,
+ const char *file);
+
/**
* _virDriver:
@@ -1048,6 +1052,7 @@ struct _virDriver {
virDrvDomainGetDiskErrors domainGetDiskErrors;
virDrvDomainSetMetadata domainSetMetadata;
virDrvDomainGetMetadata domainGetMetadata;
+ virDrvDomainMigrateOffline domainMigrateOffline;
};
typedef int
diff --git a/src/libvirt.c b/src/libvirt.c
index 3c4bf8c..497f48d 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -5003,6 +5003,28 @@ virDomainMigratePeer2Peer (virDomainPtr domain,
}
}
+/**
+ * virDomainMigrateOffline:
+ * @dconn: target connection handler
+ * @file: the file to push to target
+ *
+ * to handle offline migration
+ * Returns -1 if error, else 0
+ */
+int
+virDomainMigrateOffline(virConnectPtr dconn,
+ char *file)
+{
+ VIR_DEBUG("dconn=%p, file=%s", dconn, NULLSTR(file));
+
+ if (!VIR_IS_CONNECT (dconn)) {
+ virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
+ virDispatchError(NULL);
+ return -1;
+ }
+
+ return dconn->driver->domainMigrateOffline(dconn, file);
+}
/*
* In normal migration, the libvirt client co-ordinates communication
diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms
index e3ba119..6615a45 100644
--- a/src/libvirt_public.syms
+++ b/src/libvirt_public.syms
@@ -549,6 +549,7 @@ LIBVIRT_0.10.0 {
virDomainGetHostname;
virConnectRegisterCloseCallback;
virConnectUnregisterCloseCallback;
+ virDomainMigrateOffline;
} LIBVIRT_0.9.13;
# .... define new API here using predicted next version number ....
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index afd367b..a35599d 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -22,8 +22,12 @@
*/
#include <config.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
#include <unistd.h>
+#include <stdio.h>
#include <assert.h>
#include "virnetclient.h"
@@ -5061,6 +5065,71 @@ done:
return rv;
}
+static int
+doRemoteReadFile(virStreamPtr st ATTRIBUTE_UNUSED,
+ char *buf, size_t nbytes, void *opaque)
+{
+ int *fd = opaque;
+
+ return read(*fd, buf, nbytes);
+}
+
+static int
+remoteDomainMigrateOffline(virConnectPtr dconn,
+ const char *name)
+{
+ int rv = -1, fd = -1;
+ virStreamPtr st = virStreamNew(dconn, 0);
+ remote_domain_migrate_offline_args args;
+ remote_domain_migrate_offline_ret ret;
+ struct private_data *priv = dconn->privateData;
+ virNetClientStreamPtr netst = NULL;
+
+ remoteDriverLock(priv);
+
+ args.name = (char *)name;
+ memset(&ret, 0, sizeof(ret));
+
+ if (!(netst = virNetClientStreamNew(priv->remoteProgram,
REMOTE_PROC_DOMAIN_MIGRATE_OFFLINE, priv->counter)))
+ goto done;
+ if (virNetClientAddStream(priv->client, netst) < 0) {
+ virNetClientStreamFree(netst);
+ goto done;
+ }
+ st->driver = &remoteStreamDrv;
+ st->privateData = netst;
+
+ if ((fd = open(name, O_RDONLY)) < 0)
+ goto done;
+ if (fd == -1)
+ goto done;
+
+ if (call (dconn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_OFFLINE,
+ (xdrproc_t) xdr_remote_domain_migrate_offline_args, (char
*) &args,
+ (xdrproc_t) xdr_remote_domain_migrate_offline_ret, (char
*) &ret) == -1) {
+ virNetClientRemoveStream(priv->client, netst);
+ virNetClientStreamFree(netst);
+ st->driver = NULL;
+ st->privateData = NULL;
+ goto done;
+ }
+
+ remoteDriverUnlock(priv);
+
+ if (virStreamSendAll(st, doRemoteReadFile, &fd) < 0)
+ goto done;
+ if (virStreamFinish(st) < 0)
+ goto done;
+ if (VIR_CLOSE(fd) < 0)
+ goto done;
+
+ rv = 0;
+
+done:
+ return rv;
+}
+
+
static void
remoteDomainEventQueue(struct private_data *priv, virDomainEventPtr
event)
{
@@ -5302,6 +5371,7 @@ static virDriver remote_driver = {
.domainEventDeregister = remoteDomainEventDeregister, /* 0.5.0 */
.domainMigratePrepare2 = remoteDomainMigratePrepare2, /* 0.5.0 */
.domainMigrateFinish2 = remoteDomainMigrateFinish2, /* 0.5.0 */
+ .domainMigrateOffline = remoteDomainMigrateOffline, /* 0.10.1 */
.nodeDeviceDettach = remoteNodeDeviceDettach, /* 0.6.1 */
.nodeDeviceReAttach = remoteNodeDeviceReAttach, /* 0.6.1 */
.nodeDeviceReset = remoteNodeDeviceReset, /* 0.6.1 */
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 200fe75..3d4ff8f 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -2527,6 +2527,13 @@ struct remote_connect_list_all_domains_ret {
unsigned int ret;
};
+struct remote_domain_migrate_offline_args {
+ remote_nonnull_string name;
+};
+
+struct remote_domain_migrate_offline_ret {
+ int retval;
+};
/*----- Protocol. -----*/
@@ -2854,7 +2861,8 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_LIST_ALL_SNAPSHOTS = 274, /* skipgen skipgen
priority:high */
REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_ALL_CHILDREN = 275, /* skipgen
skipgen priority:high */
REMOTE_PROC_DOMAIN_EVENT_BALLOON_CHANGE = 276, /* autogen autogen
*/
- REMOTE_PROC_DOMAIN_GET_HOSTNAME = 277 /* autogen autogen */
+ REMOTE_PROC_DOMAIN_GET_HOSTNAME = 277, /* autogen autogen */
+ REMOTE_PROC_DOMAIN_MIGRATE_OFFLINE = 278 /* skipgen skipgen
priority:low*/
/*
* Notice how the entries are grouped in sets of 10 ?
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 33b1727..8f9b662 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -6304,9 +6304,66 @@ static const vshCmdOptDef opts_migrate[] = {
{"dname", VSH_OT_DATA, 0, N_("rename to new name during migration
(if supported)")},
{"timeout", VSH_OT_INT, 0, N_("force guest to suspend if live
migration exceeds timeout (in seconds)")},
{"xml", VSH_OT_STRING, 0, N_("filename containing updated XML for
the target")},
+ {"offline", VSH_OT_BOOL, 0, N_("migration when there's no domain
active")},
{NULL, 0, 0, NULL}
};
+static int
+push_file(char dst[] ATTRIBUTE_UNUSED, char *file, virConnectPtr dconn)
+{
+ int ret = -1;
+
+ ret = virDomainMigrateOffline(dconn, file);
+
+ return ret;
+}
+
+static void
+vshMigrateOffline(vshControl *ctl, char *file, char dst[])
+{
+ xmlDocPtr xml = NULL;
+ xmlXPathContextPtr ctxt = NULL;
+ xmlNodePtr *disks = NULL;
+ virConnectPtr dconn = NULL;
+ int i = 0, ret = 0;
+ char *src[] = {NULL};
+
+ if (!vshConnectionUsability(ctl, ctl->conn))
+ return;
+
+ xml = virXMLParseFileCtxt(file, &ctxt);
+ if (!xml) {
+ vshError(NULL, "%s", _("Fail to get domain information from"));
+ goto cleanup;
+ }
+
+ ret = virXPathNodeSet("./devices/disk", ctxt, &disks);
+ if (ret < 0) {
+ vshError(NULL, "%s", _("Fail to get disk node"));
+ goto cleanup;
+ }
+
+ dconn = virConnectOpen(dst);
+ if (!dconn)
+ goto cleanup;
+ vshPrint(ctl, "pushing %s to %s\n", file, dst);
+ if (push_file(dst, file, dconn) < 0)
+ goto cleanup;
+ for (i = 0 ; i < ret ; i++) {
+ ctxt->node = disks[i];
+ src[i] = virXPathString("string(./source/@file"
+ "|./source/@dir"
+ "|./source/@name)", ctxt);
+ vshPrint(ctl, "pushing %s to %s\n", src[i], dst);
+ if (push_file(dst, src[i], dconn) < 0)
+ break;
+ }
+
+cleanup:
+ xmlXPathFreeContext(ctxt);
+ xmlFreeDoc(xml);
+}
+
static void
doMigrate(void *opaque)
{
@@ -6373,12 +6430,24 @@ doMigrate(void *opaque)
if (vshCommandOptBool(cmd, "unsafe"))
flags |= VIR_MIGRATE_UNSAFE;
+ if (vshCommandOptBool(cmd, "offline")) {
+ flags |= VIR_MIGRATE_OFFLINE;
+ if (xmlfile == NULL)
+ vshError(ctl, _("please specify xmlfile for offline
migration"));
+ }
+
if (xmlfile &&
virFileReadAll(xmlfile, 8192, &xml) < 0) {
vshError(ctl, _("file '%s' doesn't exist"), xmlfile);
goto out;
}
+ if (flags & VIR_MIGRATE_OFFLINE) {
+ vshMigrateOffline(ctl, (char *)xmlfile, (char *)desturi);
+ goto out;
+ }
+
+
if ((flags & VIR_MIGRATE_PEER2PEER) ||
vshCommandOptBool(cmd, "direct")) {
/* For peer2peer migration or direct migration we only expect
one URI
--
1.7.2.5
12 years, 2 months
[libvirt] Reminder: KVM Forum 2012 Call For Participation
by KVM Forum 2012 Program Committee
Just a reminder, the CFP ends this Friday.
--
=================================================================
KVM Forum 2012: Call For Participation
November 7-9, 2012 - Hotel Fira Palace - Barcelona, Spain
(All submissions must be received before midnight Aug 31st, 2012)
=================================================================
KVM is an industry leading open source hypervisor that provides
an ideal platform for datacenter virtualization, virtual desktop
infrastructure, and cloud computing. Once again, it's time to bring
together the community of developers and users that define the KVM
ecosystem for our annual technical conference. We will discuss the
current state of affairs and plan for the future of KVM, its surrounding
infrastructure, and management tools. We are also excited to announce
the oVirt Workshop will run in parallel with the KVM Forum, bringing in
a community focused on enterprise datacenter virtualization management
built on KVM. For topics which overlap we will have shared sessions.
So mark your calendar and join us in advancing KVM.
http://events.linuxfoundation.org/events/kvm-forum/
Once again we are colocated with The Linux Foundation's LinuxCon,
Based on feedback from last year, this time it's LinuxCon Europe!
KVM Forum attendees will be able to attend oVirt Workshop sessions and
are eligible to attend LinuxCon Europe for a discounted rate.
http://events.linuxfoundation.org/events/kvm-forum/register
We invite you to lead part of the discussion by submitting a speaking
proposal for KVM Forum 2012.
http://events.linuxfoundation.org/cfp
Suggested topics:
KVM
- Scaling and performance
- Nested virtualization
- I/O improvements
- PCI device assignment
- Driver domains
- Time keeping
- Resource management (cpu, memory, i/o)
- Memory management (page sharing, swapping, huge pages, etc)
- VEPA, VN-Link, vswitch
- Security
- Architecture ports
QEMU
- Device model improvements
- New devices and chipsets
- Scaling and performance
- Desktop virtualization
- Spice
- Increasing robustness and hardening
- Security model
- Management interfaces
- QMP protocol and implementation
- Image formats
- Firmware (SeaBIOS, OVMF, UEFI, etc)
- Live migration
- Live snapshots and merging
- Fault tolerance, high availability, continuous backup
- Real-time guest support
Virtio
- Speeding up existing devices
- Alternatives
- Virtio on non-Linux or non-virtualized
Management infrastructure
- oVirt (shared track w/ oVirt Workshop)
- Libvirt
- KVM autotest
- OpenStack
- Network virtualization management
- Enterprise storage management
Cloud computing
- Scalable storage
- Virtual networking
- Security
- Provisioning
SUBMISSION REQUIREMENTS
Abstracts due: Aug 31st, 2012
Notification: Sep 14th, 2012
Please submit a short abstract (~150 words) describing your presentation
proposal. In your submission please note how long your talk will take.
Slots vary in length up to 45 minutes. Also include in your proposal
the proposal type -- one of:
- technical talk
- end-user talk
- birds of a feather (BOF) session
Submit your proposal here:
http://events.linuxfoundation.org/cfp
You will receive a notification whether or not your presentation proposal
was accepted by Sep 14th.
END-USER COLLABORATION
One of the big challenges as developers is to know what, where and how
people actually use our software. We will reserve a few slots for end
users talking about their deployment challenges and achievements.
If you are using KVM in production you are encouraged submit a speaking
proposal. Simply mark it as an end-user collaboration proposal. As an
end user, this is a unique opportunity to get your input to developers.
BOF SESSION
We will reserve some slots in the evening after the main conference
tracks, for birds of a feather (BOF) sessions. These sessions will be
less formal than presentation tracks and targetted for people who would
like to discuss specific issues with other developers and/or users.
If you are interested in getting developers and/or uses together to
discuss a specific problem, please submit a BOF proposal.
LIGHTNING TALKS
In addition to submitted talks we will also have some room for lightning
talks. These are short (5 minute) discussions to highlight new work or
ideas that aren't complete enough to warrant a full presentation slot.
Lightning talk submissions and scheduling will be handled on-site at
KVM Forum.
HOTEL / TRAVEL
The KVM Forum 2012 will be held in Barcelona, Spain at the Hotel Fira Palace.
http://events.linuxfoundation.org/events/kvm-forum/hotel
Thank you for your interest in KVM. We're looking forward to your
submissions and seeing you at the KVM Forum 2012 in November!
Thanks,
your KVM Forum 2012 Program Commitee
Please contact us with any questions or comments.
KVM-Forum-2012-PC(a)redhat.com
12 years, 2 months