[libvirt] [PATCH v2 0/8] Add support for fetching statistics of completed jobs
by Jiri Denemark
Using virDomainGetJobStats, we can monitor running jobs but sometimes it
may be useful to get statistics about a job that already finished, for
example, to get the final amount of data transferred during migration or
to get an idea about total downtime. This is what the following patches
are about.
Version 2:
- changed according to John's review (see individual patches for
details)
Jiri Denemark (8):
Refactor job statistics
qemu: Avoid incrementing jobs_queued if virTimeMillisNow fails
Add support for fetching statistics of completed jobs
qemu: Silence coverity on optional migration stats
virsh: Add support for completed job stats
qemu: Transfer migration statistics to destination
qemu: Recompute downtime and total time when migration completes
qemu: Transfer recomputed stats back to source
include/libvirt/libvirt.h.in | 11 ++
src/libvirt.c | 11 +-
src/qemu/qemu_domain.c | 189 ++++++++++++++++++++++++++-
src/qemu/qemu_domain.h | 32 ++++-
src/qemu/qemu_driver.c | 130 ++++--------------
src/qemu/qemu_migration.c | 304 ++++++++++++++++++++++++++++++++++++-------
src/qemu/qemu_monitor_json.c | 10 +-
src/qemu/qemu_process.c | 9 +-
tools/virsh-domain.c | 27 +++-
tools/virsh.pod | 10 +-
10 files changed, 557 insertions(+), 176 deletions(-)
--
2.1.0
8 years, 7 months
[libvirt] [PATCH] conf: Skip generating random MAC in DetachDevice xml
by Kothapally Madhu Pavan
When we try to detach a network device without specifying
the mac address, random mac address is generated. As the
generated mac address will not be available in the running
vm, detaching device will fail erroring out "error:
operation failed: no device matching mac address
xx:xx:xx:xx:xx:xx found".
Signed-off-by: Kothapally Madhu Pavan <kmp(a)linux.vnet.ibm.com>
---
src/conf/domain_conf.c | 4 ++++
src/conf/domain_conf.h | 3 +++
src/libxl/libxl_driver.c | 12 ++++++------
src/lxc/lxc_driver.c | 7 ++++---
src/qemu/qemu_driver.c | 2 ++
src/uml/uml_driver.c | 6 ++++--
src/vbox/vbox_common.c | 6 ++++--
src/vz/vz_driver.c | 4 +++-
src/xen/xend_internal.c | 6 ++++--
src/xen/xm_internal.c | 8 ++++----
10 files changed, 38 insertions(+), 20 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 28248c8..512d877 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8784,6 +8784,10 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
(const char *)macaddr);
goto error;
}
+ } else if (flags & VIR_DOMAIN_DEF_PARSE_SKIP_GENERATE_MACADDR) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("mac address not specified in the device xml"));
+ goto error;
} else {
virDomainNetGenerateMAC(xmlopt, &def->mac);
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 1986f53..74692f1 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2679,6 +2679,9 @@ typedef enum {
VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS = 1 << 8,
/* allow updates in post parse callback that would break ABI otherwise */
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE = 1 << 9,
+ /* don't generate random mac address when a network device without mac address
+ * is detached */
+ VIR_DOMAIN_DEF_PARSE_SKIP_GENERATE_MACADDR = 1 << 10,
} virDomainDefParseFlags;
typedef enum {
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index bf97c9c..507edcf 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3726,6 +3726,8 @@ libxlDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
virDomainDefPtr vmdef = NULL;
virDomainDeviceDefPtr dev = NULL;
int ret = -1;
+ unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
+ VIR_DOMAIN_DEF_PARSE_SKIP_GENERATE_MACADDR;
virCheckFlags(VIR_DOMAIN_DEVICE_MODIFY_LIVE |
VIR_DOMAIN_DEVICE_MODIFY_CONFIG, -1);
@@ -3743,9 +3745,8 @@ libxlDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
goto endjob;
if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
- if (!(dev = virDomainDeviceDefParse(xml, vm->def,
- cfg->caps, driver->xmlopt,
- VIR_DOMAIN_DEF_PARSE_INACTIVE)))
+ if (!(dev = virDomainDeviceDefParse(xml, vm->def, cfg->caps,
+ driver->xmlopt, parse_flags)))
goto endjob;
/* Make a copy for updated domain. */
@@ -3760,9 +3761,8 @@ libxlDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
if (flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE) {
/* If dev exists it was created to modify the domain config. Free it. */
virDomainDeviceDefFree(dev);
- if (!(dev = virDomainDeviceDefParse(xml, vm->def,
- cfg->caps, driver->xmlopt,
- VIR_DOMAIN_DEF_PARSE_INACTIVE)))
+ if (!(dev = virDomainDeviceDefParse(xml, vm->def, cfg->caps,
+ driver->xmlopt, parse_flags)))
goto endjob;
if (libxlDomainDetachDeviceLive(driver, vm, dev) < 0)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index ef48812..23f0d80 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -5196,6 +5196,8 @@ static int lxcDomainDetachDeviceFlags(virDomainPtr dom,
virDomainDefPtr vmdef = NULL;
virDomainDeviceDefPtr dev = NULL, dev_copy = NULL;
int ret = -1;
+ unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
+ VIR_DOMAIN_DEF_PARSE_SKIP_GENERATE_MACADDR;
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
@@ -5213,9 +5215,8 @@ static int lxcDomainDetachDeviceFlags(virDomainPtr dom,
if (!(caps = virLXCDriverGetCapabilities(driver, false)))
goto cleanup;
- dev = dev_copy = virDomainDeviceDefParse(xml, vm->def,
- caps, driver->xmlopt,
- VIR_DOMAIN_DEF_PARSE_INACTIVE);
+ dev = dev_copy = virDomainDeviceDefParse(xml, vm->def, caps,
+ driver->xmlopt, parse_flags);
if (dev == NULL)
goto cleanup;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 862c44c..df85fd5 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8486,6 +8486,8 @@ static int qemuDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
!(flags & VIR_DOMAIN_AFFECT_LIVE))
parse_flags |= VIR_DOMAIN_DEF_PARSE_INACTIVE;
+ parse_flags |= VIR_DOMAIN_DEF_PARSE_SKIP_GENERATE_MACADDR;
+
dev = dev_copy = virDomainDeviceDefParse(xml, vm->def,
caps, driver->xmlopt,
parse_flags);
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 84e1df8..c232435 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -2346,6 +2346,8 @@ static int umlDomainDetachDevice(virDomainPtr dom, const char *xml)
virDomainObjPtr vm;
virDomainDeviceDefPtr dev = NULL;
int ret = -1;
+ unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
+ VIR_DOMAIN_DEF_PARSE_SKIP_GENERATE_MACADDR;
umlDriverLock(driver);
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
@@ -2366,8 +2368,8 @@ static int umlDomainDetachDevice(virDomainPtr dom, const char *xml)
goto cleanup;
}
- dev = virDomainDeviceDefParse(xml, vm->def, driver->caps, driver->xmlopt,
- VIR_DOMAIN_DEF_PARSE_INACTIVE);
+ dev = virDomainDeviceDefParse(xml, vm->def, driver->caps,
+ driver->xmlopt, parse_flags);
if (dev == NULL)
goto cleanup;
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 0cead10..4c539ef 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -4228,6 +4228,8 @@ static int vboxDomainDetachDevice(virDomainPtr dom, const char *xml)
virDomainDeviceDefPtr dev = NULL;
nsresult rc;
int ret = -1;
+ unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
+ VIR_DOMAIN_DEF_PARSE_SKIP_GENERATE_MACADDR;
if (!data->vboxObj)
return ret;
@@ -4238,8 +4240,8 @@ static int vboxDomainDetachDevice(virDomainPtr dom, const char *xml)
def->os.type = VIR_DOMAIN_OSTYPE_HVM;
- dev = virDomainDeviceDefParse(xml, def, data->caps, data->xmlopt,
- VIR_DOMAIN_DEF_PARSE_INACTIVE);
+ dev = virDomainDeviceDefParse(xml, def, data->caps,
+ data->xmlopt, parse_flags);
if (dev == NULL)
goto cleanup;
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index ffa6f45..f5f5395 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -1172,6 +1172,8 @@ static int vzDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
vzConnPtr privconn = dom->conn->privateData;
virDomainDeviceDefPtr dev = NULL;
virDomainObjPtr privdom = NULL;
+ unsigned int parse_flags = VIR_DOMAIN_XML_INACTIVE |
+ VIR_DOMAIN_DEF_PARSE_SKIP_GENERATE_MACADDR;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_AFFECT_CONFIG, -1);
@@ -1184,7 +1186,7 @@ static int vzDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
goto cleanup;
dev = virDomainDeviceDefParse(xml, privdom->def, privconn->driver->caps,
- privconn->driver->xmlopt, VIR_DOMAIN_XML_INACTIVE);
+ privconn->driver->xmlopt, parse_flags);
if (dev == NULL)
goto cleanup;
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index cf7cdd0..216c4f4 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -2327,6 +2327,8 @@ xenDaemonDetachDeviceFlags(virConnectPtr conn,
int ret = -1;
char *xendev = NULL;
virBuffer buf = VIR_BUFFER_INITIALIZER;
+ unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
+ VIR_DOMAIN_DEF_PARSE_SKIP_GENERATE_MACADDR;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1);
@@ -2354,8 +2356,8 @@ xenDaemonDetachDeviceFlags(virConnectPtr conn,
NULL)))
goto cleanup;
- if (!(dev = virDomainDeviceDefParse(xml, def, priv->caps, priv->xmlopt,
- VIR_DOMAIN_DEF_PARSE_INACTIVE)))
+ if (!(dev = virDomainDeviceDefParse(xml, def, priv->caps,
+ priv->xmlopt, parse_flags);
goto cleanup;
if (virDomainXMLDevID(conn, minidef, dev, class, ref, sizeof(ref)))
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index ef1a460..ae142a3 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -1322,6 +1322,8 @@ xenXMDomainDetachDeviceFlags(virConnectPtr conn,
int ret = -1;
size_t i;
xenUnifiedPrivatePtr priv = conn->privateData;
+ unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
+ VIR_DOMAIN_DEF_PARSE_SKIP_GENERATE_MACADDR;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1);
@@ -1340,10 +1342,8 @@ xenXMDomainDetachDeviceFlags(virConnectPtr conn,
goto cleanup;
def = entry->def;
- if (!(dev = virDomainDeviceDefParse(xml, entry->def,
- priv->caps,
- priv->xmlopt,
- VIR_DOMAIN_DEF_PARSE_INACTIVE)))
+ if (!(dev = virDomainDeviceDefParse(xml, entry->def, priv->caps,
+ priv->xmlopt, parse_flags)))
goto cleanup;
switch (dev->type) {
8 years, 7 months
[libvirt] [PATCH 0/4] rpc: Fix fd leak and potential crash
by Cole Robinson
Patch 1 was already sent, I'd like to get it in for the release,
it should be quite safe.
Remaining patches centralize some cleanup code and fix a potential
crasher, but since it should be rare I'd like to wait till after
the release.
Previous thread: http://www.redhat.com/archives/libvir-list/2016-April/msg01618.html
Ben Gray (1):
rpc: Don't leak fd via CreateXMLWithFiles
Cole Robinson (3):
rpc: Add virNetMessageClearPayload
rpc: Clear more in virNetMessageClearPayload
rpc: use virNetMessageClearPayload in client
src/libvirt_remote.syms | 1 +
src/rpc/virnetclient.c | 5 +----
src/rpc/virnetmessage.c | 28 +++++++++++++++++++---------
src/rpc/virnetmessage.h | 2 ++
4 files changed, 23 insertions(+), 13 deletions(-)
--
2.7.4
8 years, 7 months
[libvirt] [PATCH v2] bhyve: implement domainShutdown
by Roman Bogorodskiy
Bhyve supports ACPI shutdown by issuing SIGTERM signal to the bhyve
process. Add the bhyveDomainShutdown() function and
virBhyveProcessShutdown() helper function that just sends SIGTERM to
VM's bhyve process. If a guest supports ACPI shutdown then process
will be terminated and this event will be noticed by the bhyve monitor
code that will handle setting proper status and clean up VM's resources.
Also, remove usage of virProcessKillPainfully() from domainDestroy.
First, it sends SIGTERM to the process that actually triggers ACPI reset
and that's not we want to do. Second, we're doing bhyvectl --destroy
later and it kills bhyve process, so there's no need to manually kill
it.
---
Changes from v1:
- Sending SIGKILL dropped completely for destroy due to reasons described
in the commit message. This is mainly based on the results of this (ongoing)
discussion:
https://lists.freebsd.org/pipermail/freebsd-virtualization/2016-April/004...
src/bhyve/bhyve_driver.c | 27 +++++++++++++++++++++++++++
src/bhyve/bhyve_process.c | 39 +++++++++++++++++++++++++++------------
src/bhyve/bhyve_process.h | 2 ++
3 files changed, 56 insertions(+), 12 deletions(-)
diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 5526bb0..4fc504e 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -1018,6 +1018,32 @@ bhyveDomainDestroy(virDomainPtr dom)
}
static int
+bhyveDomainShutdown(virDomainPtr dom)
+{
+ virDomainObjPtr vm;
+ int ret = -1;
+
+ if (!(vm = bhyveDomObjFromDomain(dom)))
+ goto cleanup;
+
+ if (virDomainShutdownEnsureACL(dom->conn, vm->def) < 0)
+ goto cleanup;
+
+ if (!virDomainObjIsActive(vm)) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("Domain is not running"));
+ goto cleanup;
+ }
+
+ ret = virBhyveProcessShutdown(vm);
+
+ cleanup:
+ if (vm)
+ virObjectUnlock(vm);
+ return ret;
+}
+
+static int
bhyveDomainOpenConsole(virDomainPtr dom,
const char *dev_name ATTRIBUTE_UNUSED,
virStreamPtr st,
@@ -1502,6 +1528,7 @@ static virHypervisorDriver bhyveHypervisorDriver = {
.domainCreateWithFlags = bhyveDomainCreateWithFlags, /* 1.2.3 */
.domainCreateXML = bhyveDomainCreateXML, /* 1.2.4 */
.domainDestroy = bhyveDomainDestroy, /* 1.2.2 */
+ .domainShutdown = bhyveDomainShutdown, /* 1.3.3 */
.domainLookupByUUID = bhyveDomainLookupByUUID, /* 1.2.2 */
.domainLookupByName = bhyveDomainLookupByName, /* 1.2.2 */
.domainLookupByID = bhyveDomainLookupByID, /* 1.2.3 */
diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c
index 14588a9..e42ed74 100644
--- a/src/bhyve/bhyve_process.c
+++ b/src/bhyve/bhyve_process.c
@@ -281,23 +281,15 @@ virBhyveProcessStop(bhyveConnPtr driver,
if ((priv != NULL) && (priv->mon != NULL))
bhyveMonitorClose(priv->mon);
- /* First, try to kill 'bhyve' process */
- if (virProcessKillPainfully(vm->pid, true) != 0)
- VIR_WARN("Failed to gracefully stop bhyve VM '%s' (pid: %d)",
- vm->def->name,
- (int)vm->pid);
-
- /* Cleanup network interfaces */
- bhyveNetCleanup(vm);
-
- /* No matter if shutdown was successful or not, we
- * need to unload the VM */
if (!(cmd = virBhyveProcessBuildDestroyCmd(driver, vm->def)))
- goto cleanup;
+ return -1;
if (virCommandRun(cmd, NULL) < 0)
goto cleanup;
+ /* Cleanup network interfaces */
+ bhyveNetCleanup(vm);
+
ret = 0;
virCloseCallbacksUnset(driver->closeCallbacks, vm,
@@ -317,6 +309,29 @@ virBhyveProcessStop(bhyveConnPtr driver,
}
int
+virBhyveProcessShutdown(virDomainObjPtr vm)
+{
+ if (vm->pid <= 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Invalid PID %d for VM"),
+ (int)vm->pid);
+ return -1;
+ }
+
+ /* Bhyve tries to perform ACPI shutdown when it receives
+ * SIGTERM signal. So we just issue SIGTERM here and rely
+ * on the bhyve monitor to clean things up if process disappears.
+ */
+ if (virProcessKill(vm->pid, SIGTERM) != 0) {
+ VIR_WARN("Failed to terminate bhyve process for VM '%s': %s",
+ vm->def->name, virGetLastErrorMessage());
+ return -1;
+ }
+
+ return 0;
+}
+
+int
virBhyveGetDomainTotalCpuStats(virDomainObjPtr vm,
unsigned long long *cpustats)
{
diff --git a/src/bhyve/bhyve_process.h b/src/bhyve/bhyve_process.h
index cfa80af..ebabe17 100644
--- a/src/bhyve/bhyve_process.h
+++ b/src/bhyve/bhyve_process.h
@@ -34,6 +34,8 @@ int virBhyveProcessStop(bhyveConnPtr driver,
virDomainObjPtr vm,
virDomainShutoffReason reason);
+int virBhyveProcessShutdown(virDomainObjPtr vm);
+
int virBhyveGetDomainTotalCpuStats(virDomainObjPtr vm,
unsigned long long *cpustats);
--
2.7.4
8 years, 7 months
[libvirt] [PATCH 0/3] Admin API: Add support for client disconnect
by Erik Skultety
This series adds a simple support for a client force disconnect. As with the
series about client identity retrieval, this series is rebased on listing
clients due to some gendispatch stuff needed in all of them. To test it,
you checkout my remote branch
https://github.com/eskultety/libvirt/tree/list-clients-info-disconnect
Erik Skultety (3):
admin: Introduce virAdmServerLookupClient
admin: Introduce virAdmClientClose API
virt-admin: Introduce client-disconnect command
daemon/admin.c | 6 ++++
daemon/admin_server.c | 19 +++++++++++
daemon/admin_server.h | 7 ++++
include/libvirt/libvirt-admin.h | 7 ++++
include/libvirt/virterror.h | 1 +
src/admin/admin_protocol.x | 27 +++++++++++++++-
src/admin/admin_remote.c | 10 ++++++
src/admin_protocol-structs | 14 ++++++++
src/libvirt-admin.c | 66 +++++++++++++++++++++++++++++++++++++
src/libvirt_admin_private.syms | 3 ++
src/libvirt_admin_public.syms | 2 ++
src/rpc/virnetserver.c | 23 +++++++++++++
src/rpc/virnetserver.h | 3 ++
src/util/virerror.c | 6 ++++
tools/virt-admin.c | 72 +++++++++++++++++++++++++++++++++++++++++
tools/virt-admin.pod | 16 +++++++++
16 files changed, 281 insertions(+), 1 deletion(-)
--
2.4.11
8 years, 7 months
[libvirt] RFC filesystem pool proposal description.
by Olga Krishtal
In this proposal description we would like to introduce a separate pool
type:fspool. Fspool provides and manages filesystems.
Below are listed possible examples of fspool, depending on source type:
volume, directory or network.
Volume fspool uses storage pool volume to reside upon.
<fspool type = 'volume'>
<name>fspool</name>
<uuid>cb07b799-8e03-485c-aaa0-7c88f60b37b0</uuid>
<allocation>0</allocation>
<capacity>0<capacity>
<source>
<pool ='pool name'/>
<volume='volume name'/>
<format type = 'ext4'/> (ext4, zfs - depending on type of volume that is used as a backend).
<source/>
<target>
<path>/path/to/fspool</path>
<permissions>
<mode>0777</mode>
<owner>0</owner>
<group>0</group>
</permissions>
</target>
</fspool>
Directory fspool represents a host directory:
<fspool type = 'dir'>
<name>fspool</name>
<uuid>cb07b799-8e03-485c-aaa0-7c88f60b37b0</uuid>
<target>
<path>/path/to/fspool/root</path>
<permissions>
<mode>0777</mode>
<owner>0</owner>
<group>0</group>
</permissions>
</target>
</fspool>
Network fspool is similar to previous one, except it is remote:
<fspool type='network'>
<name>fspool</name>
<uuid>b27a72b5-a92e-4e58-a172-a80ba73b30fe</uuid>
<source>
<host name='X.X.X.X'/> - if the pool is not on the host
<dir path='some/directory/exposed/to/our/host'/>
</source>
<target>
<path>/fspool</path>
</target>
</fspool>
basic API for fspool management:
fspool-define
fspool-build
fspool-start
fspool-stop
fspool-destroy
fspool-undefine
Fspools are divided into fs items. Single item is a directory inside the fspool root directory.
Fs item example is listed below:
<fs>
<name>item</name>
<allocation>0</allocation>
<capacity>0<capacity>
<source>fspool='name'</source>
<target>
<path>/fspool</path>
</target>
<permissions>
<mode>0777</mode>
<owner>0</owner>
<group>0</group>
<cgroups> Limits</cgroups>
</permissions>
</fs>
- allocation/capacity - is omitted when fspools type is directory.
- target path is a path to fs item from the fspool root. If it is not
present then the content of item is placed directly in fspool root.
- cgroups can be used in order to manipulate space usage politics.
Fs items will be manipulated via fs API:
fs-define
fs-delete
fs-list
In addition to containers use-cases, fspools are also useful for libvirt itself - they will help store and
easily manage some internal metadata, such as snapshots or internal connection driver information (logs, domain configurations, etc).
Please, take a look and share your opinion.
Olga
8 years, 7 months
[libvirt] [PATCH 0/7] Admin API: Add support for client identity info retrieval
by Erik Skultety
This series adds support for client identity retrieval, i.e. information like
remote IP (if connected remotely), uid,gid,pid, as well as username if
connected locally and also information regarding authentication (if used).
The series is rebased on the listing clients series, because it relies on the
gendispatch stuff, so for testing purposes checkout my remote branch
https://github.com/eskultety/libvirt/tree/list-clients-info-disconnect which
also covers the next series about client disconnect.
Erik Skultety (7):
admin: Introduce virAdmServerLookupClient
admin: include: Introduce some client's identity related typed params
macros
virnetsocket: Provide socket address format in a more standard form
virneserverclient: Introduce virNetServerClientHasSASLSession
virnetserverclient: Add an internal method to retrieve client's
identity
admin: Introduce virAdmClientGetInfo API
virt-admin: Introduce command client-info
daemon/admin.c | 59 ++++++++++++++++++
daemon/admin_server.c | 102 +++++++++++++++++++++++++++++++
daemon/admin_server.h | 9 +++
daemon/remote.c | 13 +++-
include/libvirt/libvirt-admin.h | 130 ++++++++++++++++++++++++++++++++++++++++
include/libvirt/virterror.h | 1 +
src/admin/admin_protocol.x | 34 ++++++++++-
src/admin/admin_remote.c | 47 +++++++++++++++
src/admin_protocol-structs | 20 +++++++
src/libvirt-admin.c | 75 +++++++++++++++++++++++
src/libvirt_admin_private.syms | 4 ++
src/libvirt_admin_public.syms | 2 +
src/remote/remote_driver.c | 7 +++
src/rpc/virnetclient.c | 10 ++++
src/rpc/virnetclient.h | 2 +
src/rpc/virnetserver.c | 23 +++++++
src/rpc/virnetserver.h | 3 +
src/rpc/virnetserverclient.c | 48 +++++++++++++++
src/rpc/virnetserverclient.h | 6 ++
src/rpc/virnetsocket.c | 17 +++++-
src/rpc/virnetsocket.h | 2 +
src/util/virerror.c | 6 ++
src/util/virsocketaddr.c | 24 ++++++--
tests/virnetsockettest.c | 10 ++--
tools/virt-admin.c | 91 ++++++++++++++++++++++++++++
25 files changed, 731 insertions(+), 14 deletions(-)
--
2.4.11
8 years, 7 months
[libvirt] [PATCH v2] send default USB controller in xml to destination during migration
by Shivaprasad G Bhat
The default USB controller is not sent to destination as the older versions
of libvirt(0.9.4 or earlier as I see in commit log of 409b5f54) didn't
support them. For some archs where the support started much later can
safely send the USB controllers without this worry. So, send the controller
to destination for all archs except x86. Moreover this is not very applicable
to x86 as the USB controller has model ich9_ehci1 on q35 and for pc-i440fx,
there cant be any slots before USB as it is fixed on slot 1.
The patch fixes a bug that, if the USB controller happens to occupy
a slot after disks/interfaces and one of them is hot-unplugged, then
the default USB controller added on destination takes the smallest slot
number and that would lead to savestate mismatch and migration
failure. Seen and verified on PPC64.
Signed-off-by: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
---
src/qemu/qemu_domain.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 6262bfe..963ff35 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2599,7 +2599,11 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
usb = def->controllers[i];
}
}
- if (usb && usb->idx == 0 && usb->model == -1) {
+ /* The original purpose of the check was the migration compatibility
+ * with libvirt <= 0.9.4. Limitation doesn't apply to other archs
+ * and can cause problems on PPC64.
+ */
+ if (ARCH_IS_X86(def->os.arch) && usb && usb->idx == 0 && usb->model == -1) {
VIR_DEBUG("Removing default USB controller from domain '%s'"
" for migration compatibility", def->name);
toremove++;
8 years, 7 months
[libvirt] [PATCH] dist: ln(1) is not guaranteed to have a '-f' option
by Andrea Bolognani
According to the autoconf manual, using '$(LN_S) -f' is not
portable; remove the target explicitly beforehand to work around
this limitation.
Adjust some slightly awkward indentation while at it.
---
src/Makefile.am | 3 ++-
tools/Makefile.am | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index c639e37..b71e694 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3079,7 +3079,8 @@ if WITH_NETWORK
$(DESTDIR)$(confdir)/qemu/networks/default.xml && \
rm $(DESTDIR)$(confdir)/qemu/networks/default.xml.t; }
( cd $(DESTDIR)$(confdir)/qemu/networks/autostart && \
- $(LN_S) -f ../default.xml default.xml )
+ rm -f default.xml && \
+ $(LN_S) ../default.xml default.xml )
endif WITH_NETWORK
uninstall-local:: uninstall-init uninstall-systemd
diff --git a/tools/Makefile.am b/tools/Makefile.am
index e963b91..c5a6a0d 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -424,7 +424,8 @@ NSS_SO_VER = 1
install-exec-hook:
( cd $(DESTDIR)$(libdir) && \
- $(LN_S) -f libnss_libvirt.so.$(NSS_SO_VER) nss_libvirt.so.$(NSS_SO_VER) )
+ rm -f nss_libvirt.so.$(NSS_SO_VER) && \
+ $(LN_S) libnss_libvirt.so.$(NSS_SO_VER) nss_libvirt.so.$(NSS_SO_VER) )
uninstall-local:
-rm -f $(DESTDIR)$(libdir)/nss_libvirt.so.$(NSS_SO_VER)
--
2.5.5
8 years, 7 months
[libvirt] [PATCH 0/3] qemu: support configuring usb3 controller port count
by Cole Robinson
This adds support for configuring the amount of usb ports on
qemu's usb3 controller. The default port count is 4 which is
kind of low, and when virt-manager starts using usb3 by default
we will likely up the port count to something like 8.
Cole Robinson (3):
qemu: parse: Use virControllerDefNew
qemu: caps: introduce QEMU_CAPS_NEC_USB_XHCI_PORTS
qemu: support configuring usb3 controller port count
docs/formatdomain.html.in | 6 ++--
docs/schemas/domaincommon.rng | 8 ++++-
src/conf/domain_conf.c | 41 ++++++++++++++--------
src/conf/domain_conf.h | 9 +++++
src/libvirt_private.syms | 1 +
src/qemu/qemu_capabilities.c | 7 ++++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 13 +++++++
src/qemu/qemu_parse_command.c | 8 ++---
tests/qemucapabilitiesdata/caps_1.2.2-1.replies | 11 ++++++
tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 29 +++++++++++++++
tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 29 +++++++++++++++
tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 29 +++++++++++++++
tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 29 +++++++++++++++
tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 29 +++++++++++++++
tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.1.1-1.replies | 33 +++++++++++++++++
tests/qemucapabilitiesdata/caps_2.4.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.4.0-1.replies | 41 ++++++++++++++++++++++
tests/qemucapabilitiesdata/caps_2.5.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.5.0-1.replies | 41 ++++++++++++++++++++++
tests/qemucapabilitiesdata/caps_2.6.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.6.0-1.replies | 41 ++++++++++++++++++++++
.../qemuxml2argv-usb-controller-xhci.args | 22 ++++++++++++
.../qemuxml2argv-usb-controller-xhci.xml | 16 +++++++++
tests/qemuxml2argvtest.c | 3 ++
31 files changed, 434 insertions(+), 22 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-controller-xhci.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-controller-xhci.xml
--
2.7.4
8 years, 7 months