[libvirt] [PATCH v3 0/2] bhyve: add volumes support
by Roman Bogorodskiy
Changes from v1:
- Add volume support for the bhyveload command as
well to allow booting from a volume
Changes from v2:
- Move disk source pool translation to storage/storage_driver.c
instead of conf/domain_conf.c, because having that
in conf/domain_conf.c requires pulling storage driver that
is not needed for many drivers
Roman Bogorodskiy (2):
conf: make disk source pool translation generic
bhyve: add volumes support
src/bhyve/bhyve_command.c | 17 ++-
src/bhyve/bhyve_command.h | 7 +-
src/bhyve/bhyve_driver.c | 4 +-
src/bhyve/bhyve_process.c | 4 +-
src/qemu/qemu_conf.c | 243 ------------------------------------------
src/qemu/qemu_conf.h | 3 -
src/qemu/qemu_driver.c | 6 +-
src/qemu/qemu_hotplug.c | 3 +-
src/qemu/qemu_process.c | 5 +-
src/storage/storage_driver.c | 245 +++++++++++++++++++++++++++++++++++++++++++
src/storage/storage_driver.h | 4 +
tests/Makefile.am | 3 +
tests/bhyvexml2argvtest.c | 5 +-
tests/qemuxml2argvtest.c | 3 +-
14 files changed, 287 insertions(+), 265 deletions(-)
--
1.9.0
10 years, 3 months
[libvirt] [RFC] Introduce API for retrieving bulk domain stats
by Peter Krempa
I'd like to propose a (hopefully) fairly future-proof API to retrieve
various statistics for domains.
The motivation is that management layers that use libvirt usually poll
libvirt for statistics using various split up APIs we currently provide.
To get all the necessary stuff, the mgmt app need to issue Ndomains *
Napis calls and cope with the various returned formats. The APIs I'm
wanting to introduce here will:
1) Return data in a format that we can expand in the future and is
hierarchical. For starters I'll use XML, with possible expansion to
something like JSON if it will be favourable for a consumer (switchable
by a flag)
2) Stats for multiple (all) domains can be queried at once and are
returned in one call. This will allow to decrease the overhead necessary
to issue multiple calls per domain multiplied by the count of domains.
3) Selectable (bit mask) fields in the returned format. This will allow
to retrieve only specific stats according to the APPs need.
The returned XML will have the following format:
<domainstats>
<domain name='vm1'>
<state>running</state>
<cpus>
<cpu id='1'>
<state>running</state>
<time>10001231231</time>
</cpu>
<cpu id='2'>
<state>offline</state>
<time>10001231231</time>
<cpu>
</cpus>
...
</domain>
<domain name='vm2'>
<state>paused</state>
...
</domain>
<domain name='vm3'>
<state>running</state>
...
</domain>
</domainstats>
Initially the implementation will introduce the option to retrieve
block, interface and cpu stats with the possibility to add more in the
future.
The stats groups will be enabled using a bit field @stats passed as the
function argument. A few groups for inspiration:
VIR_DOMAIN_STATS_CPU
VIR_DOMAIN_STATS_BLOCK
VIR_DOMAIN_STATS_INTERFACE
As this is a first draft and dump of my mind on this subject it may be
a bit rough, so suggestions are welcome.
Thanks for looking.
Peter
---
include/libvirt/libvirt.h.in | 12 ++++
src/driver.h | 8 +++
src/libvirt.c | 127 +++++++++++++++++++++++++++++++++++++++++++
src/libvirt_public.syms | 7 +++
4 files changed, 154 insertions(+)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index 47ea695..72ab617 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -2501,6 +2501,18 @@ int virDomainDetachDeviceFlags(virDomainPtr domain,
int virDomainUpdateDeviceFlags(virDomainPtr domain,
const char *xml, unsigned int flags);
+char *virConnectGetAllDomainStats(virConnectPtr conn,
+ unsigned int stats,
+ unsigned int flags);
+
+char *virDomainListGetStats(virDomainPtr *doms,
+ unsigned int stats,
+ unsigned int flags);
+
+char *virDomainGetStats(virDomainPtr dom,
+ unsigned int stats,
+ unsigned int flags);
+
/*
* BlockJob API
*/
diff --git a/src/driver.h b/src/driver.h
index 158df79..2650e90 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -1191,6 +1191,13 @@ typedef int
unsigned int flags);
+typedef char *
+(*virDrvDomainListGetStats)(virConnectPtr conn,
+ virDomainPtr *doms,
+ unsigned int ndoms,
+ unsigned int stats,
+ unsigned int flags);
+
typedef struct _virDriver virDriver;
typedef virDriver *virDriverPtr;
@@ -1411,6 +1418,7 @@ struct _virDriver {
virDrvDomainSetTime domainSetTime;
virDrvNodeGetFreePages nodeGetFreePages;
virDrvConnectGetDomainCapabilities connectGetDomainCapabilities;
+ virDrvDomainListGetStats domainListGetStats;
};
diff --git a/src/libvirt.c b/src/libvirt.c
index 992e4f2..10e0b70 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -21341,3 +21341,130 @@ virConnectGetDomainCapabilities(virConnectPtr conn,
virDispatchError(conn);
return NULL;
}
+
+
+/**
+ * virConnectGetAllDomainStats:
+ * @conn: pointer to the hypervisor connection
+ * @stats: stats to return, binary OR of virDomainStats
+ * @flags: extra flags; not used yet, so callers should always pass 0
+ *
+ * Report statistics of various parameters for a running VM.
+ *
+ * Returns an XML containing the requested stats or NULL on error. The
+ * returned string shall be freed by the caller.
+ */
+char *
+virConnectGetAllDomainStats(virConnectPtr conn,
+ unsigned int stats,
+ unsigned int flags)
+{
+ char *ret = NULL;
+
+ VIR_DEBUG("conn=%p, stats=0x%x, flags=0x%x",
+ conn, stats, flags);
+
+ virResetLastError();
+
+ virCheckConnectReturn(conn, NULL);
+
+ if (!conn->driver->domainListGetStats) {
+ virReportUnsupportedError();
+ goto cleanup;
+ }
+
+ ret = conn->driver->domainListGetStats(conn, NULL, 0, stats, flags);
+
+ cleanup:
+ if (!ret)
+ virDispatchError(conn);
+
+ return ret;
+}
+
+
+/**
+ * virDomainListGetStats:
+ * @doms: NULL terminated array of domains
+ * @stats: stats to return, binary OR of virDomainStats
+ * @flags: extra flags; not used yet, so callers should always pass 0
+ *
+ * Report statistics of various parameters for a running VM.
+ *
+ * Returns an XML containing the requested stats or NULL on error. The
+ * returned string shall be freed by the caller.
+ */
+char *
+virDomainListGetStats(virDomainPtr *doms,
+ unsigned int stats,
+ unsigned int flags)
+{
+ virConnectPtr conn = NULL;
+ virDomainPtr *nextdom = doms;
+ unsigned int ndoms = 0;
+ char *ret = NULL;
+
+ VIR_DEBUG("doms=%p, stats=0x%x, flags=0x%x",
+ doms, stats, flags);
+
+ virResetLastError();
+
+ if (!*doms) {
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("doms array in %s must contain at leas one domain"),
+ __FUNCTION__);
+ goto cleanup;
+ }
+
+ conn = doms[0]->conn;
+
+ if (!conn->driver->domainListGetStats) {
+ virReportUnsupportedError();
+ goto cleanup;
+ }
+
+ while (*(++nextdom)) {
+ virDomainPtr dom = *nextdom;
+
+ virCheckDomainGoto(dom, cleanup);
+
+ if (dom->conn != conn) {
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("domains in 'doms' array must belong to a "
+ "single connection in %s"), __FUNCTION__);
+ goto cleanup;
+ }
+
+ ndoms++;
+ }
+
+ ret = conn->driver->domainListGetStats(conn, doms, ndoms, stats, flags);
+
+ cleanup:
+ if (!ret)
+ virDispatchError(conn);
+ return ret;
+}
+
+
+/**
+ * virDomainGetStats:
+ * @dom: a domain object
+ * @stats: stats to return, binary OR of virDomainStats
+ * @flags: extra flags; not used yet, so callers should always pass 0
+ *
+ * Convenience wrapper to get stats for a single domain.
+ * See virDomainListGetStats for more info.
+ *
+ * Returns an XML containing the requested stats or NULL on error. The
+ * returned string shall be freed by the caller.
+ */
+char *
+virDomainGetStats(virDomainPtr dom,
+ unsigned int stats,
+ unsigned int flags)
+{
+ virDomainPtr doms[2] = {dom, NULL};
+
+ return virDomainListGetStats(doms, stats, flags);
+}
diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms
index 9f4016a..5bb25ab 100644
--- a/src/libvirt_public.syms
+++ b/src/libvirt_public.syms
@@ -670,4 +670,11 @@ LIBVIRT_1.2.7 {
virConnectGetDomainCapabilities;
} LIBVIRT_1.2.6;
+LIBVIRT_1.2.8 {
+ global:
+ virDomainListGetStats;
+ virDomainGetStats;
+ virConnectGetAllDomainStats;
+} LIBVIRT_1.2.7;
+
# .... define new API here using predicted next version number ....
--
2.0.2
10 years, 3 months
[libvirt] [libvirt-glib] [PATCH 0/4] Add more snapshot API
by mail@baedert.org
From: Timm Bäder <mail(a)baedert.org>
The following 4 patches add some more snapshot API to libvirt-glib.
I wasn't sure where to put _revert_to really, the libvirt API sounds
like it belongs into GVirDomain (i.e. gvir_domain_revert_to_snapshot),
but virDomainRevertToSnapshot only takes a pointer to the snapshot.
The implementation of gvir_domain_snapshot_set_config does not allow
renaming of the snapshot as that will just create a new snapshot in
any case (should that by documented?). But it looks like the same
is true for gvir_domain_set_config?
Timm Bäder (4):
GVirDomainSnapshot: Add _is_current
GVirDomainSnapshot: Add _revert_to
GVirDomainSnapshot: Add _set_config
GVirDomain: Add _has_current_snapshot
libvirt-gobject/libvirt-gobject-domain-snapshot.c | 120 ++++++++++++++++++++++
libvirt-gobject/libvirt-gobject-domain-snapshot.h | 26 +++++
libvirt-gobject/libvirt-gobject-domain.c | 30 ++++++
libvirt-gobject/libvirt-gobject-domain.h | 3 +
libvirt-gobject/libvirt-gobject.sym | 4 +
5 files changed, 183 insertions(+)
--
2.0.3
10 years, 3 months
[libvirt] [RFC] powerpc : Add support for VM in compat mode
by Prerna Saxena
PowerISA allows processors to run VMs in binary compatibility ("compat")
mode supporting an older version of ISA.
Eg,in compatibility mode, a POWER8 host can run a "Power7" VM,conforming
to PowerISA v2.06, while a POWER7 host can run a "POWER6" VM, conforming
to PowerISA v2.05.
QEMU has recently added support to explicitly denote a VM running in
compatibility mode through commit 6d9412ea. Now, a "compat" mode VM can
be run by invoking this qemu commandline on a POWER8 host:
-cpu host,compat=power7
as against the older specification of "-cpu power7".
However, running in compatibility mode is not identical to running
natively on an older processor. Hence the virtualization stack needs to
explicitly provide for a compat-mode VM.
This patch allows libvirt to extend the "fallback" semantics of cpu model to
describe this new mode for PowerKVM guests.
Additionally with the new scheme of things, qemu doesn't provide a way to query
for the supported compat models and models returned when querying with '-cpu ?'
are no longer valid. Hence removing the check cpuModelIsAllowed() for now.
When a user wants to request a power7 vm to run in compatibility mode on
a Power8 host, this can be described in XML as follows :
<cpu mode='custom' match='exact'>
<model fallback='compat'>power7</model>
</cpu>
An alternative approach could be to leave the libvirt XML intact, and merely
change the backend qemu command generation when the VM-requested cpu
does not match the host processor.
Looking forward to suggestions on how this can best be implemented..
Signed-off-by: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
Signed-off-by: Pradipta Kr. Banerjee <bpradip(a)in.ibm.com>
Signed-off-by: Prerna Saxena <prerna(a)linux.vnet.ibm.com>
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index ebdaa19..2f41bd7 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -47,7 +47,8 @@ VIR_ENUM_IMPL(virCPUMatch, VIR_CPU_MATCH_LAST,
VIR_ENUM_IMPL(virCPUFallback, VIR_CPU_FALLBACK_LAST,
"allow",
- "forbid")
+ "forbid",
+ "compat")
VIR_ENUM_IMPL(virCPUFeaturePolicy, VIR_CPU_FEATURE_LAST,
"force",
diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h
index 8c932ce..50354f2 100644
--- a/src/conf/cpu_conf.h
+++ b/src/conf/cpu_conf.h
@@ -65,6 +65,7 @@ VIR_ENUM_DECL(virCPUMatch)
typedef enum {
VIR_CPU_FALLBACK_ALLOW,
VIR_CPU_FALLBACK_FORBID,
+ VIR_CPU_FALLBACK_COMPAT,
VIR_CPU_FALLBACK_LAST
} virCPUFallback;
diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c
index b220448..218c013 100644
--- a/src/cpu/cpu_powerpc.c
+++ b/src/cpu/cpu_powerpc.c
@@ -457,8 +457,8 @@ ppcCompare(virCPUDefPtr host,
static int
ppcDecode(virCPUDefPtr cpu,
const virCPUData *data,
- const char **models,
- unsigned int nmodels,
+ const char **models ATTRIBUTE_UNUSED,
+ unsigned int nmodels ATTRIBUTE_UNUSED,
const char *preferred ATTRIBUTE_UNUSED,
unsigned int flags)
{
@@ -478,13 +478,6 @@ ppcDecode(virCPUDefPtr cpu,
goto cleanup;
}
- if (!cpuModelIsAllowed(model->name, models, nmodels)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("CPU model %s is not supported by hypervisor"),
- model->name);
- goto cleanup;
- }
-
if (VIR_STRDUP(cpu->model, model->name) < 0 ||
(model->vendor && VIR_STRDUP(cpu->vendor, model->vendor->name) < 0)) {
goto cleanup;
@@ -498,7 +491,6 @@ ppcDecode(virCPUDefPtr cpu,
return ret;
}
-
static void
ppcDataFree(virCPUDataPtr data)
{
@@ -561,8 +553,8 @@ ppcUpdate(virCPUDefPtr guest,
static virCPUDefPtr
ppcBaseline(virCPUDefPtr *cpus,
unsigned int ncpus,
- const char **models,
- unsigned int nmodels,
+ const char **models ATTRIBUTE_UNUSED,
+ unsigned int nmodels ATTRIBUTE_UNUSED,
unsigned int flags)
{
struct ppc_map *map = NULL;
@@ -582,13 +574,6 @@ ppcBaseline(virCPUDefPtr *cpus,
goto error;
}
- if (!cpuModelIsAllowed(model->name, models, nmodels)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("CPU model %s is not supported by hypervisor"),
- model->name);
- goto error;
- }
-
for (i = 0; i < ncpus; i++) {
const struct ppc_vendor *vnd;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 1d5bce6..94e9b78 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6176,7 +6176,9 @@ qemuBuildCpuArgStr(virQEMUDriverPtr driver,
*hasHwVirt = hasSVM > 0 ? true : false;
}
- if (cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH) {
+ if ((cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH) ||
+ ((cpu->mode == VIR_CPU_MODE_HOST_MODEL) &&
+ (def->os.arch == VIR_ARCH_PPC64))) {
const char *mode = virCPUModeTypeToString(cpu->mode);
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_HOST)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -6208,7 +6210,13 @@ qemuBuildCpuArgStr(virQEMUDriverPtr driver,
if (cpuDecode(guest, data, (const char **)cpus, ncpus, preferred) < 0)
goto cleanup;
- virBufferAdd(&buf, guest->model, -1);
+ if (def->os.arch == VIR_ARCH_PPC64 &&
+ cpu->fallback == VIR_CPU_FALLBACK_COMPAT) {
+ virBufferAddLit(&buf, "host");
+ virBufferAsprintf(&buf, ",compat=%s", guest->model);
+ } else
+ virBufferAdd(&buf, guest->model, -1);
+
if (guest->vendor_id)
virBufferAsprintf(&buf, ",vendor=%s", guest->vendor_id);
for (i = 0; i < guest->nfeatures; i++) {
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
10 years, 3 months
[libvirt] [PATCH] virsh: Fix comment for net-undefine
by Li Yang
net-undefine doesn't only undefine an inactive network,
but also an active network(persistent), it just cannot
undefine a transient network.
Signed-off-by: Li Yang <liyang.fnst(a)cn.fujitsu.com>
---
tools/virsh-network.c | 4 ++--
tools/virsh.pod | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/tools/virsh-network.c b/tools/virsh-network.c
index fc08b09..578abe0 100644
--- a/tools/virsh-network.c
+++ b/tools/virsh-network.c
@@ -798,10 +798,10 @@ cmdNetworkStart(vshControl *ctl, const vshCmd *cmd)
*/
static const vshCmdInfo info_network_undefine[] = {
{.name = "help",
- .data = N_("undefine an inactive network")
+ .data = N_("undefine a persistent network")
},
{.name = "desc",
- .data = N_("Undefine the configuration for an inactive network.")
+ .data = N_("Undefine the configuration for a persistent network.")
},
{.name = NULL}
};
diff --git a/tools/virsh.pod b/tools/virsh.pod
index f07deec..9efb920 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -2557,7 +2557,8 @@ Start a (previously defined) inactive network.
=item B<net-undefine> I<network>
-Undefine the configuration for an inactive network.
+Undefine the configuration for a persistent network. If the network is active,
+make it to be transient.
=item B<net-uuid> I<network-name>
--
1.7.1
10 years, 3 months
[libvirt] [PATCH] driver: Move virDrvNetworkGetDHCPLeases to the appropriate section
by Peter Krempa
The prototype was along with domain API prototypes instead of network
API ones.
---
Notes:
Pushed as trivial.
src/driver.h | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/driver.h b/src/driver.h
index c769675..158df79 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -1190,11 +1190,6 @@ typedef int
unsigned long long *counts,
unsigned int flags);
-typedef int
-(*virDrvNetworkGetDHCPLeases)(virNetworkPtr network,
- const char *mac,
- virNetworkDHCPLeasePtr **leases,
- unsigned int flags);
typedef struct _virDriver virDriver;
typedef virDriver *virDriverPtr;
@@ -1509,7 +1504,11 @@ typedef int
typedef int
(*virDrvNetworkIsPersistent)(virNetworkPtr net);
-
+typedef int
+(*virDrvNetworkGetDHCPLeases)(virNetworkPtr network,
+ const char *mac,
+ virNetworkDHCPLeasePtr **leases,
+ unsigned int flags);
typedef struct _virNetworkDriver virNetworkDriver;
typedef virNetworkDriver *virNetworkDriverPtr;
--
2.0.2
10 years, 3 months
[libvirt] [PATCH 1/1] virsh: add missing auto-converge option for 'migrate' in virsh man page
by Pradipta Kr. Banerjee
* tools/virsh.pod (migrate): Add --auto-converge flag
Signed-off-by: Pradipta Kr. Banerjee <bpradip(a)in.ibm.com>
---
tools/virsh.pod | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index b665d6e..d6849b8 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -1289,7 +1289,7 @@ to the I<uri> namespace is displayed instead of being modified.
=item B<migrate> [I<--live>] [I<--offline>] [I<--direct>] [I<--p2p> [I<--tunnelled>]]
[I<--persistent>] [I<--undefinesource>] [I<--suspend>] [I<--copy-storage-all>]
[I<--copy-storage-inc>] [I<--change-protection>] [I<--unsafe>] [I<--verbose>]
-[I<--compressed>] [I<--abort-on-error>]
+[I<--compressed>] [I<--abort-on-error>] [I<--auto-converge>]
I<domain> I<desturi> [I<migrateuri>] [I<graphicsuri>] [I<listen-address>]
[I<dname>] [I<--timeout> B<seconds>] [I<--xml> B<file>]
@@ -1314,7 +1314,8 @@ used to reject the migration if the hypervisor lacks change protection
support. I<--verbose> displays the progress of migration. I<--compressed>
activates compression of memory pages that have to be transferred repeatedly
during live migration. I<--abort-on-error> cancels the migration if a soft
-error (for example I/O error) happens during the migration.
+error (for example I/O error) happens during the migration. I<--auto-converge>
+forces convergence during live migration
B<Note>: Individual hypervisors usually do not support all possible types of
migration. For example, QEMU does not support direct migration.
--
1.9.3
10 years, 3 months
[libvirt] [PATCH] qemu: allow device block I/O tuning in session mode
by Martin Kletzander
In commit 45ad1adb I added a nicer message for tunings that need
cgroups when unavailable (unprigileged) ,but I added this check for
I/O tuning of block devices, which doesn't need cgroups, because it is
done by QEMU, so let's fix that.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_driver.c | 14 --------------
2 files changed, 1 insertion(+), 15 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 8a69976..a92315a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7375,7 +7375,7 @@ qemuBuildCommandLine(virConnectPtr conn,
goto error;
}
- if (def->blkio.weight || def->blkio.ndevices) {
+ if (def->blkio.weight) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Block I/O tuning is not available in session mode"));
goto error;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ac0717c..b95432a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15857,11 +15857,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
goto cleanup;
cfg = virQEMUDriverGetConfig(driver);
- if (!cfg->privileged) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Block I/O tuning is not available in session mode"));
- goto cleanup;
- }
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
@@ -16009,7 +16004,6 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
int ret = -1;
size_t i;
virCapsPtr caps = NULL;
- virQEMUDriverConfigPtr cfg = NULL;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_AFFECT_CONFIG |
@@ -16024,13 +16018,6 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
if (virDomainGetBlockIoTuneEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- cfg = virQEMUDriverGetConfig(driver);
- if (!cfg->privileged) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Block I/O tuning is not available in session mode"));
- goto cleanup;
- }
-
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
@@ -16133,7 +16120,6 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
if (vm)
virObjectUnlock(vm);
virObjectUnref(caps);
- virObjectUnref(cfg);
return ret;
}
--
2.0.4
10 years, 3 months
[libvirt] [PATCH] build: Fix build warning on libvirt-python
by Wang Rui
From: Mo Yuxiang <Moyuxiang(a)huawei.com>
On compiling libvirt-python, we get such a warning:
libvirt-qemu-override.c: In function ‘libvirt_qemu_virConnectDomainQemuMonitorEventRegister’:
libvirt-qemu-override.c:304: warning: suggest explicit braces to avoid ambiguous ‘else’
Py_DECREF is a macro. The solution is to add brackets.
Signed-off-by: Mo Yuxiang <Moyuxiang(a)huawei.com>
---
libvirt-qemu-override.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libvirt-qemu-override.c b/libvirt-qemu-override.c
index 05ead30..8be3755 100644
--- a/libvirt-qemu-override.c
+++ b/libvirt-qemu-override.c
@@ -301,8 +301,9 @@ libvirt_qemu_virConnectDomainQemuMonitorEventRegister(PyObject *self ATTRIBUTE_U
flags);
LIBVIRT_END_ALLOW_THREADS;
- if (ret < 0)
+ if (ret < 0) {
Py_DECREF(pyobj_cbData);
+ }
py_retval = libvirt_intWrap(ret);
return py_retval;
--
1.7.12.4
10 years, 3 months
[libvirt] [PATCH] Fix missing attribute dscp in supported protocols in nwfilter docs
by Jianwei Hu
Added attribute dscp to below supported protocols table in nwfilter docs.
IPV4 (ip)
TCP/UDP/SCTP (tcp/udp/sctp)
ICMP (icmp)
IGMP,ESP,AH,UDPLITE,'ALL' (igmp,esp,ah,udplite,all)
TCP/UDP/SCTP over IPV6 (tcp-ipv6,udp-ipv6,sctp-ipv6)
ICMPV6 (icmpv6)
IGMP,ESP,AH,UDPLITE,'ALL' over IPv6 (igmp-ipv6,esp-ipv6,ah-ipv6,udplite-ipv6,all-ipv6)
Here is a simple example:
[root@localhost ~]# virsh nwfilter-dumpxml myself
<filter name='myself' chain='root'>
<uuid>7192ef51-cd50-4f14-ad7b-fa5c69ea19e3</uuid>
<rule action='accept' direction='in' priority='500'>
<ip dscp='1'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<tcp dscp='1'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<tcp-ipv6 dscp='2'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<icmp dscp='55'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<icmpv6 dscp='55'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<udp dscp='3'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<udp-ipv6 dscp='4'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<udplite dscp='5'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<udplite-ipv6 dscp='6'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<esp dscp='7'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<esp-ipv6 dscp='8'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<ah dscp='9'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<ah-ipv6 dscp='10'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<sctp dscp='11'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<sctp-ipv6 dscp='55'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<igmp dscp='55'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<all-ipv6 dscp='55'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<all dscp='55'/>
</rule>
</filter>
---
docs/formatnwfilter.html.in | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/docs/formatnwfilter.html.in b/docs/formatnwfilter.html.in
index 7169fa9..46b0bfa 100644
--- a/docs/formatnwfilter.html.in
+++ b/docs/formatnwfilter.html.in
@@ -1101,6 +1101,11 @@
<td>End of range of valid destination ports; requires <code>protocol</code></td>
</tr>
<tr>
+ <td>dscp</td>
+ <td>UINT8 (0x0-0x3f, 0 - 63)</td>
+ <td>codepoint within the DS field in the IP header</td>
+ </tr>
+ <tr>
<td>comment <span class="since">(Since 0.8.5)</span></td>
<td>STRING</td>
<td>text with max. 256 characters</td>
@@ -1284,6 +1289,11 @@
<td>End of range of valid destination ports</td>
</tr>
<tr>
+ <td>dscp</td>
+ <td>UINT8 (0x0-0x3f, 0 - 63)</td>
+ <td>codepoint within the DS field in the IP header</td>
+ </tr>
+ <tr>
<td>comment <span class="since">(Since 0.8.5)</span></td>
<td>STRING</td>
<td>text with max. 256 characters</td>
@@ -1399,6 +1409,11 @@
<td>ICMP code</td>
</tr>
<tr>
+ <td>dscp</td>
+ <td>UINT8 (0x0-0x3f, 0 - 63)</td>
+ <td>codepoint within the DS field in the IP header</td>
+ </tr>
+ <tr>
<td>comment <span class="since">(Since 0.8.5)</span></td>
<td>STRING</td>
<td>text with max. 256 characters</td>
@@ -1498,6 +1513,11 @@
<td>End of range of destination IP address</td>
</tr>
<tr>
+ <td>dscp</td>
+ <td>UINT8 (0x0-0x3f, 0 - 63)</td>
+ <td>codepoint within the DS field in the IP header</td>
+ </tr>
+ <tr>
<td>comment <span class="since">(Since 0.8.5)</span></td>
<td>STRING</td>
<td>text with max. 256 characters</td>
@@ -1604,6 +1624,11 @@
<td>End of range of valid destination ports</td>
</tr>
<tr>
+ <td>dscp</td>
+ <td>UINT8 (0x0-0x3f, 0 - 63)</td>
+ <td>codepoint within the DS field in the IP header</td>
+ </tr>
+ <tr>
<td>comment <span class="since">(Since 0.8.5)</span></td>
<td>STRING</td>
<td>text with max. 256 characters</td>
@@ -1705,6 +1730,11 @@
<td>ICMPv6 code</td>
</tr>
<tr>
+ <td>dscp</td>
+ <td>UINT8 (0x0-0x3f, 0 - 63)</td>
+ <td>codepoint within the DS field in the IP header</td>
+ </tr>
+ <tr>
<td>comment <span class="since">(Since 0.8.5)</span></td>
<td>STRING</td>
<td>text with max. 256 characters</td>
@@ -1789,6 +1819,11 @@
<td>End of range of destination IP address</td>
</tr>
<tr>
+ <td>dscp</td>
+ <td>UINT8 (0x0-0x3f, 0 - 63)</td>
+ <td>codepoint within the DS field in the IP header</td>
+ </tr>
+ <tr>
<td>comment <span class="since">(Since 0.8.5)</span></td>
<td>STRING</td>
<td>text with max. 256 characters</td>
--
1.8.3.1
10 years, 3 months