[libvirt] [PATCH 0/7] PCI Multifunction device hotplug support
by Shivaprasad G Bhat
The series implements the PCI multifunction hotplug functionality.
The first two patch reverts the old commits which forbade the
multifunction addresses. Patch2 is added because the two reverts
necessiates additional checks added in Patch3.
Actual implementation starts patch 4 onwards.
The semantics is to encapsulate all the functions in <devices/>
tag as was previously explained.
(http://www.spinics.net/linux/fedora/libvir/msg127921.html
The series aims to support virtio devices also the hostdevices
in the <devices>.
The auto addess assignment is implemented here works well
for ppc64 and pc-i440fx machines. Couldn't get it working
on q35 machines. May be follow up patches for that.
Todo:
1) Rollback the Hotplug of already hoplugged functions if any of
the function hotplug fails.
2) Hardening the hotplug checks to disallow multifunction cards
hotplug as though they are single function cards.
3) Documentation update.
4) Patch 6 may need some work across drivers to add similar
checks as added in qemu_driver.c
5) Test cases.
---
Shivaprasad G Bhat (7):
Revert "prevent hot unplugging multi function PCI device"
Release address in function granularity than slot
Validate address in virDomainPCIAddressReleaseAddr
Introduce PCI Multifunction device parser
Introduce virDomainPCIMultifunctionDeviceAddressAssign
Allow calling virHostdevPreparePCIDevices twice for same device
Enable PCI Multifunction hotplug/unplug
src/conf/domain_addr.c | 244 ++++++++++++++++++++++++++++-
src/conf/domain_addr.h | 4
src/conf/domain_conf.c | 227 +++++++++++++++++++++++++++
src/conf/domain_conf.h | 22 +++
src/libvirt_private.syms | 5 +
src/qemu/qemu_domain_address.c | 2
src/qemu/qemu_driver.c | 331 ++++++++++++++++++++++++++++++++--------
src/qemu/qemu_hotplug.c | 74 ++-------
src/util/virhostdev.c | 16 ++
9 files changed, 781 insertions(+), 144 deletions(-)
--
Signature
8 years, 7 months
[libvirt] [PATCH 0/7] PCI Multifunction device hotplug support
by Shivaprasad G Bhat
The series implements the PCI multifunction hotplug functionality.
The first two patch reverts the old commits which forbade the
multifunction addresses. Patch2 is added because the two reverts
necessiates additional checks added in Patch3.
Actual implementation starts patch 4 onwards.
The semantics is to encapsulate all the functions in <devices/>
tag as was previously explained.
(http://www.spinics.net/linux/fedora/libvir/msg127921.html)
The series aims to support virtio devices and also the hostdevices
in the <devices>.
Auto-address assignment is implemented here works well
for ppc64 and pc-i440fx machines. Couldn't get it working
on q35 machines. May be follow up patches for that.
TODO:
1) Rollback the Hotplug of already hoplugged functions if any of
the function hotplug fails.
2) Hardening the hotplug checks to disallow multifunction cards
hotplug as though they are single function cards.
3) Documentation update.
4) Patch 6 may need some work across drivers to add similar
checks as added in qemu_driver.c
5) Test cases.
---
Shivaprasad G Bhat (7):
Revert "prevent hot unplugging multi function PCI device"
Release address in function granularity than slot
Validate address in virDomainPCIAddressReleaseAddr
Introduce PCI Multifunction device parser
Introduce virDomainPCIMultifunctionDeviceAddressAssign
Allow calling virHostdevPreparePCIDevices twice for same device
Enable PCI Multifunction hotplug/unplug
src/conf/domain_addr.c | 244 ++++++++++++++++++++++++++++-
src/conf/domain_addr.h | 4
src/conf/domain_conf.c | 227 +++++++++++++++++++++++++++
src/conf/domain_conf.h | 22 +++
src/libvirt_private.syms | 5 +
src/qemu/qemu_domain_address.c | 2
src/qemu/qemu_driver.c | 331 ++++++++++++++++++++++++++++++++--------
src/qemu/qemu_hotplug.c | 74 ++-------
src/util/virhostdev.c | 16 ++
9 files changed, 781 insertions(+), 144 deletions(-)
--
Signature
8 years, 7 months
[libvirt] [PATCH] bhyve: implement virConnectIsAlive
by Fabian Freyer
bhyve connections are local, and a "connection will be classed as alive
if it is [...] local".
---
src/bhyve/bhyve_driver.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index c3c572e..8b41f7a 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -1517,6 +1517,11 @@ bhyveConnectGetType(virConnectPtr conn)
return "BHYVE";
}
+static int bhyveConnectIsAlive(virConnectPtr conn ATTRIBUTE_UNUSED)
+{
+ return 1;
+}
+
static virHypervisorDriver bhyveHypervisorDriver = {
.name = "bhyve",
.connectOpen = bhyveConnectOpen, /* 1.2.2 */
@@ -1567,6 +1572,7 @@ static virHypervisorDriver bhyveHypervisorDriver = {
.connectDomainEventDeregisterAny = bhyveConnectDomainEventDeregisterAny, /* 1.2.5 */
.domainHasManagedSaveImage = bhyveDomainHasManagedSaveImage, /* 1.2.13 */
.connectGetType = bhyveConnectGetType, /* 1.3.5 */
+ .connectIsAlive = bhyveConnectIsAlive, /* 1.3.5 */
};
--
2.1.4
8 years, 7 months
[libvirt] [PATCH] qemuxml2argvtest: uncoditionally mock NUMA routines
by Roman Bogorodskiy
Currently, qemuxml2argvmock.c only mocks virNumaNodeIsAvailable(), and
only if libvirt was built with NUMA support. This causes some test
failures where NUMA is involved.
For example, memory-hotplug-dimm fails because it goes all they way down
to qemuBuildMemoryBackendStr() that calls virNumaNodesetIsAvailable()
for a user specified nodeset and fails, hence the test (unexpectedly)
fails.
To make qemuxml2argtest successfully run on non-NUMA platforms, do the
following:
- mock virNumaNodeIsAvailable() unconditionally
- add a mock for virNumaNodesetIsAvailable()
---
tests/qemuxml2argvmock.c | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c
index 1616eed..57e56ab 100644
--- a/tests/qemuxml2argvmock.c
+++ b/tests/qemuxml2argvmock.c
@@ -56,17 +56,28 @@ virNumaGetMaxNode(void)
return maxnodesNum;
}
-#if WITH_NUMACTL && HAVE_NUMA_BITMASK_ISBITSET
-/*
- * In case libvirt is compiled with full NUMA support, we need to mock
- * this function in order to fake what numa nodes are available.
- */
bool
virNumaNodeIsAvailable(int node)
{
return node >= 0 && node <= virNumaGetMaxNode();
}
-#endif /* WITH_NUMACTL && HAVE_NUMA_BITMASK_ISBITSET */
+
+bool
+virNumaNodesetIsAvailable(virBitmapPtr nodeset ATTRIBUTE_UNUSED)
+{
+ ssize_t bit = -1;
+
+ if (!nodeset)
+ return true;
+
+ while ((bit = virBitmapNextSetBit(nodeset, bit)) >= 0) {
+ if (virNumaNodeIsAvailable(bit))
+ continue;
+
+ return false;
+ }
+ return true;
+}
char *
virTPMCreateCancelPath(const char *devpath)
--
2.7.4
8 years, 7 months
[libvirt] [PATCH 0/2] Address some recent coverity
by John Ferlan
The first patch is a noise cleaner, while the second one fixes a real leak.
Also anyone with desire to 'debug' a build environment - seems when the
STATIC_ANALYSIS is true, the building of the docs (apibuild.py[.stamp])
fails in a rather spectacular mess. I can avoid building docs, but it's
not clear to me what the failure is...
John Ferlan (2):
qemu: More qemu_monitor_json cleanups
libxl: Resolve Coverity RESOURCE_LEAK
src/libxl/libxl_migration.c | 5 ++++-
src/qemu/qemu_monitor_json.c | 46 ++++++++++++++++++++++++--------------------
2 files changed, 29 insertions(+), 22 deletions(-)
--
2.5.5
8 years, 7 months
[libvirt] [PATCH v2 0/4] domain: Support <address type='pci'/> allocation
by Cole Robinson
This patch series allows the user to specify bare device
<address type='pci'/> to explicitly request PCI address allocation.
It's only wired up for qemu, and explicitly errors for all other
drivers.
This has several uses, but the motivating one is providing an
easy way to request PCI address allocation where it normally isn't
the default address type, like for aarch64 VMs.
v1 posting was here:
http://www.redhat.com/archives/libvir-list/2016-March/msg00268.html
This series depends on calling qemuDomainAssignAddresses from
PostParse:
http://www.redhat.com/archives/libvir-list/2016-May/msg01075.html
Changes since v1:
- Rebased to master
- Dropped patches that were merged
- Split out AssignAddress bits to their own series
- Add formatdomain docs
Cole Robinson (4):
util: xml: add virXMLPropertyCount
domain: Make <address type='pci'/> request address allocation
qemu: Wire up address type=pci auto_allocate
tests: qemu: test <address type='pci'/> with aarch64
docs/formatdomain.html.in | 5 ++-
docs/schemas/domaincommon.rng | 5 ++-
src/conf/domain_conf.c | 30 +++++++++++++-
src/conf/domain_conf.h | 1 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_domain_address.c | 47 ++++++++++++++++++++++
src/util/virxml.c | 17 ++++++++
src/util/virxml.h | 1 +
.../generic-pci-autofill-addr.xml | 27 +++++++++++++
tests/genericxml2xmltest.c | 3 ++
...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 +
18 files changed, 250 insertions(+), 4 deletions(-)
create mode 100644 tests/genericxml2xmlindata/generic-pci-autofill-addr.xml
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.7.4
8 years, 7 months
[libvirt] [PATCH v3 0/6] qemu: handle ',' and '=' in VM name
by Cole Robinson
This series adds qemu cli comma escaping to several places that
are dependent on the VM name, to enable names with embedded commas.
Patch 6 makes use of qemu -name guest=X value to allow names with
'=' in them.
https://bugzilla.redhat.com/show_bug.cgi?id=639926
https://bugzilla.redhat.com/show_bug.cgi?id=1276485
Note: There's likely other places that are VM name dependent that need
comma escaping too, but this hits the mandatory ones. I've listed some
more on the BiteSizedTasks page:
http://wiki.libvirt.org/page/BiteSizedTasks#qemu:_Use_comma_escaping_for_...
v3:
Patch 1 and patch 4 are new
Cole Robinson (6):
qemu: command: Add qemuBufferEscapeComma
qemu: command: escape commas in VM name
qemu: command: escape commas in secret master path
qemu: command: escape commas in VNC socket path
qemu: command: escape commas in chardev socket path
qemu: command: Use -name guest= if available
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 50 ++++++++++++++++------
tests/qemucapabilitiesdata/caps_2.1.1-1.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.4.0-1.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.5.0-1.x86_64.xml | 1 +
.../qemucapabilitiesdata/caps_2.6.0-1.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_2.6.0-1.ppc64le.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0-1.x86_64.xml | 1 +
.../qemucapabilitiesdata/caps_2.6.0-2.aarch64.xml | 1 +
tests/qemucaps2xmldata/all_1.6.0-1.caps | 1 +
tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps | 1 +
.../qemuxml2argvdata/qemuxml2argv-name-escape.args | 25 +++++++++++
.../qemuxml2argvdata/qemuxml2argv-name-escape.xml | 19 ++++++++
tests/qemuxml2argvtest.c | 3 ++
15 files changed, 96 insertions(+), 13 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-name-escape.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-name-escape.xml
--
2.7.4
8 years, 7 months
[libvirt] [PATCH 0/3] Fix default vram setting for libxl
by Ján Tomko
An alternative to
https://www.redhat.com/archives/libvir-list/2016-May/msg00700.html
1462942877-31516-1-git-send-email-jfehlig(a)suse.com
This series adds a call to DeviceDefPostParse for the implicit video
which is being in the DomainDefPostParse phase, after DeviceDefPostParse
has been done on all the existing devices.
Ján Tomko (3):
Move virDomainDefPostParseInternal after virDomainDeviceDefPostParse
Call per-device post-parse callback even on implicit video
Fill out default vram in DeviceDefPostParse
src/conf/domain_conf.c | 105 ++++++++++++++++++++++--------------------
src/qemu/qemu_parse_command.c | 2 -
2 files changed, 56 insertions(+), 51 deletions(-)
--
2.7.3
8 years, 7 months
[libvirt] [PATCH] admin: Fix passing an incorrect readonly attribute to virNetServerServiceNew
by Erik Skultety
When registering admin UNIX socket, a new service is created for it. This
service is incorrectly initialized to be readonly, which is later inherited by
all clients connected to the socket. In libvirt-admin's case there currently
isn't any use for the attribute anyway, but since the socket has root-only
access permissions, but the least we can do is to make every admin client
connected to it report readonly as false.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
daemon/libvirtd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index cc5190f..f24fb22 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -543,7 +543,7 @@ daemonSetupNetworking(virNetServerPtr srv,
#if WITH_GNUTLS
NULL,
#endif
- true,
+ false,
config->admin_max_queued_clients,
config->admin_max_client_requests)))
goto cleanup;
--
2.5.5
8 years, 7 months
[libvirt] [PATCH] qemu: alias: Remove QEMU_CAPS_DEVICE
by Cole Robinson
QEMU_CAPS_DEVICE is always set nowadays, so drop code that depends
on not-DEVICE
---
src/qemu/qemu_alias.c | 82 +++------------------------------------------------
1 file changed, 4 insertions(+), 78 deletions(-)
diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c
index ade2033..cb102ec 100644
--- a/src/qemu/qemu_alias.c
+++ b/src/qemu/qemu_alias.c
@@ -171,70 +171,11 @@ qemuAssignDeviceControllerAlias(virDomainDefPtr domainDef,
}
-/* Names used before -drive supported the id= option */
-static int
-qemuAssignDeviceDiskAliasFixed(virDomainDiskDefPtr disk)
-{
- int busid, devid;
- int ret;
- char *dev_name;
-
- if (virDiskNameToBusDeviceIndex(disk, &busid, &devid) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot convert disk '%s' to bus/device index"),
- disk->dst);
- return -1;
- }
-
- switch (disk->bus) {
- case VIR_DOMAIN_DISK_BUS_IDE:
- if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK)
- ret = virAsprintf(&dev_name, "ide%d-hd%d", busid, devid);
- else
- ret = virAsprintf(&dev_name, "ide%d-cd%d", busid, devid);
- break;
- case VIR_DOMAIN_DISK_BUS_SCSI:
- if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK)
- ret = virAsprintf(&dev_name, "scsi%d-hd%d", busid, devid);
- else
- ret = virAsprintf(&dev_name, "scsi%d-cd%d", busid, devid);
- break;
- case VIR_DOMAIN_DISK_BUS_FDC:
- ret = virAsprintf(&dev_name, "floppy%d", devid);
- break;
- case VIR_DOMAIN_DISK_BUS_VIRTIO:
- ret = virAsprintf(&dev_name, "virtio%d", devid);
- break;
- case VIR_DOMAIN_DISK_BUS_XEN:
- ret = virAsprintf(&dev_name, "xenblk%d", devid);
- break;
- case VIR_DOMAIN_DISK_BUS_SD:
- ret = virAsprintf(&dev_name, "sd%d", devid);
- break;
- case VIR_DOMAIN_DISK_BUS_USB:
- ret = virAsprintf(&dev_name, "usb%d", devid);
- break;
- default:
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported disk name mapping for bus '%s'"),
- virDomainDiskBusTypeToString(disk->bus));
- return -1;
- }
-
- if (ret == -1)
- return -1;
-
- disk->info.alias = dev_name;
-
- return 0;
-}
-
-
/* Our custom -drive naming scheme used with id= */
-static int
-qemuAssignDeviceDiskAliasCustom(virDomainDefPtr def,
- virDomainDiskDefPtr disk,
- virQEMUCapsPtr qemuCaps)
+int
+qemuAssignDeviceDiskAlias(virDomainDefPtr def,
+ virDomainDiskDefPtr disk,
+ virQEMUCapsPtr qemuCaps)
{
const char *prefix = virDomainDiskBusTypeToString(disk->bus);
int controllerModel = -1;
@@ -276,18 +217,6 @@ qemuAssignDeviceDiskAliasCustom(virDomainDefPtr def,
int
-qemuAssignDeviceDiskAlias(virDomainDefPtr vmdef,
- virDomainDiskDefPtr def,
- virQEMUCapsPtr qemuCaps)
-{
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE))
- return qemuAssignDeviceDiskAliasCustom(vmdef, def, qemuCaps);
- else
- return qemuAssignDeviceDiskAliasFixed(def);
-}
-
-
-int
qemuAssignDeviceHostdevAlias(virDomainDefPtr def,
char **alias,
int idx)
@@ -435,9 +364,6 @@ qemuAssignDeviceAliases(virDomainDefPtr def, virQEMUCapsPtr qemuCaps)
return -1;
}
- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE))
- return 0;
-
for (i = 0; i < def->nfss; i++) {
if (virAsprintf(&def->fss[i]->info.alias, "fs%zu", i) < 0)
return -1;
--
2.7.4
8 years, 7 months