[libvirt] [PATCH] netdev: fix build on non-Linux
by Roman Bogorodskiy
Fix some typos in the source code:
- Missplaced ")",
- virNetDevVLanPtr -> virNetDevVlanPtr
---
I'm NOT pushing that under the build breaker rule right now because
I also have some other build failures and syntax-checking failing, so I
cannot do a complete test build.
src/util/virnetdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 598d1c61a..47e2b20d5 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -316,7 +316,7 @@ virNetDevSetMACInternal(const char *ifname,
ret = 0;
cleanup:
- VIR_DEBUG("SIOCSIFLLADDR %s MAC=%s - %s", ifname, mac + 1),
+ VIR_DEBUG("SIOCSIFLLADDR %s MAC=%s - %s", ifname, mac + 1,
ret < 0 ? "Fail" : "Success");
VIR_FORCE_CLOSE(s);
@@ -2336,7 +2336,7 @@ virNetDevReadNetConfig(const char *linkdev ATTRIBUTE_UNUSED,
int vf ATTRIBUTE_UNUSED,
const char *stateDir ATTRIBUTE_UNUSED,
virMacAddrPtr *adminMAC ATTRIBUTE_UNUSED,
- virNetDevVLanPtr *vlan ATTRIBUTE_UNUSED,
+ virNetDevVlanPtr *vlan ATTRIBUTE_UNUSED,
virMacAddrPtr *MAC ATTRIBUTE_UNUSED)
{
virReportSystemError(ENOSYS, "%s",
--
2.11.0
7 years, 9 months
[libvirt] [PATCH] news: Update after recent commits
by Peter Krempa
Mention the hyperv notifier and the new API to set block thresholds.
---
docs/news.xml | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index 814bd93fd..2dbd2335d 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -70,6 +70,20 @@
introducing a new host device type in the XML.
</description>
</change>
+ <change>
+ <summary>
+ Add support for block device threshold event
+ </summary>
+ <description>
+ When using thin provisioning, management tools need to resize the
+ disk in certain cases. To avoid having them to poll disk usage
+ this version introduces an event which will be fired when a given
+ offset of the storage is written by the hypervisor. Together with the
+ API it allows registering thresholds for given storage backing
+ volumes and this event will then notify management if the threshold
+ is exceeded. Currently only the qemu driver supports this.
+ </description>
+ </change>
</section>
<section title="Improvements">
<change>
@@ -94,6 +108,17 @@
applications running on the platform.
</description>
</change>
+ <change>
+ <summary>
+ Write hyperv crash information into vm log
+ </summary>
+ <description>
+ qemu's implementation of the hyperv panic notifier now reports
+ information about the crash from the guest os. Libvirt starting from
+ this version logs the information to the vm log file for possible
+ debugging.
+ </description>
+ </change>
</section>
<section title="Bug fixes">
<change>
--
2.12.1
7 years, 9 months
[libvirt] [PATCH 0/2] More simple fixes.
by John Ferlan
One noted after push w/r/t change in news.xml and the other found after
I rebased to current head from recent commit.
John Ferlan (2):
news: Add <change> lost in merge
util: Remove NONNUL from virHostdevReAttachMediatedDevices
docs/news.xml | 2 ++
src/util/virhostdev.h | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
--
2.9.3
7 years, 9 months
[libvirt] [PATCH] virmdev: fix build on non-Linux
by Roman Bogorodskiy
- Make virMediatedDeviceNew() stub args match its prototype
- Fix typo: virRerportError -> virReportError
- Move virMediatedDeviceGetSysfsPath() into #ifdef __linux__ block as
it uses MDEV_SYSFS_DEVICES, and a stub for it
---
I'm not pushing this one too, until I get a completely clean build.
src/util/virmdev.c | 39 ++++++++++++++++++++++++---------------
1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a/src/util/virmdev.c b/src/util/virmdev.c
index e924af3c1..e49ea18e5 100644
--- a/src/util/virmdev.c
+++ b/src/util/virmdev.c
@@ -170,15 +170,34 @@ virMediatedDeviceNew(const char *uuidstr, virMediatedDeviceModelType model)
return ret;
}
+
+char *
+virMediatedDeviceGetSysfsPath(const char *uuidstr)
+{
+ char *ret = NULL;
+
+ ignore_value(virAsprintf(&ret, MDEV_SYSFS_DEVICES "%s", uuidstr));
+ return ret;
+}
+
#else
virMediatedDevicePtr
-virMediatedDeviceNew(virPCIDeviceAddressPtr pciaddr ATTRIBUTE_UNUSED,
- const char *uuidstr ATTRIBUTE_UNUSED)
+virMediatedDeviceNew(const char *uuidstr ATTRIBUTE_UNUSED,
+ virMediatedDeviceModelType model ATTRIBUTE_UNUSED)
{
- virRerportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("mediated devices are not supported on non-linux "
- "platforms"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("mediated devices are not supported on non-linux "
+ "platforms"));
+ return NULL;
+}
+
+char *
+virMediatedDeviceGetSysfsPath(const char *uuidstr ATTRIBUTE_UNUSED)
+{
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("mediated devices are not supported on non-linux "
+ "platforms"));
return NULL;
}
@@ -423,16 +442,6 @@ virMediatedDeviceIsUsed(virMediatedDevicePtr dev,
}
-char *
-virMediatedDeviceGetSysfsPath(const char *uuidstr)
-{
- char *ret = NULL;
-
- ignore_value(virAsprintf(&ret, MDEV_SYSFS_DEVICES "%s", uuidstr));
- return ret;
-}
-
-
int
virMediatedDeviceListMarkDevices(virMediatedDeviceListPtr dst,
virMediatedDeviceListPtr src,
--
2.11.0
7 years, 9 months
[libvirt] [PATCH] network: better validation of devices in hostdev network pool
by Laine Stump
This adds a few validations to the devices listed for a hostdev network:
* devices must be listed by PCI address, not by netdev name
* listing a device by PCI address is valid only for hostdev networks, not
for other types of network (e.g. macvtap passthrough).
* each device in a hostdev pool must be an SR-IOV VF
Resolves: https://bugzilla.redhat.com/1004676
---
src/network/bridge_driver.c | 47 ++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 44 insertions(+), 3 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 3a7a249..3270dc5 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -3224,14 +3224,55 @@ networkValidate(virNetworkDriverStatePtr driver,
* the type of each.
*/
for (i = 0; i < def->forward.nifs; i++) {
- switch ((virNetworkForwardHostdevDeviceType)
- def->forward.ifs[i].type) {
+ virNetworkForwardIfDefPtr iface = &def->forward.ifs[i];
+ char *sysfs_path = NULL;
+
+ switch ((virNetworkForwardHostdevDeviceType) iface->type) {
case VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_NETDEV:
usesInterface = true;
+
+ if (def->forward.type == VIR_NETWORK_FORWARD_HOSTDEV) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("hostdev network '%s' lists '%s' "
+ "in the device pool, but hostdev "
+ "networks require all devices to "
+ "be listed by PCI address, not "
+ "network device name"),
+ def->name, iface->device.dev);
+ return -1;
+ }
break;
- case VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_PCI:
+
+ case VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_PCI: {
usesAddress = true;
+
+ if (def->forward.type != VIR_NETWORK_FORWARD_HOSTDEV) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("network '%s' has forward mode '%s' "
+ " but lists a device by PCI address "
+ "in the device pool. This is only "
+ "supported for networks with forward "
+ "mode 'hostdev'"),
+ def->name,
+ virNetworkForwardTypeToString(def->forward.type));
+ return -1;
+ }
+
+ if (virPCIDeviceAddressGetSysfsFile(&iface->device.pci, &sysfs_path) < 0)
+ return -1;
+
+ if (!virPCIIsVirtualFunction(sysfs_path)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("device '%s' in network '%s' is not "
+ "an SR-IOV Virtual Function"),
+ sysfs_path, def->name);
+ VIR_FREE(sysfs_path);
+ return -1;
+ }
+ VIR_FREE(sysfs_path);
break;
+ }
+
case VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_NONE:
case VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_LAST:
break;
--
2.9.3
7 years, 9 months
[libvirt] [PATCH 0/3] Build and other fixes
by Martin Kletzander
So I broke the build on non-Linux. Sorry. But I did that *because* I
was considering other platforms in the code. Also there was a bad
dereference somewhere. So because it's three patches, I'm rather
sending it for review than just pushing it.
Martin Kletzander (3):
tests: Properly dereference cpus pointer in virnumamock.c
virhostcpu: Expose virHostCPUGetOnline on non-Linux
virhostcpu: Make only defined symbols available
src/util/virhostcpu.c | 35 +++++++++++++++++------------------
src/util/virhostcpu.h | 5 ++++-
tests/virnumamock.c | 2 +-
3 files changed, 22 insertions(+), 20 deletions(-)
--
2.12.1
7 years, 9 months
[libvirt] [PATCH] logical: Need to overwrite/clear more than just first 512 bytes
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1430679
As it turns out some file headers (e.g. ext4) may be larger/longer than
the 512 bytes of zeros being written prior to a pvcreate, so let's write
out 2048 bytes similar to how the pvcreate sources would peek at the first
4 sectors of the device.
Make sure there is at enough bytes on the device to clear before doing
doing the clear - just to be sure.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/storage/storage_backend_logical.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
index 29d63b1..9ca6fd4 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -93,7 +93,8 @@ static int
virStorageBackendLogicalInitializeDevice(const char *path)
{
int fd = -1;
- char zeros[PV_BLANK_SECTOR_SIZE] = {0};
+ char zeros[4 * PV_BLANK_SECTOR_SIZE] = {0};
+ off_t size;
int ret = -1;
virCommandPtr pvcmd = NULL;
@@ -107,6 +108,25 @@ virStorageBackendLogicalInitializeDevice(const char *path)
return -1;
}
+ if ((size = lseek(fd, 0, SEEK_END)) == (off_t)-1) {
+ virReportSystemError(errno,
+ _("failed to seek to end of %s"), path);
+ goto cleanup;
+ }
+
+ if (size < 4 * PV_BLANK_SECTOR_SIZE) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+ _("cannot initialize '%s' detected size='%lu' less "
+ "than minimum required='%d"),
+ path, size, 4 * PV_BLANK_SECTOR_SIZE);
+ goto cleanup;
+ }
+ if ((size = lseek(fd, 0, SEEK_SET)) == (off_t)-1) {
+ virReportSystemError(errno,
+ _("failed to seek to start of %s"), path);
+ goto cleanup;
+ }
+
if (safewrite(fd, zeros, sizeof(zeros)) < 0) {
virReportSystemError(errno, _("cannot clear device header of '%s'"),
path);
--
2.9.3
7 years, 9 months
[libvirt] [PATCH 0/2] Fix syntax check
by Jiri Denemark
Jiri Denemark (2):
build: Fix sc_prohibit_exit_in_tests syntax check
build: Fix syntax check in VPATH
cfg.mk | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--
2.12.2
7 years, 9 months
[libvirt] [PATCH] qemu: command: align disk serial check to schema
by Nikolay Shirokovskiy
Disk serial schema has extra '.+' allowed characters in comparison
with check in code. Looks like there is no reason for that as qemu
allows any character AFAIK for serial. This discrepancy is originated
in 85d15b51 where ability to add serial was added.
---
src/qemu/qemu_command.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index c76f923..c5369b0 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -432,7 +432,7 @@ qemuBuildIoEventFdStr(virBufferPtr buf,
}
#define QEMU_SERIAL_PARAM_ACCEPTED_CHARS \
- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_ "
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_ .+"
static int
qemuSafeSerialParamValue(const char *value)
--
1.8.3.1
7 years, 9 months