[libvirt] [PATCH 0/6] auto-assign addresses when <address type='pci'/> is specified
by Laine Stump
This is an alternative to Cole's series that permits <address
type='pci'/> to force assignment of a PCI address, which is
particularly useful on platforms that could connect the same device in
different ways (e.g. aarch64/virt).
Here is Cole's last iteration of the series:
https://www.redhat.com/archives/libvir-list/2016-May/msg01088.html
I had expressed a dislike of the "auto_allocate" flag that his series
temporarily adds to the address (while simultaneously changing the
address type to NONE) and suggested just changing all the necessary
places to check for a valid PCI address instead of just checking the
address type. He replied that this wasn't as simple as it looked, so I
decided to try it; turns out he's right. But I still like this method
better because it's not playing tricks with the address type, or
adding a temporary private attribute to what should be pure config
data.
Your opinion may vary though :-)
Note that patch 5/6 incorporates the same test case that Cole used in
his penultimate patch, and I've added his patch to check the case of
aarch64 at the end as well.
Cole Robinson (1):
tests: qemu: test <address type='pci'/> with aarch64
Laine Stump (5):
conf: move virDomainDeviceInfo definition from domain_conf.h to
device_conf.h
conf: new functions to check if PCI address is wanted/present
conf: allow type='pci' addresses with no address attributes specified
bhyve: auto-assign addresses when <address type='pci'/> is specified
qemu: auto-assign addresses when <address type='pci'/> is specified
docs/schemas/basictypes.rng | 8 +-
src/bhyve/bhyve_device.c | 10 +-
src/conf/device_conf.c | 6 +-
src/conf/device_conf.h | 132 ++++++++++++++++++++-
src/conf/domain_addr.c | 2 +-
src/conf/domain_conf.c | 13 +-
src/conf/domain_conf.h | 129 --------------------
src/qemu/qemu_domain_address.c | 64 +++++-----
...l2argv-aarch64-virtio-pci-manual-addresses.args | 4 +-
...ml2argv-aarch64-virtio-pci-manual-addresses.xml | 5 +
.../qemuxml2argv-pci-autofill-addr.args | 25 ++++
.../qemuxml2argv-pci-autofill-addr.xml | 35 ++++++
tests/qemuxml2argvtest.c | 1 +
...2xmlout-aarch64-virtio-pci-manual-addresses.xml | 5 +
.../qemuxml2xmlout-pci-autofill-addr.xml | 41 +++++++
tests/qemuxml2xmltest.c | 1 +
16 files changed, 298 insertions(+), 183 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autofill-addr.xml
--
2.5.5
8 years, 3 months
[libvirt] [PATCH 0/9] add ACL checks to vz driver
by Nikolay Shirokovskiy
First (patches 1 - 8) prepare driver to add checks.
Nikolay Shirokovskiy (9):
vz: expand start/stop/... APIs for ACL checks
vz: implement plain create API thru createFlags instead of visa versa
vz: factor out block stats impl
vz: factor out converting block stats to params
vz: add missing flagged versions of API functions
vz: expand setting memory API calls
vz: prepare migration for ACL checks
remote: rename protocol names for close callbacks
vz: add ACL checks to API calls
daemon/remote.c | 4 +-
src/Makefile.am | 5 +-
src/check-aclrules.pl | 1 +
src/remote/remote_driver.c | 4 +-
src/remote/remote_protocol.x | 8 +-
src/vz/vz_driver.c | 889 +++++++++++++++++++++++++++++++++++--------
src/vz/vz_sdk.c | 172 ++++-----
src/vz/vz_sdk.h | 23 +-
8 files changed, 828 insertions(+), 278 deletions(-)
--
1.8.3.1
8 years, 3 months
[libvirt] Question about virtio-pci in Aarch64
by Kevin Zhao
Hi Cole && All,
Nice meeting you in the libvirt mail-list. Greetings from Linaro !!!
I am Kevin Zhao from Linaro and working for OpenStack on Aarch64.
Nowadays I find that the default "virtio" bus is "virtio-mmio" , not
"virtio-pci". Since virtio-mmio do not has the host plugged function ,
something is wrong with the function in OpenStack Nova.
Then I search and find some mail information as belows by Cole :-)
1)
https://www.redhat.com/archives/libvir-list/2015-December/msg00217.html
2)
https://www.redhat.com/archives/libvir-list/2016-March/msg00167.html
I see some efforts have been doing by you. Really thanks for your
efforts for Aarch64. And I have some small questions.
1. Is Libvirt planning to replace the default virtio-mmio to
virtio-pci for Aarch64?
2. If not , how can I change the xml file(generated by Virsh) for
virtio-pci so that Qemu can recognize it ?
Really big thanks for your help. Looking forwards to your response!
Best Regards,
Kevin Zhao
8 years, 3 months
[libvirt] [PATCH 0/2] vz: add getting job info for migration
by Nikolay Shirokovskiy
Nikolay Shirokovskiy (2):
vz: add getting job info for migration
vz: add vzDomainGetJobStats
src/vz/vz_driver.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++
src/vz/vz_sdk.c | 31 +++++++++++++++
src/vz/vz_utils.c | 42 ++++++++++++++++----
src/vz/vz_utils.h | 17 +++++++-
4 files changed, 194 insertions(+), 9 deletions(-)
--
1.8.3.1
8 years, 4 months
[libvirt] [PATCH V2 0/7] libxl: add support of pvusb controller
by Chunyan Liu
This patch series is to add pvusb controller support in libxl driver.
It should be applied on previous pvusb device support patch series.
---
Changes:
* drop pvusb1 and pvusb2 model
* add check in qemu device post-parse to report error of
unsupported 'qusb1' and 'qusb2' model
Chunyan Liu (7):
extend usb controller model to support xen pvusb
libxl: support USB controllers in creation time
libxl: support usb controller hotplug
libxl: check available controller and port when hotplugging USB device
xenconfig: add conversion of usb controller config to and from xml
xlconfigtest: add test for usb controller conversion
qemuDomainDeviceDefPostParse: add USB controller model check
docs/formatdomain.html.in | 4 +-
docs/schemas/domaincommon.rng | 2 +
src/conf/domain_conf.c | 2 +
src/conf/domain_conf.h | 2 +
src/libxl/libxl_conf.c | 84 ++++++++++++++++
src/libxl/libxl_conf.h | 4 +
src/libxl/libxl_driver.c | 176 +++++++++++++++++++++++++++++++++
src/qemu/qemu_command.c | 2 +
src/qemu/qemu_domain.c | 13 +++
src/xenconfig/xen_xl.c | 190 ++++++++++++++++++++++++++++++++++++
tests/xlconfigdata/test-usbctrl.cfg | 13 +++
tests/xlconfigdata/test-usbctrl.xml | 31 ++++++
tests/xlconfigtest.c | 1 +
13 files changed, 523 insertions(+), 1 deletion(-)
create mode 100644 tests/xlconfigdata/test-usbctrl.cfg
create mode 100644 tests/xlconfigdata/test-usbctrl.xml
--
2.1.4
8 years, 4 months
[libvirt] [PATCH python] allow pkg-config binary to be set by env
by Cole Robinson
From: Markus Rothe <markusr815(a)gmail.com>
https://bugzilla.redhat.com/show_bug.cgi?id=1350523
---
setup.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/setup.py b/setup.py
index 099b1e0..a4cfb88 100755
--- a/setup.py
+++ b/setup.py
@@ -28,6 +28,8 @@ _pkgcfg = -1
def get_pkgcfg(do_fail=True):
global _pkgcfg
if _pkgcfg == -1:
+ _pkgcfg = os.getenv('PKG_CONFIG')
+ if _pkgcfg is None:
_pkgcfg = distutils.spawn.find_executable("pkg-config")
if _pkgcfg is None and do_fail:
raise Exception("pkg-config binary is required to compile libvirt-python")
--
2.7.4
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] nodedev: Add retry logic to read fibre channel files
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1319544
During processing of a vport_create event, udevEventHandleCallback
will call udevProcessSCSIHost to read the fibre channel configuration
files for wwpn, wwpn, and fabric_wwn; however, as it turns out those
files may not have valid data. Rather than carry around invalid data,
add some logic to re-read the files up to 5 times. If after 5 attempts
things still fail, don't hold up processing any longer.
The "ffffffffffffffff" value is what seems to be used to initialize the
wwnn and wwpn files, while "0" or "ffffffffffffffff" have been used to
initialize the fabric_wwn file (see bz 1240912 for some details).
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
This has been hanging in a local branch for a while. Figured I'd at the
very least get some feedback and thoughts from others as to whether it's
worth making the adjustments. Lots of details in the bz, the essentially
the tester is bypassing the libvirt create vport mechanism, then wants to
use the libvirt delete vHBA; however, the timing of things seems to have
gotten clogged up and not all the fields in the vHBA are read properly
thus the deletion cannot be done. A workaround to the issue is to run
nodedev-dumpxml on the vHBA again and the data is read properly. This patch
went with a retry mechanism to try and ensure the data we've read is
correct. I'm a bit ambivalent about this, but it doesn't hurt to ask...
src/node_device/node_device_driver.c | 4 ++--
src/node_device/node_device_linux_sysfs.c | 25 +++++++++++++++++++++++++
src/node_device/node_device_udev.c | 9 ++++++++-
3 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index 500caeb..838b3ee 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -53,7 +53,7 @@ static int update_caps(virNodeDeviceObjPtr dev)
while (cap) {
switch (cap->data.type) {
case VIR_NODE_DEV_CAP_SCSI_HOST:
- nodeDeviceSysfsGetSCSIHostCaps(&dev->def->caps->data);
+ ignore_value(nodeDeviceSysfsGetSCSIHostCaps(&dev->def->caps->data));
break;
case VIR_NODE_DEV_CAP_NET:
if (virNetDevGetLinkInfo(cap->data.net.ifname, &cap->data.net.lnk) < 0)
@@ -292,7 +292,7 @@ nodeDeviceLookupSCSIHostByWWN(virConnectPtr conn,
while (cap) {
if (cap->data.type == VIR_NODE_DEV_CAP_SCSI_HOST) {
- nodeDeviceSysfsGetSCSIHostCaps(&cap->data);
+ ignore_value(nodeDeviceSysfsGetSCSIHostCaps(&cap->data));
if (cap->data.scsi_host.flags &
VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST) {
if (STREQ(cap->data.scsi_host.wwnn, wwnn) &&
diff --git a/src/node_device/node_device_linux_sysfs.c b/src/node_device/node_device_linux_sysfs.c
index 549d32c..9363487 100644
--- a/src/node_device/node_device_linux_sysfs.c
+++ b/src/node_device/node_device_linux_sysfs.c
@@ -41,6 +41,21 @@
VIR_LOG_INIT("node_device.node_device_linux_sysfs");
+
+/* nodeDeviceSysfsGetSCSIHostCaps:
+ * @d: Pointer to node device capabilities
+ *
+ * Read the various 'scsi_host' files for the device and fill in
+ * the relevant data for our internal representation. It is possible
+ * that the environment isn't completely setup or "stable" when we
+ * go to read, so check for invalid values and fail on those. In
+ * particular, if the wwnn or wwpn are read in as ffffffffffffffff
+ * or the fabric_wwn is read as 0 or ffffffffffffffff, then we need
+ * to force a retry.
+ *
+ * Returns 0 on success, -1 on bad failure, -2 on failure to indicate
+ * to retry
+ */
int
nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapDataPtr d)
{
@@ -83,6 +98,16 @@ nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapDataPtr d)
d->scsi_host.host);
goto cleanup;
}
+
+ if (STREQ(d->scsi_host.wwnn, "ffffffffffffffff") ||
+ STREQ(d->scsi_host.wwpn, "ffffffffffffffff") ||
+ STREQ(d->scsi_host.fabric_wwn, "0") ||
+ STREQ(d->scsi_host.fabric_wwn, "ffffffffffffffff")) {
+ VIR_WARN("Failed to get valid wwnn, wwpn, or fabric_wwn for host%d",
+ d->scsi_host.host);
+ ret = -2;
+ goto cleanup;
+ }
}
if (virIsCapableVport(NULL, d->scsi_host.host)) {
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 76c60ea..54c9e58 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -523,6 +523,7 @@ static int udevProcessSCSIHost(struct udev_device *device ATTRIBUTE_UNUSED,
virNodeDevCapDataPtr data = &def->caps->data;
char *filename = NULL;
char *str;
+ int retry = 5;
filename = last_component(def->sysfs_path);
@@ -534,7 +535,13 @@ static int udevProcessSCSIHost(struct udev_device *device ATTRIBUTE_UNUSED,
return -1;
}
- nodeDeviceSysfsGetSCSIHostCaps(&def->caps->data);
+ while (retry--) {
+ if (nodeDeviceSysfsGetSCSIHostCaps(&def->caps->data) == -2) {
+ sleep(1);
+ continue;
+ }
+ break;
+ }
if (udevGenerateDeviceName(device, def, NULL) != 0)
return -1;
--
2.5.5
8 years, 4 months
[libvirt] [PATCH] qemu: bugfix: don't fail if disk media removed on second attempt
by Nikolay Shirokovskiy
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
src/qemu/qemu_hotplug.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index e0b8230..5bbfb5e 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -267,12 +267,12 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
format);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
goto cleanup;
+
+ if (rc < 0)
+ goto error;
}
- virDomainAuditDisk(vm, disk->src, newsrc, "update", rc >= 0);
-
- if (rc < 0)
- goto error;
+ virDomainAuditDisk(vm, disk->src, newsrc, "update", true);
/* remove the old source from shared device list */
ignore_value(qemuRemoveSharedDisk(driver, disk, vm->def->name));
--
1.8.3.1
8 years, 4 months
[libvirt] [RFC PATCH 0/2] nodeinfo: PPC64: Fix topology and siblings info on capabilities and nodeinfo
by Shivaprasad G Bhat
The nodeinfo output was fixed earlier to reflect the actual cpus available in
KVM mode on PPC64. The earlier fixes covered the aspect of not making a host
look overcommitted when its not. The current fixes are aimed at helping the
users make better decisions on the kind of guest cpu topology that can be
supported on the given sucore_per_core setting of KVM host and also hint the
way to pin the guest vcpus efficiently.
I am planning to add some test cases once the approach is accepted.
With respect to Patch 2:
The second patch adds a new element to the cpus tag and I need your inputs on
if that is okay. Also if there is a better way. I am not sure if the existing
clients have RNG checks that might fail with the approach. Or if the checks
are not enoforced on the elements but only on the tags.
With my approach if the rng checks pass, the new element "capacity" even if
ignored by many clients would have no impact except for PPC64.
To the extent I looked at code, the siblings changes dont affect existing
libvirt functionality. Please do let me know otherwise.
---
Shivaprasad G Bhat (2):
nodeinfo: Reflect guest usable host topology on PPC64
Introduce capacity to virCapsHostNUMACellCPU to help vcpu pinning decisions
src/conf/capabilities.c | 3 +
src/conf/capabilities.h | 1
src/nodeinfo.c | 51 ++++++++++++++++++++++--
tests/vircaps2xmldata/vircaps-basic-4-4-2G.xml | 32 ++++++++-------
tests/vircaps2xmltest.c | 1
5 files changed, 67 insertions(+), 21 deletions(-)
--
Signature
8 years, 4 months