Hello community,
here is the log from the commit of package libvirt for openSUSE:Factory
checked in at Fri Feb 5 14:34:21 CET 2010.
--------
--- libvirt/libvirt.changes 2010-01-07 02:07:07.000000000 +0100
+++ /mounts/work_src_done/STABLE/libvirt/libvirt.changes 2010-02-04 21:17:18.000000000 +0100
@@ -1,0 +2,30 @@
+Thu Feb 4 12:36:48 MST 2010 - jfehlig@novell.com
+
+- Updated to version 0.7.6
+ - Implement support for multi IQN
+ - Implement CPU topology support for QEMU driver
+ - Use QEmu new device adressing when possible
+ - Implement SCSI controller hotplug/unplug for QEMU
+ - lots of improvements and bug fixes
+
+-------------------------------------------------------------------
+Wed Jan 27 17:48:18 MST 2010 - jfehlig@novell.com
+
+- Support new XEN_SYSCTL_INTERFACE_VERSION 7 in libvirt
+ bnc#574124
+ xen-sysctl-v7.patch
+- Add upstream patches as prelude to fixing various device
+ attach/detach issues
+ devflag-0[1-9].patch
+- Fix attaching/detaching disk device from inactive Xen guest
+ bnc#500586 and bnc#573748
+
+-------------------------------------------------------------------
+Tue Jan 12 12:36:15 MST 2010 - jfehlig@novell.com
+
+- Fix migration with Xen4.0
+ bnc#569598
+ Add xen-migration-params.patch
+ Remove migrate-params.patch
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
detach-disk.patch
libvirt-0.7.5.tar.bz2
migrate-params.patch
node-dev-free.patch
xen-shr-pages.patch
New:
----
devflag-01.patch
devflag-02.patch
devflag-03.patch
devflag-04.patch
devflag-05.patch
devflag-06.patch
devflag-07.patch
devflag-08.patch
devflag-09.patch
libvirt-0.7.6.tar.bz2
xen-name-for-devid.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libvirt.spec ++++++
--- /var/tmp/diff_new_pack.j8vEsu/_old 2010-02-05 14:31:18.000000000 +0100
+++ /var/tmp/diff_new_pack.j8vEsu/_new 2010-02-05 14:31:18.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package libvirt (Version 0.7.5)
+# spec file for package libvirt (Version 0.7.6)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -111,7 +111,7 @@
License: LGPLv2.1+
Group: Development/Libraries/C and C++
AutoReqProv: yes
-Version: 0.7.5
+Version: 0.7.6
Release: 1
Summary: A C toolkit to interract with the virtualization capabilities of Linux
# The client side, i.e. shared libs and virsh are in a subpackage
@@ -123,7 +123,6 @@
Requires: virt-utils
Recommends: logrotate
Requires: dnsmasq
-Requires: PolicyKit >= 0.6
Requires: open-iscsi
Requires: nfs-client
%if %{with_hal}
@@ -137,14 +136,20 @@
Source0: %{name}-%{version}.tar.bz2
Source1: libvirtd.init
# Upstream patches
-Patch0: detach-disk.patch
-Patch1: xen-shr-pages.patch
-Patch2: node-dev-free.patch
+Patch0: devflag-01.patch
+Patch1: devflag-02.patch
+Patch2: devflag-03.patch
+Patch3: devflag-04.patch
+Patch4: devflag-05.patch
+Patch5: devflag-06.patch
+Patch6: devflag-07.patch
+Patch7: devflag-08.patch
+Patch8: devflag-09.patch
+Patch9: xen-name-for-devid.patch
# Need to go upstream
Patch100: socat.patch
Patch101: clone.patch
-Patch102: migrate-params.patch
-Patch103: xen-pv-cdrom.patch
+Patch102: xen-pv-cdrom.patch
# Our patches
Patch200: libvirtd-defaults.patch
Patch201: suse-network.patch
@@ -255,10 +260,16 @@
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
%patch100 -p1
%patch101
%patch102 -p1
-%patch103 -p1
%patch200 -p1
%patch201 -p1
%patch202 -p1
++++++ clone.patch ++++++
--- /var/tmp/diff_new_pack.j8vEsu/_old 2010-02-05 14:31:18.000000000 +0100
+++ /var/tmp/diff_new_pack.j8vEsu/_new 2010-02-05 14:31:18.000000000 +0100
@@ -2,7 +2,7 @@
===================================================================
--- src/lxc/lxc_container.c.orig
+++ src/lxc/lxc_container.c
-@@ -813,6 +813,9 @@ int lxcContainerStart(virDomainDefPtr de
+@@ -814,6 +814,9 @@ int lxcContainerStart(virDomainDefPtr de
lxc_child_argv_t args = { def, nveths, veths, control, ttyPath };
/* allocate a stack for the container */
@@ -12,7 +12,7 @@
if (VIR_ALLOC_N(stack, stacksize) < 0) {
virReportOOMError(NULL);
return -1;
-@@ -827,7 +830,11 @@ int lxcContainerStart(virDomainDefPtr de
+@@ -828,7 +831,11 @@ int lxcContainerStart(virDomainDefPtr de
if (def->nets != NULL)
flags |= CLONE_NEWNET;
@@ -24,7 +24,7 @@
VIR_FREE(stack);
DEBUG("clone() returned, %d", pid);
-@@ -853,6 +860,7 @@ int lxcContainerAvailable(int features)
+@@ -854,6 +861,7 @@ int lxcContainerAvailable(int features)
char *childStack;
char *stack;
int childStatus;
@@ -32,7 +32,7 @@
if (features & LXC_CONTAINER_FEATURE_USER)
flags |= CLONE_NEWUSER;
-@@ -860,14 +868,21 @@ int lxcContainerAvailable(int features)
+@@ -861,14 +869,21 @@ int lxcContainerAvailable(int features)
if (features & LXC_CONTAINER_FEATURE_NET)
flags |= CLONE_NEWNET;
++++++ devflag-01.patch ++++++
commit d8ec244c6513b7c44956a547e56c228a4c38fbbe
Author: Jim Fehlig
Date: Wed Jan 13 18:24:51 2010 -0700
doc: restrict virDomain{Attach,Detach}Device to active domains
virDomain{Attach,Detach}Device is now only permitted on active
domains. Explicitly state this restriction in the API
documentation.
V2: Only change doc, dropping the hunk that forced the restriction
in libvirt frontend.
Index: libvirt-0.7.6/src/libvirt.c
===================================================================
--- libvirt-0.7.6.orig/src/libvirt.c
+++ libvirt-0.7.6/src/libvirt.c
@@ -5121,7 +5121,8 @@ error:
* @domain: pointer to domain object
* @xml: pointer to XML description of one device
*
- * Create a virtual device attachment to backend.
+ * Create a virtual device attachment to backend. This function,
+ * having hotplug semantics, is only allowed on an active domain.
*
* Returns 0 in case of success, -1 in case of failure.
*/
@@ -5164,7 +5165,8 @@ error:
* @domain: pointer to domain object
* @xml: pointer to XML description of one device
*
- * Destroy a virtual device attachment to backend.
+ * Destroy a virtual device attachment to backend. This function,
+ * having hot-unplug semantics, is only allowed on an active domain.
*
* Returns 0 in case of success, -1 in case of failure.
*/
++++++ devflag-02.patch ++++++
commit 7269ec07ba4f298adab64ea66ac528ef66cf9ba0
Author: Jim Fehlig
Date: Wed Jan 13 18:29:16 2010 -0700
Public API
Definition of public API for virDomain{Attach,Detach}DeviceFlags.
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index f192fb1..99a5c45 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -845,9 +845,22 @@ int virDomainGetVcpus (virDomainPtr domain,
*/
#define VIR_GET_CPUMAP(cpumaps,maplen,vcpu) &(cpumaps[(vcpu)*(maplen)])
+
+typedef enum {
+
+ VIR_DOMAIN_DEVICE_MODIFY_CURRENT = 0, /* Modify device allocation based on current domain state */
+ VIR_DOMAIN_DEVICE_MODIFY_LIVE = (1 << 0), /* Modify live device allocation */
+ VIR_DOMAIN_DEVICE_MODIFY_CONFIG = (1 << 1), /* Modify persisted device allocation */
+} virDomainDeviceModifyFlags;
+
int virDomainAttachDevice(virDomainPtr domain, const char *xml);
int virDomainDetachDevice(virDomainPtr domain, const char *xml);
+int virDomainAttachDeviceFlags(virDomainPtr domain,
+ const char *xml, unsigned int flags);
+int virDomainDetachDeviceFlags(virDomainPtr domain,
+ const char *xml, unsigned int flags);
+
/*
* NUMA support
*/
diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms
index 0521158..e190d83 100644
--- a/src/libvirt_public.syms
+++ b/src/libvirt_public.syms
@@ -349,4 +349,10 @@ LIBVIRT_0.7.5 {
virDomainMemoryStats;
} LIBVIRT_0.7.3;
+LIBVIRT_0.7.6 {
+ global:
+ virDomainAttachDeviceFlags;
+ virDomainDetachDeviceFlags;
+} LIBVIRT_0.7.5;
+
# .... define new API here using predicted next version number ....
++++++ devflag-03.patch ++++++
commit 5ebd48c5f4e424e0db663bf5930935b1c04d4998
Author: Jim Fehlig
Date: Wed Jan 13 18:31:14 2010 -0700
Internal API
Definition of internal API for virDomain{Attach,Detach}DeviceFlags.
diff --git a/src/driver.h b/src/driver.h
index c7e4fbf..08fe816 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -192,9 +192,17 @@ typedef int
(*virDrvDomainAttachDevice) (virDomainPtr domain,
const char *xml);
typedef int
+ (*virDrvDomainAttachDeviceFlags) (virDomainPtr domain,
+ const char *xml,
+ unsigned int flags);
+typedef int
(*virDrvDomainDetachDevice) (virDomainPtr domain,
const char *xml);
typedef int
+ (*virDrvDomainDetachDeviceFlags) (virDomainPtr domain,
+ const char *xml,
+ unsigned int flags);
+typedef int
(*virDrvDomainGetAutostart) (virDomainPtr domain,
int *autostart);
typedef int
@@ -419,7 +427,9 @@ struct _virDriver {
virDrvDomainDefineXML domainDefineXML;
virDrvDomainUndefine domainUndefine;
virDrvDomainAttachDevice domainAttachDevice;
+ virDrvDomainAttachDeviceFlags domainAttachDeviceFlags;
virDrvDomainDetachDevice domainDetachDevice;
+ virDrvDomainDetachDeviceFlags domainDetachDeviceFlags;
virDrvDomainGetAutostart domainGetAutostart;
virDrvDomainSetAutostart domainSetAutostart;
virDrvDomainGetSchedulerType domainGetSchedulerType;
++++++ devflag-04.patch ++++++
commit 487b2434403d520027957ed623354b398984af31
Author: Jim Fehlig
Date: Wed Jan 13 18:34:23 2010 -0700
Public API Implementation
Implementation of public API for virDomain{Attach,Detach}DeviceFlags.
V2: Don't break remote compatibility with older libvirtd
Index: libvirt-0.7.6/src/libvirt.c
===================================================================
--- libvirt-0.7.6.orig/src/libvirt.c
+++ libvirt-0.7.6/src/libvirt.c
@@ -5146,14 +5146,69 @@ virDomainAttachDevice(virDomainPtr domai
conn = domain->conn;
if (conn->driver->domainAttachDevice) {
+ int ret;
+ ret = conn->driver->domainAttachDevice (domain, xml);
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+
+error:
+ virDispatchError(domain->conn);
+ return -1;
+}
+
+/**
+ * virDomainAttachDeviceFlags:
+ * @domain: pointer to domain object
+ * @xml: pointer to XML description of one device
+ * @flags: an OR'ed set of virDomainDeviceModifyFlags
+ *
+ * Attach a virtual device to a domain, using the flags parameter
+ * to control how the device is attached. VIR_DOMAIN_DEVICE_MODIFY_CURRENT
+ * specifies that the device allocation is made based on current domain
+ * state. VIR_DOMAIN_DEVICE_MODIFY_LIVE specifies that the device shall be
+ * allocated to the active domain instance only and is not added to the
+ * persisted domain configuration. VIR_DOMAIN_DEVICE_MODIFY_CONFIG
+ * specifies that the device shall be allocated to the persisted domain
+ * configuration only. Note that the target hypervisor must return an
+ * error if unable to satisfy flags. E.g. the hypervisor driver will
+ * return failure if LIVE is specified but it only supports modifying the
+ * persisted device allocation.
+ *
+ * Returns 0 in case of success, -1 in case of failure.
+ */
+int
+virDomainAttachDeviceFlags(virDomainPtr domain,
+ const char *xml, unsigned int flags)
+{
+ virConnectPtr conn;
+ DEBUG("domain=%p, xml=%s, flags=%d", domain, xml, flags);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
+ virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+ virDispatchError(NULL);
+ return (-1);
+ }
+ if (domain->conn->flags & VIR_CONNECT_RO) {
+ virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+ goto error;
+ }
+ conn = domain->conn;
+
+ if (conn->driver->domainAttachDeviceFlags) {
int ret;
- ret = conn->driver->domainAttachDevice (domain, xml);
+ ret = conn->driver->domainAttachDeviceFlags(domain, xml, flags);
if (ret < 0)
goto error;
return ret;
}
- virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
error:
virDispatchError(domain->conn);
@@ -5192,12 +5247,67 @@ virDomainDetachDevice(virDomainPtr domai
if (conn->driver->domainDetachDevice) {
int ret;
ret = conn->driver->domainDetachDevice (domain, xml);
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+
+error:
+ virDispatchError(domain->conn);
+ return -1;
+}
+
+/**
+ * virDomainDetachDeviceFlags:
+ * @domain: pointer to domain object
+ * @xml: pointer to XML description of one device
+ * @flags: an OR'ed set of virDomainDeviceModifyFlags
+ *
+ * Detach a virtual device from a domain, using the flags parameter
+ * to control how the device is detached. VIR_DOMAIN_DEVICE_MODIFY_CURRENT
+ * specifies that the device allocation is removed based on current domain
+ * state. VIR_DOMAIN_DEVICE_MODIFY_LIVE specifies that the device shall be
+ * deallocated from the active domain instance only and is not from the
+ * persisted domain configuration. VIR_DOMAIN_DEVICE_MODIFY_CONFIG
+ * specifies that the device shall be deallocated from the persisted domain
+ * configuration only. Note that the target hypervisor must return an
+ * error if unable to satisfy flags. E.g. the hypervisor driver will
+ * return failure if LIVE is specified but it only supports removing the
+ * persisted device allocation.
+ *
+ * Returns 0 in case of success, -1 in case of failure.
+ */
+int
+virDomainDetachDeviceFlags(virDomainPtr domain,
+ const char *xml, unsigned int flags)
+{
+ virConnectPtr conn;
+ DEBUG("domain=%p, xml=%s, flags=%d", domain, xml, flags);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
+ virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+ virDispatchError(NULL);
+ return (-1);
+ }
+ if (domain->conn->flags & VIR_CONNECT_RO) {
+ virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+ goto error;
+ }
+ conn = domain->conn;
+
+ if (conn->driver->domainDetachDeviceFlags) {
+ int ret;
+ ret = conn->driver->domainDetachDeviceFlags(domain, xml, flags);
if (ret < 0)
goto error;
return ret;
}
- virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
error:
virDispatchError(domain->conn);
++++++ devflag-05.patch ++++++
commit 5ef6d92292f5c9dd27c7db2bf56f8f24b13c681b
Author: Jim Fehlig
Date: Wed Jan 13 18:39:35 2010 -0700
Wire protocol format
Definition of wire protocol format for
virDomain{Attach,Detach}DeviceFlags.
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index bed3940..98953a9 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -708,11 +708,23 @@ struct remote_domain_attach_device_args {
remote_nonnull_string xml;
};
+struct remote_domain_attach_device_flags_args {
+ remote_nonnull_domain dom;
+ remote_nonnull_string xml;
+ unsigned int flags;
+};
+
struct remote_domain_detach_device_args {
remote_nonnull_domain dom;
remote_nonnull_string xml;
};
+struct remote_domain_detach_device_flags_args {
+ remote_nonnull_domain dom;
+ remote_nonnull_string xml;
+ unsigned int flags;
+};
+
struct remote_domain_get_autostart_args {
remote_nonnull_domain dom;
};
@@ -1641,7 +1653,10 @@ enum remote_procedure {
REMOTE_PROC_INTERFACE_IS_ACTIVE = 156,
REMOTE_PROC_GET_LIB_VERSION = 157,
REMOTE_PROC_CPU_COMPARE = 158,
- REMOTE_PROC_DOMAIN_MEMORY_STATS = 159
+ REMOTE_PROC_DOMAIN_MEMORY_STATS = 159,
+ REMOTE_PROC_DOMAIN_ATTACH_DEVICE_FLAGS = 160,
+
+ REMOTE_PROC_DOMAIN_DETACH_DEVICE_FLAGS = 161
/*
* Notice how the entries are grouped in sets of 10 ?
++++++ devflag-06.patch ++++++
commit 80bfb087ae4d92b271eadaee6e08b5ea2d1b68a6
Author: Jim Fehlig
Date: Wed Jan 13 18:41:13 2010 -0700
Remote driver
Implementation of Domain{Attach,Detach}DeviceFlags in remote driver.
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index d6f5fce..eb16f62 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -3057,6 +3057,32 @@ done:
}
static int
+remoteDomainAttachDeviceFlags (virDomainPtr domain, const char *xml,
+ unsigned int flags)
+{
+ int rv = -1;
+ remote_domain_attach_device_flags_args args;
+ struct private_data *priv = domain->conn->privateData;
+
+ remoteDriverLock(priv);
+
+ make_nonnull_domain (&args.dom, domain);
+ args.xml = (char *) xml;
+ args.flags = flags;
+
+ if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_ATTACH_DEVICE_FLAGS,
+ (xdrproc_t) xdr_remote_domain_attach_device_flags_args, (char *) &args,
+ (xdrproc_t) xdr_void, (char *) NULL) == -1)
+ goto done;
+
+ rv = 0;
+
+done:
+ remoteDriverUnlock(priv);
+ return rv;
+}
+
+static int
remoteDomainDetachDevice (virDomainPtr domain, const char *xml)
{
int rv = -1;
@@ -3081,6 +3107,32 @@ done:
}
static int
+remoteDomainDetachDeviceFlags (virDomainPtr domain, const char *xml,
+ unsigned int flags)
+{
+ int rv = -1;
+ remote_domain_detach_device_flags_args args;
+ struct private_data *priv = domain->conn->privateData;
+
+ remoteDriverLock(priv);
+
+ make_nonnull_domain (&args.dom, domain);
+ args.xml = (char *) xml;
+ args.flags = flags;
+
+ if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_DETACH_DEVICE_FLAGS,
+ (xdrproc_t) xdr_remote_domain_detach_device_flags_args, (char *) &args,
+ (xdrproc_t) xdr_void, (char *) NULL) == -1)
+ goto done;
+
+ rv = 0;
+
+done:
+ remoteDriverUnlock(priv);
+ return rv;
+}
+
+static int
remoteDomainGetAutostart (virDomainPtr domain, int *autostart)
{
int rv = -1;
@@ -8894,7 +8946,9 @@ static virDriver remote_driver = {
remoteDomainDefineXML, /* domainDefineXML */
remoteDomainUndefine, /* domainUndefine */
remoteDomainAttachDevice, /* domainAttachDevice */
+ remoteDomainAttachDeviceFlags, /* domainAttachDeviceFlags */
remoteDomainDetachDevice, /* domainDetachDevice */
+ remoteDomainDetachDeviceFlags, /* domainDetachDeviceFlags */
remoteDomainGetAutostart, /* domainGetAutostart */
remoteDomainSetAutostart, /* domainSetAutostart */
remoteDomainGetSchedulerType, /* domainGetSchedulerType */
++++++ devflag-07.patch ++++++
commit 5b724a365e67d1cc2649ded76dea03836a067921
Author: Jim Fehlig
Date: Wed Jan 13 18:42:28 2010 -0700
Server side dispatcher
Server side dispatcher for Domain{Attach,Detach}DeviceFlags.
diff --git a/daemon/remote.c b/daemon/remote.c
index 299f971..bf156e4 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -890,6 +890,32 @@ remoteDispatchDomainAttachDevice (struct qemud_server *server ATTRIBUTE_UNUSED,
}
static int
+remoteDispatchDomainAttachDeviceFlags (struct qemud_server *server ATTRIBUTE_UNUSED,
+ struct qemud_client *client ATTRIBUTE_UNUSED,
+ virConnectPtr conn,
+ remote_message_header *hdr ATTRIBUTE_UNUSED,
+ remote_error *rerr,
+ remote_domain_attach_device_flags_args *args,
+ void *ret ATTRIBUTE_UNUSED)
+{
+ virDomainPtr dom;
+
+ dom = get_nonnull_domain (conn, args->dom);
+ if (dom == NULL) {
+ remoteDispatchConnError(rerr, conn);
+ return -1;
+ }
+
+ if (virDomainAttachDeviceFlags (dom, args->xml, args->flags) == -1) {
+ virDomainFree(dom);
+ remoteDispatchConnError(rerr, conn);
+ return -1;
+ }
+ virDomainFree(dom);
+ return 0;
+}
+
+static int
remoteDispatchDomainCreate (struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,
@@ -1015,6 +1041,33 @@ remoteDispatchDomainDetachDevice (struct qemud_server *server ATTRIBUTE_UNUSED,
}
static int
+remoteDispatchDomainDetachDeviceFlags (struct qemud_server *server ATTRIBUTE_UNUSED,
+ struct qemud_client *client ATTRIBUTE_UNUSED,
+ virConnectPtr conn,
+ remote_message_header *hdr ATTRIBUTE_UNUSED,
+ remote_error *rerr,
+ remote_domain_detach_device_flags_args *args,
+ void *ret ATTRIBUTE_UNUSED)
+{
+ virDomainPtr dom;
+
+ dom = get_nonnull_domain (conn, args->dom);
+ if (dom == NULL) {
+ remoteDispatchConnError(rerr, conn);
+ return -1;
+ }
+
+ if (virDomainDetachDeviceFlags (dom, args->xml, args->flags) == -1) {
+ virDomainFree(dom);
+ remoteDispatchConnError(rerr, conn);
+ return -1;
+ }
+
+ virDomainFree(dom);
+ return 0;
+}
+
+static int
remoteDispatchDomainDumpXml (struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,
++++++ devflag-08.patch ++++++
++++ 609 lines (skipped)
++++++ devflag-09.patch ++++++
commit 3a9b2b900c5dac18c9c48c40ec2dbeaa7c306a0e
Author: Jim Fehlig
Date: Wed Jan 13 18:54:58 2010 -0700
Modify virsh commands
Change all virsh commands that invoke virDomain{Attach,Detach}Device()
to use virDomain{Attach,Detach}DeviceFlags() instead.
Add a "--persistent" flag to these virsh commands, allowing user to
specify that the domain persisted config be modified as well.
V2: Only invoke virDomain{Attach,Detach}DeviceFlags() if
"--persistent" flag is specified. Otherwise invoke
virDomain{Attach,Detach}Device() to retain current behavior.
Index: libvirt-0.7.6/tools/virsh.c
===================================================================
--- libvirt-0.7.6.orig/tools/virsh.c
+++ libvirt-0.7.6/tools/virsh.c
@@ -6285,6 +6285,7 @@ static const vshCmdInfo info_attach_devi
static const vshCmdOptDef opts_attach_device[] = {
{"domain", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("domain name, id or uuid")},
{"file", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("XML file")},
+ {"persistent", VSH_OT_BOOL, 0, gettext_noop("persist device attachment")},
{NULL, 0, 0, NULL}
};
@@ -6296,6 +6297,7 @@ cmdAttachDevice(vshControl *ctl, const v
char *buffer;
int ret = TRUE;
int found;
+ unsigned int flags;
if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
return FALSE;
@@ -6315,7 +6317,14 @@ cmdAttachDevice(vshControl *ctl, const v
return FALSE;
}
- ret = virDomainAttachDevice(dom, buffer);
+ if (vshCommandOptBool(cmd, "persistent")) {
+ flags = VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
+ if (virDomainIsActive(dom) == 1)
+ flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
+ ret = virDomainAttachDeviceFlags(dom, buffer, flags);
+ } else {
+ ret = virDomainAttachDevice(dom, buffer);
+ }
VIR_FREE(buffer);
if (ret < 0) {
@@ -6343,6 +6352,7 @@ static const vshCmdInfo info_detach_devi
static const vshCmdOptDef opts_detach_device[] = {
{"domain", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("domain name, id or uuid")},
{"file", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("XML file")},
+ {"persistent", VSH_OT_BOOL, 0, gettext_noop("persist device detachment")},
{NULL, 0, 0, NULL}
};
@@ -6354,6 +6364,7 @@ cmdDetachDevice(vshControl *ctl, const v
char *buffer;
int ret = TRUE;
int found;
+ unsigned int flags;
if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
return FALSE;
@@ -6373,7 +6384,14 @@ cmdDetachDevice(vshControl *ctl, const v
return FALSE;
}
- ret = virDomainDetachDevice(dom, buffer);
+ if (vshCommandOptBool(cmd, "persistent")) {
+ flags = VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
+ if (virDomainIsActive(dom) == 1)
+ flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
+ ret = virDomainDetachDeviceFlags(dom, buffer, flags);
+ } else {
+ ret = virDomainDetachDevice(dom, buffer);
+ }
VIR_FREE(buffer);
if (ret < 0) {
@@ -6405,6 +6423,7 @@ static const vshCmdOptDef opts_attach_in
{"target", VSH_OT_DATA, 0, gettext_noop("target network name")},
{"mac", VSH_OT_DATA, 0, gettext_noop("MAC address")},
{"script", VSH_OT_DATA, 0, gettext_noop("script used to bridge network interface")},
+ {"persistent", VSH_OT_BOOL, 0, gettext_noop("persist interface attachment")},
{NULL, 0, 0, NULL}
};
@@ -6415,6 +6434,7 @@ cmdAttachInterface(vshControl *ctl, cons
char *mac, *target, *script, *type, *source;
int typ, ret = FALSE;
char *buf = NULL, *tmp = NULL;
+ unsigned int flags;
if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
goto cleanup;
@@ -6489,13 +6509,22 @@ cmdAttachInterface(vshControl *ctl, cons
if (!buf) goto cleanup;
strcat(buf, " </interface>\n");
- if (virDomainAttachDevice(dom, buf)) {
- goto cleanup;
+ if (vshCommandOptBool(cmd, "persistent")) {
+ flags = VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
+ if (virDomainIsActive(dom) == 1)
+ flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
+ ret = virDomainAttachDeviceFlags(dom, buf, flags);
} else {
- vshPrint(ctl, "%s", _("Interface attached successfully\n"));
+ ret = virDomainAttachDevice(dom, buf);
}
- ret = TRUE;
+ if (ret != 0) {
+ vshError(ctl, _("Failed to attach interface"));
+ ret = FALSE;
+ } else {
+ vshPrint(ctl, "%s", _("Interface attached successfully\n"));
+ ret = TRUE;
+ }
cleanup:
if (dom)
@@ -6518,6 +6547,7 @@ static const vshCmdOptDef opts_detach_in
{"domain", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("domain name, id or uuid")},
{"type", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("network interface type")},
{"mac", VSH_OT_STRING, 0, gettext_noop("MAC address")},
+ {"persistent", VSH_OT_BOOL, 0, gettext_noop("persist interface detachment")},
{NULL, 0, 0, NULL}
};
@@ -6534,6 +6564,7 @@ cmdDetachInterface(vshControl *ctl, cons
char *doc, *mac =NULL, *type;
char buf[64];
int i = 0, diff_mac, ret = FALSE;
+ unsigned int flags;
if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
goto cleanup;
@@ -6605,10 +6636,21 @@ cmdDetachInterface(vshControl *ctl, cons
goto cleanup;
}
- ret = virDomainDetachDevice(dom, (char *)xmlBufferContent(xml_buf));
- if (ret != 0)
+ if (vshCommandOptBool(cmd, "persistent")) {
+ flags = VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
+ if (virDomainIsActive(dom) == 1)
+ flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
+ ret = virDomainDetachDeviceFlags(dom,
+ (char *)xmlBufferContent(xml_buf),
+ flags);
+ } else {
+ ret = virDomainDetachDevice(dom, (char *)xmlBufferContent(xml_buf));
+ }
+
+ if (ret != 0) {
+ vshError(ctl, _("Failed to detach interface"));
ret = FALSE;
- else {
+ } else {
vshPrint(ctl, "%s", _("Interface detached successfully\n"));
ret = TRUE;
}
@@ -6642,6 +6684,7 @@ static const vshCmdOptDef opts_attach_di
{"subdriver", VSH_OT_STRING, 0, gettext_noop("subdriver of disk device")},
{"type", VSH_OT_STRING, 0, gettext_noop("target device type")},
{"mode", VSH_OT_STRING, 0, gettext_noop("mode of device reading and writing")},
+ {"persistent", VSH_OT_BOOL, 0, gettext_noop("persist disk attachment")},
{NULL, 0, 0, NULL}
};
@@ -6652,6 +6695,7 @@ cmdAttachDisk(vshControl *ctl, const vsh
char *source, *target, *driver, *subdriver, *type, *mode;
int isFile = 0, ret = FALSE;
char *buf = NULL, *tmp = NULL;
+ unsigned int flags;
if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
goto cleanup;
@@ -6767,12 +6811,22 @@ cmdAttachDisk(vshControl *ctl, const vsh
if (!buf) goto cleanup;
strcat(buf, " </disk>\n");
- if (virDomainAttachDevice(dom, buf))
- goto cleanup;
- else
- vshPrint(ctl, "%s", _("Disk attached successfully\n"));
+ if (vshCommandOptBool(cmd, "persistent")) {
+ flags = VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
+ if (virDomainIsActive(dom) == 1)
+ flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
+ ret = virDomainAttachDeviceFlags(dom, buf, flags);
+ } else {
+ ret = virDomainAttachDevice(dom, buf);
+ }
- ret = TRUE;
+ if (ret != 0) {
+ vshError(ctl, _("Failed to attach disk"));
+ ret = FALSE;
+ } else {
+ vshPrint(ctl, "%s", _("Disk attached successfully\n"));
+ ret = TRUE;
+ }
cleanup:
if (dom)
@@ -6794,6 +6848,7 @@ static const vshCmdInfo info_detach_disk
static const vshCmdOptDef opts_detach_disk[] = {
{"domain", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("domain name, id or uuid")},
{"target", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("target of disk device")},
+ {"persistent", VSH_OT_BOOL, 0, gettext_noop("persist disk detachment")},
{NULL, 0, 0, NULL}
};
@@ -6809,6 +6864,7 @@ cmdDetachDisk(vshControl *ctl, const vsh
virDomainPtr dom = NULL;
char *doc, *target;
int i = 0, diff_tgt, ret = FALSE;
+ unsigned int flags;
if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
goto cleanup;
@@ -6874,10 +6930,21 @@ cmdDetachDisk(vshControl *ctl, const vsh
goto cleanup;
}
- ret = virDomainDetachDevice(dom, (char *)xmlBufferContent(xml_buf));
- if (ret != 0)
+ if (vshCommandOptBool(cmd, "persistent")) {
+ flags = VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
+ if (virDomainIsActive(dom) == 1)
+ flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
+ ret = virDomainDetachDeviceFlags(dom,
+ (char *)xmlBufferContent(xml_buf),
+ flags);
+ } else {
+ ret = virDomainDetachDevice(dom, (char *)xmlBufferContent(xml_buf));
+ }
+
+ if (ret != 0) {
+ vshError(ctl, _("Failed to detach disk"));
ret = FALSE;
- else {
+ } else {
vshPrint(ctl, "%s", _("Disk detached successfully\n"));
ret = TRUE;
}
++++++ libvirt-0.7.5.tar.bz2 -> libvirt-0.7.6.tar.bz2 ++++++
++++ 849133 lines of diff (skipped)
++++++ snapshots.patch ++++++
--- /var/tmp/diff_new_pack.j8vEsu/_old 2010-02-05 14:31:26.000000000 +0100
+++ /var/tmp/diff_new_pack.j8vEsu/_new 2010-02-05 14:31:26.000000000 +0100
@@ -1,7 +1,7 @@
-Index: libvirt-0.7.5/include/libvirt/libvirt.h.in
+Index: libvirt-0.7.6/include/libvirt/libvirt.h.in
===================================================================
---- libvirt-0.7.5.orig/include/libvirt/libvirt.h.in
-+++ libvirt-0.7.5/include/libvirt/libvirt.h.in
+--- libvirt-0.7.6.orig/include/libvirt/libvirt.h.in
++++ libvirt-0.7.6/include/libvirt/libvirt.h.in
@@ -621,6 +621,21 @@ int virDomainRestore
const char *from);
@@ -24,11 +24,11 @@
* Domain core dump
*/
int virDomainCoreDump (virDomainPtr domain,
-Index: libvirt-0.7.5/src/libvirt.c
+Index: libvirt-0.7.6/src/libvirt.c
===================================================================
---- libvirt-0.7.5.orig/src/libvirt.c
-+++ libvirt-0.7.5/src/libvirt.c
-@@ -2339,6 +2339,166 @@ error:
+--- libvirt-0.7.6.orig/src/libvirt.c
++++ libvirt-0.7.6/src/libvirt.c
+@@ -2379,6 +2379,166 @@ error:
}
/**
@@ -195,10 +195,10 @@
* virDomainCoreDump:
* @domain: a domain object
* @to: path for the core file
-Index: libvirt-0.7.5/src/driver.h
+Index: libvirt-0.7.6/src/driver.h
===================================================================
---- libvirt-0.7.5.orig/src/driver.h
-+++ libvirt-0.7.5/src/driver.h
+--- libvirt-0.7.6.orig/src/driver.h
++++ libvirt-0.7.6/src/driver.h
@@ -136,6 +136,21 @@ typedef int
(*virDrvDomainRestore) (virConnectPtr conn,
const char *from);
@@ -221,7 +221,7 @@
(*virDrvDomainCoreDump) (virDomainPtr domain,
const char *to,
int flags);
-@@ -448,6 +463,11 @@ struct _virDriver {
+@@ -458,6 +473,11 @@ struct _virDriver {
virDrvDomainIsActive domainIsActive;
virDrvDomainIsPersistent domainIsPersistent;
virDrvCPUCompare cpuCompare;
@@ -233,10 +233,10 @@
};
typedef int
-Index: libvirt-0.7.5/src/xen/xen_driver.c
+Index: libvirt-0.7.6/src/xen/xen_driver.c
===================================================================
---- libvirt-0.7.5.orig/src/xen/xen_driver.c
-+++ libvirt-0.7.5/src/xen/xen_driver.c
+--- libvirt-0.7.6.orig/src/xen/xen_driver.c
++++ libvirt-0.7.6/src/xen/xen_driver.c
@@ -1052,6 +1052,81 @@ xenUnifiedDomainRestore (virConnectPtr c
}
@@ -319,7 +319,7 @@
xenUnifiedDomainCoreDump (virDomainPtr dom, const char *to, int flags)
{
GET_PRIVATE(dom->conn);
-@@ -1862,6 +1937,11 @@ static virDriver xenUnifiedDriver = {
+@@ -1904,6 +1979,11 @@ static virDriver xenUnifiedDriver = {
xenUnifiedDomainIsActive,
xenUnifiedDomainisPersistent,
NULL, /* cpuCompare */
@@ -331,10 +331,10 @@
};
/**
-Index: libvirt-0.7.5/src/xen/xen_driver.h
+Index: libvirt-0.7.6/src/xen/xen_driver.h
===================================================================
---- libvirt-0.7.5.orig/src/xen/xen_driver.h
-+++ libvirt-0.7.5/src/xen/xen_driver.h
+--- libvirt-0.7.6.orig/src/xen/xen_driver.h
++++ libvirt-0.7.6/src/xen/xen_driver.h
@@ -100,6 +100,11 @@ struct xenUnifiedDriver {
virDrvDomainGetSchedulerType domainGetSchedulerType;
virDrvDomainGetSchedulerParameters domainGetSchedulerParameters;
@@ -347,10 +347,10 @@
};
typedef struct xenXMConfCache *xenXMConfCachePtr;
-Index: libvirt-0.7.5/src/xen/xend_internal.c
+Index: libvirt-0.7.6/src/xen/xend_internal.c
===================================================================
---- libvirt-0.7.5.orig/src/xen/xend_internal.c
-+++ libvirt-0.7.5/src/xen/xend_internal.c
+--- libvirt-0.7.6.orig/src/xen/xend_internal.c
++++ libvirt-0.7.6/src/xen/xend_internal.c
@@ -53,6 +53,12 @@
#ifndef PROXY
@@ -364,7 +364,7 @@
/*
* The number of Xen scheduler parameters
*/
-@@ -3282,6 +3288,87 @@ xenDaemonDomainRestore(virConnectPtr con
+@@ -3284,6 +3290,87 @@ xenDaemonDomainRestore(virConnectPtr con
}
return xend_op(conn, "", "op", "restore", "file", filename, NULL);
}
@@ -452,7 +452,7 @@
#endif /* !PROXY */
/**
-@@ -5165,6 +5252,11 @@ struct xenUnifiedDriver xenDaemonDriver
+@@ -5235,6 +5322,11 @@ struct xenUnifiedDriver xenDaemonDriver
xenDaemonGetSchedulerType, /* domainGetSchedulerType */
xenDaemonGetSchedulerParameters, /* domainGetSchedulerParameters */
xenDaemonSetSchedulerParameters, /* domainSetSchedulerParameters */
@@ -464,10 +464,10 @@
};
/************************************************************************
-Index: libvirt-0.7.5/src/xen/proxy_internal.c
+Index: libvirt-0.7.6/src/xen/proxy_internal.c
===================================================================
---- libvirt-0.7.5.orig/src/xen/proxy_internal.c
-+++ libvirt-0.7.5/src/xen/proxy_internal.c
+--- libvirt-0.7.6.orig/src/xen/proxy_internal.c
++++ libvirt-0.7.6/src/xen/proxy_internal.c
@@ -83,6 +83,11 @@ struct xenUnifiedDriver xenProxyDriver =
NULL, /* domainGetSchedulerType */
NULL, /* domainGetSchedulerParameters */
@@ -480,10 +480,10 @@
};
-Index: libvirt-0.7.5/src/xen/xen_hypervisor.c
+Index: libvirt-0.7.6/src/xen/xen_hypervisor.c
===================================================================
---- libvirt-0.7.5.orig/src/xen/xen_hypervisor.c
-+++ libvirt-0.7.5/src/xen/xen_hypervisor.c
+--- libvirt-0.7.6.orig/src/xen/xen_hypervisor.c
++++ libvirt-0.7.6/src/xen/xen_hypervisor.c
@@ -800,6 +800,11 @@ struct xenUnifiedDriver xenHypervisorDri
xenHypervisorGetSchedulerType, /* domainGetSchedulerType */
xenHypervisorGetSchedulerParameters, /* domainGetSchedulerParameters */
@@ -496,11 +496,11 @@
};
#endif /* !PROXY */
-Index: libvirt-0.7.5/src/xen/xm_internal.c
+Index: libvirt-0.7.6/src/xen/xm_internal.c
===================================================================
---- libvirt-0.7.5.orig/src/xen/xm_internal.c
-+++ libvirt-0.7.5/src/xen/xm_internal.c
-@@ -116,6 +116,11 @@ struct xenUnifiedDriver xenXMDriver = {
+--- libvirt-0.7.6.orig/src/xen/xm_internal.c
++++ libvirt-0.7.6/src/xen/xm_internal.c
+@@ -118,6 +118,11 @@ struct xenUnifiedDriver xenXMDriver = {
NULL, /* domainGetSchedulerType */
NULL, /* domainGetSchedulerParameters */
NULL, /* domainSetSchedulerParameters */
@@ -512,10 +512,10 @@
};
#define xenXMError(conn, code, fmt...) \
-Index: libvirt-0.7.5/src/xen/xs_internal.c
+Index: libvirt-0.7.6/src/xen/xs_internal.c
===================================================================
---- libvirt-0.7.5.orig/src/xen/xs_internal.c
-+++ libvirt-0.7.5/src/xen/xs_internal.c
+--- libvirt-0.7.6.orig/src/xen/xs_internal.c
++++ libvirt-0.7.6/src/xen/xs_internal.c
@@ -83,6 +83,11 @@ struct xenUnifiedDriver xenStoreDriver =
NULL, /* domainGetSchedulerType */
NULL, /* domainGetSchedulerParameters */
@@ -528,11 +528,11 @@
};
#endif /* ! PROXY */
-Index: libvirt-0.7.5/tools/virsh.c
+Index: libvirt-0.7.6/tools/virsh.c
===================================================================
---- libvirt-0.7.5.orig/tools/virsh.c
-+++ libvirt-0.7.5/tools/virsh.c
-@@ -1233,6 +1233,188 @@ cmdSave(vshControl *ctl, const vshCmd *c
+--- libvirt-0.7.6.orig/tools/virsh.c
++++ libvirt-0.7.6/tools/virsh.c
+@@ -1237,6 +1237,188 @@ cmdSave(vshControl *ctl, const vshCmd *c
}
/*
@@ -721,7 +721,7 @@
* "schedinfo" command
*/
static const vshCmdInfo info_schedinfo[] = {
-@@ -7431,6 +7613,12 @@ static const vshCmdDef commands[] = {
+@@ -7502,6 +7684,12 @@ static const vshCmdDef commands[] = {
{"undefine", cmdUndefine, opts_undefine, info_undefine},
{"uri", cmdURI, NULL, info_uri},
@@ -734,11 +734,11 @@
{"vol-create", cmdVolCreate, opts_vol_create, info_vol_create},
{"vol-create-from", cmdVolCreateFrom, opts_vol_create_from, info_vol_create_from},
{"vol-create-as", cmdVolCreateAs, opts_vol_create_as, info_vol_create_as},
-Index: libvirt-0.7.5/src/lxc/lxc_driver.c
+Index: libvirt-0.7.6/src/lxc/lxc_driver.c
===================================================================
---- libvirt-0.7.5.orig/src/lxc/lxc_driver.c
-+++ libvirt-0.7.5/src/lxc/lxc_driver.c
-@@ -2456,6 +2456,11 @@ static virDriver lxcDriver = {
+--- libvirt-0.7.6.orig/src/lxc/lxc_driver.c
++++ libvirt-0.7.6/src/lxc/lxc_driver.c
+@@ -2458,6 +2458,11 @@ static virDriver lxcDriver = {
lxcDomainIsActive,
lxcDomainIsPersistent,
NULL, /* cpuCompare */
@@ -750,11 +750,11 @@
};
static virStateDriver lxcStateDriver = {
-Index: libvirt-0.7.5/src/openvz/openvz_driver.c
+Index: libvirt-0.7.6/src/openvz/openvz_driver.c
===================================================================
---- libvirt-0.7.5.orig/src/openvz/openvz_driver.c
-+++ libvirt-0.7.5/src/openvz/openvz_driver.c
-@@ -1535,6 +1535,11 @@ static virDriver openvzDriver = {
+--- libvirt-0.7.6.orig/src/openvz/openvz_driver.c
++++ libvirt-0.7.6/src/openvz/openvz_driver.c
+@@ -1537,6 +1537,11 @@ static virDriver openvzDriver = {
openvzDomainIsActive,
openvzDomainIsPersistent,
NULL, /* cpuCompare */
@@ -766,11 +766,11 @@
};
int openvzRegister(void) {
-Index: libvirt-0.7.5/src/qemu/qemu_driver.c
+Index: libvirt-0.7.6/src/qemu/qemu_driver.c
===================================================================
---- libvirt-0.7.5.orig/src/qemu/qemu_driver.c
-+++ libvirt-0.7.5/src/qemu/qemu_driver.c
-@@ -7990,6 +7990,11 @@ static virDriver qemuDriver = {
+--- libvirt-0.7.6.orig/src/qemu/qemu_driver.c
++++ libvirt-0.7.6/src/qemu/qemu_driver.c
+@@ -8632,6 +8632,11 @@ static virDriver qemuDriver = {
qemuDomainIsActive,
qemuDomainIsPersistent,
qemuCPUCompare, /* cpuCompare */
@@ -782,11 +782,11 @@
};
-Index: libvirt-0.7.5/src/esx/esx_driver.c
+Index: libvirt-0.7.6/src/esx/esx_driver.c
===================================================================
---- libvirt-0.7.5.orig/src/esx/esx_driver.c
-+++ libvirt-0.7.5/src/esx/esx_driver.c
-@@ -3455,6 +3455,11 @@ static virDriver esxDriver = {
+--- libvirt-0.7.6.orig/src/esx/esx_driver.c
++++ libvirt-0.7.6/src/esx/esx_driver.c
+@@ -3403,6 +3403,11 @@ static virDriver esxDriver = {
esxDomainIsActive, /* domainIsActive */
esxDomainIsPersistent, /* domainIsPersistent */
NULL, /* cpuCompare */
@@ -798,11 +798,11 @@
};
-Index: libvirt-0.7.5/src/test/test_driver.c
+Index: libvirt-0.7.6/src/test/test_driver.c
===================================================================
---- libvirt-0.7.5.orig/src/test/test_driver.c
-+++ libvirt-0.7.5/src/test/test_driver.c
-@@ -5238,6 +5238,11 @@ static virDriver testDriver = {
+--- libvirt-0.7.6.orig/src/test/test_driver.c
++++ libvirt-0.7.6/src/test/test_driver.c
+@@ -5240,6 +5240,11 @@ static virDriver testDriver = {
testDomainIsActive, /* domainIsActive */
testDomainIsPersistent, /* domainIsPersistent */
NULL, /* cpuCompare */
@@ -814,11 +814,11 @@
};
static virNetworkDriver testNetworkDriver = {
-Index: libvirt-0.7.5/src/uml/uml_driver.c
+Index: libvirt-0.7.6/src/uml/uml_driver.c
===================================================================
---- libvirt-0.7.5.orig/src/uml/uml_driver.c
-+++ libvirt-0.7.5/src/uml/uml_driver.c
-@@ -1924,6 +1924,11 @@ static virDriver umlDriver = {
+--- libvirt-0.7.6.orig/src/uml/uml_driver.c
++++ libvirt-0.7.6/src/uml/uml_driver.c
+@@ -1926,6 +1926,11 @@ static virDriver umlDriver = {
umlDomainIsActive,
umlDomainIsPersistent,
NULL, /* cpuCompare */
@@ -830,11 +830,11 @@
};
-Index: libvirt-0.7.5/src/vbox/vbox_tmpl.c
+Index: libvirt-0.7.6/src/vbox/vbox_tmpl.c
===================================================================
---- libvirt-0.7.5.orig/src/vbox/vbox_tmpl.c
-+++ libvirt-0.7.5/src/vbox/vbox_tmpl.c
-@@ -7051,6 +7051,11 @@ virDriver NAME(Driver) = {
+--- libvirt-0.7.6.orig/src/vbox/vbox_tmpl.c
++++ libvirt-0.7.6/src/vbox/vbox_tmpl.c
+@@ -7059,6 +7059,11 @@ virDriver NAME(Driver) = {
vboxDomainIsActive,
vboxDomainIsPersistent,
NULL, /* cpuCompare */
@@ -846,11 +846,11 @@
};
virNetworkDriver NAME(NetworkDriver) = {
-Index: libvirt-0.7.5/src/opennebula/one_driver.c
+Index: libvirt-0.7.6/src/opennebula/one_driver.c
===================================================================
---- libvirt-0.7.5.orig/src/opennebula/one_driver.c
-+++ libvirt-0.7.5/src/opennebula/one_driver.c
-@@ -783,6 +783,11 @@ static virDriver oneDriver = {
+--- libvirt-0.7.6.orig/src/opennebula/one_driver.c
++++ libvirt-0.7.6/src/opennebula/one_driver.c
+@@ -785,6 +785,11 @@ static virDriver oneDriver = {
NULL, /* domainIsActive */
NULL, /* domainIsPersistent */
NULL, /* cpuCompare */
@@ -862,11 +862,11 @@
};
static virStateDriver oneStateDriver = {
-Index: libvirt-0.7.5/src/phyp/phyp_driver.c
+Index: libvirt-0.7.6/src/phyp/phyp_driver.c
===================================================================
---- libvirt-0.7.5.orig/src/phyp/phyp_driver.c
-+++ libvirt-0.7.5/src/phyp/phyp_driver.c
-@@ -1651,6 +1651,11 @@ virDriver phypDriver = {
+--- libvirt-0.7.6.orig/src/phyp/phyp_driver.c
++++ libvirt-0.7.6/src/phyp/phyp_driver.c
+@@ -1653,6 +1653,11 @@ virDriver phypDriver = {
NULL, /* domainIsActive */
NULL, /* domainIsPersistent */
NULL, /* cpuCompare */
@@ -878,11 +878,11 @@
};
int
-Index: libvirt-0.7.5/src/remote/remote_driver.c
+Index: libvirt-0.7.6/src/remote/remote_driver.c
===================================================================
---- libvirt-0.7.5.orig/src/remote/remote_driver.c
-+++ libvirt-0.7.5/src/remote/remote_driver.c
-@@ -8940,6 +8940,11 @@ static virDriver remote_driver = {
+--- libvirt-0.7.6.orig/src/remote/remote_driver.c
++++ libvirt-0.7.6/src/remote/remote_driver.c
+@@ -8994,6 +8994,11 @@ static virDriver remote_driver = {
remoteDomainIsActive, /* domainIsActive */
remoteDomainIsPersistent, /* domainIsPersistent */
remoteCPUCompare, /* cpuCompare */
@@ -894,10 +894,10 @@
};
static virNetworkDriver network_driver = {
-Index: libvirt-0.7.5/docs/libvirt-api.xml
+Index: libvirt-0.7.6/docs/libvirt-api.xml
===================================================================
---- libvirt-0.7.5.orig/docs/libvirt-api.xml
-+++ libvirt-0.7.5/docs/libvirt-api.xml
+--- libvirt-0.7.6.orig/docs/libvirt-api.xml
++++ libvirt-0.7.6/docs/libvirt-api.xml
@@ -293,6 +293,11 @@
<exports symbol='virDomainSetVcpus' type='function'/>
<exports symbol='virDomainShutdown' type='function'/>
@@ -947,10 +947,10 @@
<function name='virDomainUndefine' file='libvirt' module='libvirt'>
<info><![CDATA[Undefine a domain but does not stop it if it is running]]></info>
<return type='int' info='0 in case of success, -1 in case of error'/>
-Index: libvirt-0.7.5/src/libvirt_public.syms
+Index: libvirt-0.7.6/src/libvirt_public.syms
===================================================================
---- libvirt-0.7.5.orig/src/libvirt_public.syms
-+++ libvirt-0.7.5/src/libvirt_public.syms
+--- libvirt-0.7.6.orig/src/libvirt_public.syms
++++ libvirt-0.7.6/src/libvirt_public.syms
@@ -215,6 +215,11 @@ LIBVIRT_0.4.2 {
LIBVIRT_0.4.5 {
global:
@@ -963,11 +963,11 @@
} LIBVIRT_0.4.2;
LIBVIRT_0.5.0 {
-Index: libvirt-0.7.5/python/generator.py
+Index: libvirt-0.7.6/python/generator.py
===================================================================
---- libvirt-0.7.5.orig/python/generator.py
-+++ libvirt-0.7.5/python/generator.py
-@@ -288,6 +288,7 @@ skip_impl = (
+--- libvirt-0.7.6.orig/python/generator.py
++++ libvirt-0.7.6/python/generator.py
+@@ -289,6 +289,7 @@ skip_impl = (
'virDomainSetSchedulerParameters',
'virDomainGetVcpus',
'virDomainPinVcpu',
@@ -975,11 +975,11 @@
'virSecretGetValue',
'virSecretSetValue',
'virSecretGetUUID',
-Index: libvirt-0.7.5/python/libvirt-override.c
+Index: libvirt-0.7.6/python/libvirt-override.c
===================================================================
---- libvirt-0.7.5.orig/python/libvirt-override.c
-+++ libvirt-0.7.5/python/libvirt-override.c
-@@ -1516,6 +1516,34 @@ libvirt_virStoragePoolGetInfo(PyObject *
+--- libvirt-0.7.6.orig/python/libvirt-override.c
++++ libvirt-0.7.6/python/libvirt-override.c
+@@ -1542,6 +1542,34 @@ libvirt_virStoragePoolGetInfo(PyObject *
return(py_retval);
}
@@ -1014,7 +1014,7 @@
static PyObject *
libvirt_virStorageVolGetInfo(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
-@@ -2690,6 +2718,7 @@ static PyMethodDef libvirtMethods[] = {
+@@ -2717,6 +2745,7 @@ static PyMethodDef libvirtMethods[] = {
{(char *) "virStoragePoolGetAutostart", libvirt_virStoragePoolGetAutostart, METH_VARARGS, NULL},
{(char *) "virStoragePoolListVolumes", libvirt_virStoragePoolListVolumes, METH_VARARGS, NULL},
{(char *) "virStoragePoolGetInfo", libvirt_virStoragePoolGetInfo, METH_VARARGS, NULL},
@@ -1022,11 +1022,11 @@
{(char *) "virStorageVolGetInfo", libvirt_virStorageVolGetInfo, METH_VARARGS, NULL},
{(char *) "virStoragePoolGetUUID", libvirt_virStoragePoolGetUUID, METH_VARARGS, NULL},
{(char *) "virStoragePoolGetUUIDString", libvirt_virStoragePoolGetUUIDString, METH_VARARGS, NULL},
-Index: libvirt-0.7.5/python/libvirt-override-api.xml
+Index: libvirt-0.7.6/python/libvirt-override-api.xml
===================================================================
---- libvirt-0.7.5.orig/python/libvirt-override-api.xml
-+++ libvirt-0.7.5/python/libvirt-override-api.xml
-@@ -145,6 +145,11 @@
+--- libvirt-0.7.6.orig/python/libvirt-override-api.xml
++++ libvirt-0.7.6/python/libvirt-override-api.xml
+@@ -150,6 +150,11 @@
<arg name='domain' type='virDomainPtr' info='pointer to domain object'/>
<arg name='params' type='virSchedParameterPtr' info='pointer to scheduler parameter objects'/>
</function>
@@ -1038,10 +1038,10 @@
<function name='virConnectListStoragePools' file='python'>
<info>list the storage pools, stores the pointers to the names in @names</info>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
-Index: libvirt-0.7.5/src/xen/xen_inotify.c
+Index: libvirt-0.7.6/src/xen/xen_inotify.c
===================================================================
---- libvirt-0.7.5.orig/src/xen/xen_inotify.c
-+++ libvirt-0.7.5/src/xen/xen_inotify.c
+--- libvirt-0.7.6.orig/src/xen/xen_inotify.c
++++ libvirt-0.7.6/src/xen/xen_inotify.c
@@ -86,6 +86,11 @@ struct xenUnifiedDriver xenInotifyDriver
NULL, /* domainGetSchedulerType */
NULL, /* domainGetSchedulerParameters */
++++++ xen-name-for-devid.patch ++++++
commit 7906a668fa8d5c21cc729db8a13b08e3dd1d241f
Author: Jim Fehlig
Date: Wed Jan 27 16:11:41 2010 -0700
Do not search xenstore for disk device IDs
Disk devices can be referenced by name in Xen, e.g. when modifying
their configuration or remvoving them. As such, don't search
xenstore for a device ID corresponding to the disk device. Instead,
search the disks contained in the domain definition and use the
disk's target name if found.
This approach allows removing a disk when domain is inactive. We
obviously can't search xenstore when the domain is inactive.
Index: libvirt-0.7.6/src/xen/xend_internal.c
===================================================================
--- libvirt-0.7.6.orig/src/xen/xend_internal.c
+++ libvirt-0.7.6/src/xen/xend_internal.c
@@ -93,6 +93,7 @@ xenDaemonFormatSxprOnePCI(virConnectPtr
static int
virDomainXMLDevID(virDomainPtr domain,
+ virDomainDefPtr domDef,
virDomainDeviceDefPtr dev,
char *class,
char *ref,
@@ -4215,7 +4216,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr
sexpr = virBufferContentAndReset(&buf);
- if (virDomainXMLDevID(domain, dev, class, ref, sizeof(ref))) {
+ if (virDomainXMLDevID(domain, def, dev, class, ref, sizeof(ref))) {
/* device doesn't exist, define it */
ret = xend_op(domain->conn, domain->name, "op", "device_create",
"config", sexpr, NULL);
@@ -4310,7 +4311,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr
def, xml, VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
- if (virDomainXMLDevID(domain, dev, class, ref, sizeof(ref)))
+ if (virDomainXMLDevID(domain, def, dev, class, ref, sizeof(ref)))
goto cleanup;
if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
@@ -6052,6 +6053,7 @@ error:
*/
static int
virDomainXMLDevID(virDomainPtr domain,
+ virDomainDefPtr domDef,
virDomainDeviceDefPtr dev,
char *class,
char *ref,
@@ -6060,27 +6062,33 @@ virDomainXMLDevID(virDomainPtr domain,
xenUnifiedPrivatePtr priv = domain->conn->privateData;
char *xref;
char *tmp;
+ unsigned int i;
+ virDomainDiskDefPtr disk;
if (dev->type == VIR_DOMAIN_DEVICE_DISK) {
+ if (dev->data.disk->dst == NULL)
+ return -1;
if (dev->data.disk->driverName &&
STREQ(dev->data.disk->driverName, "tap"))
strcpy(class, "tap");
else
strcpy(class, "vbd");
- if (dev->data.disk->dst == NULL)
- return -1;
- xenUnifiedLock(priv);
- xref = xenStoreDomainGetDiskID(domain->conn, domain->id,
- dev->data.disk->dst);
- xenUnifiedUnlock(priv);
- if (xref == NULL)
- return -1;
-
- tmp = virStrcpy(ref, xref, ref_len);
- VIR_FREE(xref);
- if (tmp == NULL)
- return -1;
+ /* For disks, the device name can be used directly.
+ * If disk device exists in domain definintion,
+ * copy it to ref and return success.
+ */
+ for (i = 0; i < domDef->ndisks; i++) {
+ disk = domDef->disks[i];
+ if (STREQ(dev->data.disk->dst, disk->dst)) {
+ tmp = virStrcpy(ref, disk->dst, ref_len);
+ if (tmp == NULL)
+ return -1;
+ else
+ return 0;
+ }
+ }
+ return -1;
} else if (dev->type == VIR_DOMAIN_DEVICE_NET) {
char mac[30];
virDomainNetDefPtr def = dev->data.net;
++++++ xen-pv-cdrom.patch ++++++
--- /var/tmp/diff_new_pack.j8vEsu/_old 2010-02-05 14:31:26.000000000 +0100
+++ /var/tmp/diff_new_pack.j8vEsu/_new 2010-02-05 14:31:26.000000000 +0100
@@ -1,8 +1,8 @@
-Index: libvirt-0.7.5/src/xen/xend_internal.c
+Index: libvirt-0.7.6/src/xen/xend_internal.c
===================================================================
---- libvirt-0.7.5.orig/src/xen/xend_internal.c
-+++ libvirt-0.7.5/src/xen/xend_internal.c
-@@ -5409,7 +5409,10 @@ xenDaemonFormatSxprDisk(virConnectPtr co
+--- libvirt-0.7.6.orig/src/xen/xend_internal.c
++++ libvirt-0.7.6/src/xen/xend_internal.c
+@@ -5479,7 +5479,10 @@ xenDaemonFormatSxprDisk(virConnectPtr co
} else if (def->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
virBufferVSprintf(buf, "(dev '%s:cdrom')", def->dst);
} else {
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org