[libvirt] [PATCH] docs: Add Kimchi as Web Application
by Ramon Medeiros
Kimchi is a open-source interface to kvm. It runs with HTML5, simple and
easy to manage kvm guests.
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
docs/apps.html.in | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/docs/apps.html.in b/docs/apps.html.in
index b8337b9..1a6fd3f 100644
--- a/docs/apps.html.in
+++ b/docs/apps.html.in
@@ -404,6 +404,14 @@
infrastructure. You can deploy a new service just dragging and
dropping a VM.
</dd>
+ <dt><a href="https://kimchi-project.github.io/kimchi/">Kimchi</a></dt>
+ <dd>
+ Kimchi is an HTML5 based management tool for KVM. It is designed to
+ make it as easy as possible to get started with KVM and create your first guest.
+
+ Kimchi manages KVM guests through libvirt. The management interface is accessed
+ over the web using a browser that supports HTML5.
+ </dd>
<dt><a href="http://ovirt.org/">oVirt</a></dt>
<dd>
oVirt provides the ability to manage large numbers of virtual
--
2.5.5
8 years, 4 months
[libvirt] [PATCH v3 0/2] qemu: expand domain memory statistics
by Derbyshev Dmitriy
From: Derbyshev Dmitry <dderbyshev(a)virtuozzo.com>
QEMU reports timestamp and available along with other memory statistics.
This information was not saved into domain statistics.
Changes since v1:
* Enum numeration fixed
* Macro getting "usage" field fixed
Changes since v2:
* previous patches were on wrong branch
* qemu's stat name was "stat-available-memory"
Derbyshev Dmitry (2):
qemu: expand domain memory statistics with 'usable'
qemu: expand domain memory statistics with 'last-update' timestamp
include/libvirt/libvirt-domain.h | 11 ++++++++++-
src/libvirt-domain.c | 5 +++++
src/qemu/qemu_monitor_json.c | 22 +++++++++++++---------
tools/virsh-domain-monitor.c | 4 ++++
4 files changed, 32 insertions(+), 10 deletions(-)
--
1.9.5.msysgit.0
8 years, 4 months
[libvirt] [PATCH v2 00/10] Remove caching of address sets
by Tomasz Flendrich
From: Tomasz Flendrich <Darge(a)users.noreply.github.com>
These patches delete the caching of pci, virtioSerial and ccw address sets.
I am deleting them, because they can be recalculated from the domain definition,
and there's no point in keeping redundant data, especially because handling
a persistent cache of addresses required using functions that released addresses.
These functions aren't useful anymore, so they are dropped too.
I know that USB addresses were added and that they are cached now. I am sure
that they can be calculated on demand too though.
If this gets accepted, I will rebase the other patches that depend on this one,
making functions less dependant on qemu, and removing the code duplication.
Changes in v2:
* I rebased it, because there were some changes that added a usb address set.
* virDomainReleaseDeviceAddress is no longer deleted, because it's used
for usb addresses. It also means that in qemu_hotplug.c, this function's
calls are not deleted anymore.
* In qemu_hotplug.c, in one place, virDomainPCIAddressSetFree() was previously
called after the "error:" label. I moved it to the "cleanup:", so the address
set is freed even if an error occurs.
* Add one missing free of pci address set, in qemuDomainAttachNetDevice().
Tomasz Flendrich (10):
add virDomainVirtioSerialAddrSetCreateFromDomain
qemu_hotplug: generate vioserial address list on demand
qemu: remove vioserialaddrs caching
Add qemuDomainCCWAddrSetCreateFromDomain
qemu_hotplug: generate ccw address list on demand
qemu: remove ccwaddrs caching
add qemuDomainPCIAddrSetCreateFromDomain
qemu_hotplug: generate pci address list on demand
qemu: remove pciaddrs caching
Remove unused functions that release addresses
src/conf/domain_addr.c | 131 +++++++++---------------------------
src/conf/domain_addr.h | 19 +-----
src/libvirt_private.syms | 4 +-
src/qemu/qemu_domain.c | 3 -
src/qemu/qemu_domain.h | 3 -
src/qemu/qemu_domain_address.c | 147 ++++++++++++++++++++---------------------
src/qemu/qemu_domain_address.h | 9 +++
src/qemu/qemu_hotplug.c | 111 ++++++++++++++++++++++++-------
8 files changed, 201 insertions(+), 226 deletions(-)
--
2.7.4 (Apple Git-66)
8 years, 4 months
[libvirt] [PATCH v2 00/10] Test persistent device attachment
by Tomasz Flendrich
Changes in v2:
* rebased
This patch requires another one, otherwise a small conflict appears:
https://www.redhat.com/archives/libvir-list/2016-July/msg00402.html
In qemu_driver.c, two functions were split to have less responsibility.
They were also modified so that they could be used in qemuhotplugtest.
Now instead of running different functions to attach different device
types, a generic function is run. Hopefully this will result in more
device types tested in the future.
Suggestions on how to name these two new functions are very welcome.
In the future, if one uses the following command:
virsh attach-device --live --config
the new device will have the same address assigned in both live
and config domain. To make sure that everything will work properly
after making these changes, I reworked qemuhotplug.c to work with
attaching devices to persistent domains.
So far, there is only one test for persistent attachment. I will
add more testcases as soon as I hear some feedback on these changes.
qemuhotplugtest.c should first be modified anyway, so that the three
xmls's filenames (basis domain xml, device xml, expected xml) are stated
explicitly instead of being calculated. This will allow for more
flexibility in testing and less xml files duplicates.
Tomasz
Tomasz Flendrich (10):
Change parameters to qemuDomainAttachDeviceLive
Remove an unnecessary variable
Split qemuDomainAttachDeviceFlags in two
Narrow down a parameter
Split qemuDomainDetachDeviceFlags in two
Make qemu attach/detach functions public
Narrow down a parameter to function
Use more generic functions in qemuhotplugtest
Make qemuhotplugtest work with persistent domains
Add a persistent attachment testcase
src/qemu/qemu_driver.c | 221 +++++++++++----------
src/qemu/qemu_driver.h | 14 ++
tests/qemuhotplugtest.c | 213 ++++++++++++--------
.../qemuhotplug-base-config+qemu-agent+config.xml | 45 +++++
.../qemuhotplug-base-config.xml | 40 ++++
5 files changed, 349 insertions(+), 184 deletions(-)
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-config+qemu-agent+config.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-config.xml
--
2.7.4
8 years, 4 months
[libvirt] [PATCH v5] libxl: implement virDomainBlockStats
by Joao Martins
Introduce initial support for domainBlockStats API call that
allow us to query block device statistics. openstack nova
uses this API call to query block statistics, alongside
virDomainMemoryStats and virDomainInterfaceStats. Note that
this patch only introduces it for VBD for starters. QDisk
would come in a separate patch series.
A new statistics data structure is introduced to fit common
statistics among others specific to the underlying block
backends. For the VBD statistics on linux these are exported
via sysfs on the path:
"/sys/bus/xen-backend/devices/vbd-<domid>-<devid>/statistics"
To calculate the block devno libxlDiskPathToID is introduced.
Each backend implements its own function to extract statistics
and let there be handled the different platforms.
VBD stats are exposed in reqs and number of sectors from
blkback, and it's up to us to convert it to sector sizes.
The sector size is gathered through xenstore in the device
backend entry "physical-sector-size".
BlockStatsFlags variant is also implemented which has the
added benefit of getting the number of flush requests.
Signed-off-by: Joao Martins <joao.m.martins(a)oracle.com>
---
Changes since v4:
- No need to handle virtpath as devid - return id = -1 instead
- Rework compilation of BlockStatsVBD compilation on other platforms.
- Use disk->dst as opposed to plain path to also cover the case when
input virtpath is path to file. Before it was returning "cannot find
device number"
Changes since v3:
- No need for error in libxlDiskSectorSize()
- Fix an identation issue.
- Rework cleanup paths on libxlDiskSectorSize()
- Do not unlock vm if libxlDomainObjEndJob() returns false and
adjust to the newly introduced virDomainObjEndAPI()
- Bump version to 2.1.0
Changes since v1:
- Fix identation issues
- Set ret to LIBXL_VBD_SECTOR_SIZE
- Reuse VIR_STRDUP error instead of doing virReportError
when we fail to set stats->backend
- Change virAsprintf(...) error checking
- Change error to VIR_ERR_OPERATION_FAILED when xenstore path
does not exist and when failing to read stat.
- Resolve issues with 'make syntax-check' with cppi installed.
- Remove libxlDiskPathMatches in favor of using virutil
virDiskNameParse to fetch disk and partition index.
- Rename libxlDiskPathParse to libxlDiskPathToID and rework
function to just convert disk and partition index to devno.
- Bump version to 1.2.22
---
src/libxl/libxl_driver.c | 367 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 367 insertions(+)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index f153f69..b33c898 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -30,6 +30,7 @@
#include <math.h>
#include <libxl.h>
#include <libxl_utils.h>
+#include <xenstore.h>
#include <fcntl.h>
#include <regex.h>
@@ -72,6 +73,7 @@ VIR_LOG_INIT("libxl.libxl_driver");
#define LIBXL_DOM_REQ_HALT 4
#define LIBXL_NB_TOTAL_CPU_STAT_PARAM 1
+#define LIBXL_NB_TOTAL_BLK_STAT_PARAM 6
#define HYPERVISOR_CAPABILITIES "/proc/xen/capabilities"
#define HYPERVISOR_XENSTORED "/dev/xen/xenstored"
@@ -100,6 +102,25 @@ struct _libxlOSEventHookInfo {
int id;
};
+/* Object used to store disk statistics across multiple xen backends */
+typedef struct _libxlBlockStats libxlBlockStats;
+typedef libxlBlockStats *libxlBlockStatsPtr;
+struct _libxlBlockStats {
+ long long rd_req;
+ long long rd_bytes;
+ long long wr_req;
+ long long wr_bytes;
+ long long f_req;
+
+ char *backend;
+ union {
+ struct {
+ long long ds_req;
+ long long oo_req;
+ } vbd;
+ } u;
+};
+
/* Function declarations */
static int
libxlDomainManagedSaveLoad(virDomainObjPtr vm,
@@ -5031,6 +5052,350 @@ libxlDomainGetJobStats(virDomainPtr dom,
}
static int
+libxlDiskPathToID(const char *virtpath)
+{
+ static char const* drive_prefix[] = {"xvd", "hd", "sd"};
+ int disk, partition, chrused;
+ int fmt, id;
+ size_t i;
+
+ fmt = id = -1;
+
+ /* Find any disk prefixes we know about */
+ for (i = 0; i < ARRAY_CARDINALITY(drive_prefix); i++) {
+ if (STRPREFIX(virtpath, drive_prefix[i]) &&
+ !virDiskNameParse(virtpath, &disk, &partition)) {
+ fmt = i;
+ break;
+ }
+ }
+
+ /* Handle it same way as xvd */
+ if (fmt < 0 &&
+ (sscanf(virtpath, "d%ip%i%n", &disk, &partition, &chrused) >= 2
+ && chrused == strlen(virtpath)))
+ fmt = 0;
+
+ /* Test indexes ranges and calculate the device id */
+ switch (fmt) {
+ case 0: /* xvd */
+ if (disk <= 15 && partition <= 15)
+ id = (202 << 8) | (disk << 4) | partition;
+ else if ((disk <= ((1<<20)-1)) || partition <= 255)
+ id = (1 << 28) | (disk << 8) | partition;
+ break;
+ case 1: /* hd */
+ if (disk <= 3 && partition <= 63)
+ id = ((disk < 2 ? 3 : 22) << 8) | ((disk & 1) << 6) | partition;
+ break;
+ case 2: /* sd */
+ if (disk <= 15 && (partition <= 15))
+ id = (8 << 8) | (disk << 4) | partition;
+ break;
+ default: /* invalid */
+ break;
+ }
+ return id;
+}
+
+#define LIBXL_VBD_SECTOR_SIZE 512
+
+static int
+libxlDiskSectorSize(int domid, int devno)
+{
+ char *path, *val;
+ struct xs_handle *handle;
+ int ret = LIBXL_VBD_SECTOR_SIZE;
+ unsigned int len;
+
+ handle = xs_daemon_open_readonly();
+ if (!handle) {
+ VIR_WARN("cannot read sector size");
+ return ret;
+ }
+
+ path = val = NULL;
+ if (virAsprintf(&path, "/local/domain/%d/device/vbd/%d/backend",
+ domid, devno) < 0)
+ goto cleanup;
+
+ if ((val = xs_read(handle, XBT_NULL, path, &len)) == NULL)
+ goto cleanup;
+
+ VIR_FREE(path);
+ if (virAsprintf(&path, "%s/physical-sector-size", val) < 0)
+ goto cleanup;
+
+ VIR_FREE(val);
+ if ((val = xs_read(handle, XBT_NULL, path, &len)) == NULL)
+ goto cleanup;
+
+ if (sscanf(val, "%d", &ret) != 1)
+ ret = LIBXL_VBD_SECTOR_SIZE;
+
+ cleanup:
+ VIR_FREE(val);
+ VIR_FREE(path);
+ xs_daemon_close(handle);
+ return ret;
+}
+
+#ifdef __linux__
+static int
+libxlDomainBlockStatsVBD(virDomainObjPtr vm,
+ const char *dev,
+ libxlBlockStatsPtr stats)
+{
+ int ret = -1;
+ int devno = libxlDiskPathToID(dev);
+ int size = libxlDiskSectorSize(vm->def->id, devno);
+ char *path, *name, *val;
+ unsigned long long stat;
+
+ path = name = val = NULL;
+ if (devno < 0) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("cannot find device number"));
+ return ret;
+ }
+ if (VIR_STRDUP(stats->backend, "vbd") < 0)
+ return ret;
+
+ if (virAsprintf(&path, "/sys/bus/xen-backend/devices/vbd-%d-%d/statistics",
+ vm->def->id, devno) < 0)
+ return ret;
+
+ if (!virFileExists(path)) {
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ "%s", _("cannot open bus path"));
+ goto cleanup;
+ }
+
+# define LIBXL_SET_VBDSTAT(FIELD, VAR, MUL) \
+ if ((virAsprintf(&name, "%s/"FIELD, path) < 0) || \
+ (virFileReadAll(name, 256, &val) < 0) || \
+ (sscanf(val, "%llu", &stat) != 1)) { \
+ virReportError(VIR_ERR_OPERATION_FAILED, \
+ _("cannot read %s"), name); \
+ goto cleanup; \
+ } \
+ VAR += (stat * MUL); \
+ VIR_FREE(name); \
+ VIR_FREE(val);
+
+ LIBXL_SET_VBDSTAT("f_req", stats->f_req, 1)
+ LIBXL_SET_VBDSTAT("wr_req", stats->wr_req, 1)
+ LIBXL_SET_VBDSTAT("rd_req", stats->rd_req, 1)
+ LIBXL_SET_VBDSTAT("wr_sect", stats->wr_bytes, size)
+ LIBXL_SET_VBDSTAT("rd_sect", stats->rd_bytes, size)
+
+ LIBXL_SET_VBDSTAT("ds_req", stats->u.vbd.ds_req, size)
+ LIBXL_SET_VBDSTAT("oo_req", stats->u.vbd.oo_req, 1)
+ ret = 0;
+
+ cleanup:
+ VIR_FREE(name);
+ VIR_FREE(path);
+ VIR_FREE(val);
+
+# undef LIBXL_SET_VBDSTAT
+
+ return ret;
+}
+#else
+static int
+libxlDomainBlockStatsVBD(virDomainObjPtr vm ATTRIBUTE_UNUSED,
+ const char *dev ATTRIBUTE_UNUSED,
+ libxlBlockStatsPtr stats ATTRIBUTE_UNUSED)
+{
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+ "%s", _("platform unsupported"));
+ return -1;
+}
+#endif
+
+static int
+libxlDomainBlockStatsGatherSingle(virDomainObjPtr vm,
+ const char *path,
+ libxlBlockStatsPtr stats)
+{
+ virDomainDiskDefPtr disk;
+ const char *disk_drv;
+ int ret = -1, disk_fmt;
+
+ if (!(disk = virDomainDiskByName(vm->def, path, false))) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("invalid path: %s"), path);
+ return ret;
+ }
+
+ disk_fmt = virDomainDiskGetFormat(disk);
+ if (!(disk_drv = virDomainDiskGetDriver(disk)))
+ disk_drv = "qemu";
+
+ if (STREQ(disk_drv, "phy")) {
+ if (disk_fmt != VIR_STORAGE_FILE_RAW &&
+ disk_fmt != VIR_STORAGE_FILE_NONE) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+ _("unsupported format %s"),
+ virStorageFileFormatTypeToString(disk_fmt));
+ return ret;
+ }
+
+ ret = libxlDomainBlockStatsVBD(vm, disk->dst, stats);
+ } else {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+ _("unsupported disk driver %s"),
+ disk_drv);
+ }
+ return ret;
+}
+
+static int
+libxlDomainBlockStatsGather(virDomainObjPtr vm,
+ const char *path,
+ libxlBlockStatsPtr stats)
+{
+ int ret = -1;
+
+ if (*path) {
+ if (libxlDomainBlockStatsGatherSingle(vm, path, stats) < 0)
+ return ret;
+ } else {
+ size_t i;
+
+ for (i = 0; i < vm->def->ndisks; ++i) {
+ if (libxlDomainBlockStatsGatherSingle(vm, vm->def->disks[i]->dst,
+ stats) < 0)
+ return ret;
+ }
+ }
+ return 0;
+}
+
+static int
+libxlDomainBlockStats(virDomainPtr dom,
+ const char *path,
+ virDomainBlockStatsPtr stats)
+{
+ libxlDriverPrivatePtr driver = dom->conn->privateData;
+ virDomainObjPtr vm;
+ libxlBlockStats blkstats;
+ int ret = -1;
+
+ if (!(vm = libxlDomObjFromDomain(dom)))
+ goto cleanup;
+
+ if (virDomainBlockStatsEnsureACL(dom->conn, vm->def) < 0)
+ goto cleanup;
+
+ if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_QUERY) < 0)
+ goto cleanup;
+
+ if (!virDomainObjIsActive(vm)) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is not running"));
+ goto endjob;
+ }
+
+ memset(&blkstats, 0, sizeof(libxlBlockStats));
+ if ((ret = libxlDomainBlockStatsGather(vm, path, &blkstats)) < 0)
+ goto endjob;
+
+ stats->rd_req = blkstats.rd_req;
+ stats->rd_bytes = blkstats.rd_bytes;
+ stats->wr_req = blkstats.wr_req;
+ stats->wr_bytes = blkstats.wr_bytes;
+ if (STREQ_NULLABLE(blkstats.backend, "vbd"))
+ stats->errs = blkstats.u.vbd.oo_req;
+ else
+ stats->errs = -1;
+
+ endjob:
+ libxlDomainObjEndJob(driver, vm);
+
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ return ret;
+}
+
+static int
+libxlDomainBlockStatsFlags(virDomainPtr dom,
+ const char *path,
+ virTypedParameterPtr params,
+ int *nparams,
+ unsigned int flags)
+{
+ libxlDriverPrivatePtr driver = dom->conn->privateData;
+ virDomainObjPtr vm;
+ libxlBlockStats blkstats;
+ int nstats;
+ int ret = -1;
+
+ virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1);
+
+ flags &= ~VIR_TYPED_PARAM_STRING_OKAY;
+
+ if (!(vm = libxlDomObjFromDomain(dom)))
+ goto cleanup;
+
+ if (virDomainBlockStatsFlagsEnsureACL(dom->conn, vm->def) < 0)
+ goto cleanup;
+
+ if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_QUERY) < 0)
+ goto cleanup;
+
+ if (!virDomainObjIsActive(vm)) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is not running"));
+ goto endjob;
+ }
+
+ /* return count of supported stats */
+ if (*nparams == 0) {
+ *nparams = LIBXL_NB_TOTAL_BLK_STAT_PARAM;
+ ret = 0;
+ goto endjob;
+ }
+
+ memset(&blkstats, 0, sizeof(libxlBlockStats));
+ if ((ret = libxlDomainBlockStatsGather(vm, path, &blkstats)) < 0)
+ goto endjob;
+
+ nstats = 0;
+
+#define LIBXL_BLKSTAT_ASSIGN_PARAM(VAR, NAME) \
+ if (nstats < *nparams && (blkstats.VAR) != -1) { \
+ if (virTypedParameterAssign(params + nstats, NAME, \
+ VIR_TYPED_PARAM_LLONG, (blkstats.VAR)) < 0) \
+ goto endjob; \
+ nstats++; \
+ }
+
+ LIBXL_BLKSTAT_ASSIGN_PARAM(wr_bytes, VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES);
+ LIBXL_BLKSTAT_ASSIGN_PARAM(wr_req, VIR_DOMAIN_BLOCK_STATS_WRITE_REQ);
+
+ LIBXL_BLKSTAT_ASSIGN_PARAM(rd_bytes, VIR_DOMAIN_BLOCK_STATS_READ_BYTES);
+ LIBXL_BLKSTAT_ASSIGN_PARAM(rd_req, VIR_DOMAIN_BLOCK_STATS_READ_REQ);
+
+ LIBXL_BLKSTAT_ASSIGN_PARAM(f_req, VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ);
+
+ if (STREQ_NULLABLE(blkstats.backend, "vbd"))
+ LIBXL_BLKSTAT_ASSIGN_PARAM(u.vbd.oo_req, VIR_DOMAIN_BLOCK_STATS_ERRS);
+
+ *nparams = nstats;
+
+#undef LIBXL_BLKSTAT_ASSIGN_PARAM
+
+ endjob:
+ libxlDomainObjEndJob(driver, vm);
+
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ return ret;
+}
+
+static int
libxlConnectDomainEventRegisterAny(virConnectPtr conn, virDomainPtr dom, int eventID,
virConnectDomainEventGenericCallback callback,
void *opaque, virFreeCallback freecb)
@@ -5847,6 +6212,8 @@ static virHypervisorDriver libxlHypervisorDriver = {
.domainMemoryStats = libxlDomainMemoryStats, /* 1.3.0 */
.domainGetCPUStats = libxlDomainGetCPUStats, /* 1.3.0 */
.domainInterfaceStats = libxlDomainInterfaceStats, /* 1.3.2 */
+ .domainBlockStats = libxlDomainBlockStats, /* 2.1.0 */
+ .domainBlockStatsFlags = libxlDomainBlockStatsFlags, /* 2.1.0 */
.connectDomainEventRegister = libxlConnectDomainEventRegister, /* 0.9.0 */
.connectDomainEventDeregister = libxlConnectDomainEventDeregister, /* 0.9.0 */
.domainManagedSave = libxlDomainManagedSave, /* 0.9.2 */
--
2.1.4
8 years, 5 months
[libvirt] [PATCH] qemu: rename QEMU_CAPS_MLOCK to QEMU_CAPS_REALTIME_MLOCK
by Henning Schild
Purely cosmetic change to be consistent with the other names.
Signed-off-by: Henning Schild <henning.schild(a)siemens.com>
---
Something i found in an old staging queue and that might be considered
useful.
src/qemu/qemu_capabilities.c | 2 +-
src/qemu/qemu_capabilities.h | 2 +-
src/qemu/qemu_command.c | 4 ++--
tests/qemuxml2argvtest.c | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index f600ce9..d5b73e6 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2655,7 +2655,7 @@ static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = {
{ "machine", "vmport", QEMU_CAPS_MACHINE_VMPORT_OPT },
{ "drive", "discard", QEMU_CAPS_DRIVE_DISCARD },
{ "drive", "detect-zeroes", QEMU_CAPS_DRIVE_DETECT_ZEROES },
- { "realtime", "mlock", QEMU_CAPS_MLOCK },
+ { "realtime", "mlock", QEMU_CAPS_REALTIME_MLOCK },
{ "boot-opts", "strict", QEMU_CAPS_BOOT_STRICT },
{ "boot-opts", "reboot-timeout", QEMU_CAPS_REBOOT_TIMEOUT },
{ "boot-opts", "splash-time", QEMU_CAPS_SPLASH_TIMEOUT },
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index ca84f27..bd5c6d9 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -254,7 +254,7 @@ typedef enum {
QEMU_CAPS_MEM_MERGE, /* -machine mem-merge */
QEMU_CAPS_VNC_WEBSOCKET, /* -vnc x:y,websocket */
QEMU_CAPS_DRIVE_DISCARD, /* -drive discard=off(ignore)|on(unmap) */
- QEMU_CAPS_MLOCK, /* -realtime mlock=on|off */
+ QEMU_CAPS_REALTIME_MLOCK, /* -realtime mlock=on|off */
/* 150 */
QEMU_CAPS_VNC_SHARE_POLICY, /* set display sharing policy */
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 4558b9f..3dc131b 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7022,12 +7022,12 @@ qemuBuildMemCommandLine(virCommandPtr cmd,
qemuBuildMemPathStr(cfg, def, qemuCaps, cmd) < 0)
return -1;
- if (def->mem.locked && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_MLOCK)) {
+ if (def->mem.locked && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_REALTIME_MLOCK)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("memory locking not supported by QEMU binary"));
return -1;
}
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MLOCK)) {
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_REALTIME_MLOCK)) {
virCommandAddArg(cmd, "-realtime");
virCommandAddArgFormat(cmd, "mlock=%s",
def->mem.locked ? "on" : "off");
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 356f843..a5d51a8 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1750,9 +1750,9 @@ mymain(void)
QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_VIRTIO_SCSI,
QEMU_CAPS_DEVICE_SCSI_GENERIC);
- DO_TEST("mlock-on", QEMU_CAPS_MLOCK);
+ DO_TEST("mlock-on", QEMU_CAPS_REALTIME_MLOCK);
DO_TEST_FAILURE("mlock-on", NONE);
- DO_TEST("mlock-off", QEMU_CAPS_MLOCK);
+ DO_TEST("mlock-off", QEMU_CAPS_REALTIME_MLOCK);
DO_TEST("mlock-unsupported", NONE);
DO_TEST_PARSE_ERROR("pci-bridge-negative-index-invalid",
--
2.7.3
8 years, 5 months
[libvirt] [PATCH 0/9] Introducing node device lifecycle event APIs
by Jovanka Gulicoska
Introducing implementation of node device event APIs. Code changes
follow network/storage pool event APIs.
Implemented functions: virNodeDeviceEventRegisterAny(),
virNodeDeviceEventDeregisterAny(), virNodeDeviceLifeCycleEventNew(),
introduced CREATED and DELETED.
There are also test as well as unittests for the new functions and signals.
This is part of a GSOC project: Asynchronous lifecycle events for storage objects
Jovanka Gulicoska (9):
Introduce node device lifecycle event APIs
conf: add node_device_event handling
conf: events: don't crash on NULL uuid
test: implement node device lifecycle event APIs
remote: implement node device lifecycle event APIs
node_device: implement node device lifecycle event APIs
node_device: Implement event queue in udev
event-test: support node device lifecycle event APIs
virsh: Introduce nodedev-event command
daemon/libvirtd.h | 2 +
daemon/remote.c | 206 ++++++++++++++++++++++++++++++
examples/object-events/event-test.c | 68 ++++++++++
include/libvirt/libvirt-nodedev.h | 90 ++++++++++++++
po/POTFILES.in | 1 +
src/Makefile.am | 5 +
src/conf/node_device_conf.h | 4 +
src/conf/node_device_event.c | 234 +++++++++++++++++++++++++++++++++++
src/conf/node_device_event.h | 59 +++++++++
src/conf/object_event.c | 3 +-
src/datatypes.h | 13 ++
src/driver-nodedev.h | 14 +++
src/libvirt-nodedev.c | 127 +++++++++++++++++++
src/libvirt_private.syms | 5 +
src/libvirt_public.syms | 6 +
src/node_device/node_device_driver.c | 42 +++++++
src/node_device/node_device_driver.h | 10 ++
src/node_device/node_device_udev.c | 24 ++++
src/remote/remote_driver.c | 139 +++++++++++++++++++++
src/remote/remote_protocol.x | 43 ++++++-
src/remote_protocol-structs | 19 +++
src/test/test_driver.c | 49 ++++++++
tests/objecteventtest.c | 72 +++++++++++
tools/virsh-nodedev.c | 211 +++++++++++++++++++++++++++++++
tools/virsh-nodedev.h | 10 ++
tools/virsh.pod | 18 +++
26 files changed, 1472 insertions(+), 2 deletions(-)
create mode 100644 src/conf/node_device_event.c
create mode 100644 src/conf/node_device_event.h
--
2.7.4
8 years, 5 months
[libvirt] [PATCH] qemu: Use legacy USB on ppc64
by Andrea Bolognani
Commit 8156493d8db9 changed libvirt so that '-device pci-ohci'
would be used instead of '-usb' on ppc64 when no specific USB
controller model had been specified in the guest configuration.
While the device that ends up being presented by the guest is
exactly the same, '-usb' causes it to be assigned to PCI address
00:00.0 while '-device pci-ohci', being subject to the regular
PCI address assignment logic, will be at a different address.
This PCI address mismatch breaks migration of existing guests
to new libvirt versions.
Luckily, when QEMU has switched its default '-usb' controller
from pci-ohci to nec-usb-xhci (QEMU commit 57040d451315), it
has done so without affecting older machine types, which means
we can keep using '-usb' without risking guest ABI breakage.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1357468
---
src/qemu/qemu_command.c | 8 +++++---
tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args | 2 +-
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 2e04f57..9050e77 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2827,9 +2827,11 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd,
/* We're not using legacy usb controller for q35 */
if (ARCH_IS_PPC64(def->os.arch)) {
- /* For ppc64 the legacy was OHCI */
- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI))
- need_legacy = true;
+ /* ppc64 needs to use the -usb flag in order not to break
+ * migration of existing guests: the legacy USB controller
+ * uses a PCI address that we have no way of assigning
+ * using the usual -device machinery */
+ need_legacy = true;
} else {
/* For anything else, we used PIIX3_USB_UHCI */
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI))
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller.args b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller.args
index 2ec2231..bed5045 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller.args
@@ -15,5 +15,5 @@ QEMU_AUDIO_DRV=none \
-nodefaults \
-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \
-boot c \
--device pci-ohci,id=usb,bus=pci,addr=0x1 \
+-usb \
-device virtio-balloon-pci,id=balloon0,bus=pci,addr=0x6
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args
index 251e786..2839dea 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args
@@ -19,6 +19,6 @@ server,nowait \
-mon chardev=charmonitor,id=monitor,mode=readline \
-no-acpi \
-boot c \
--device pci-ohci,id=usb,bus=pci,addr=0x1 \
+-usb \
-chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,reg=0x30000000
--
2.7.4
8 years, 5 months