[libvirt] [cim][PATCH 1/2] Fix memory leak in set_other_id_info
by Adam Majer
model was allocated by asprintf but never freed after usage
and assignement.
Signed-off-by: Adam Majer <amajer(a)suse.de>
---
src/Virt_ComputerSystem.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/Virt_ComputerSystem.c b/src/Virt_ComputerSystem.c
index da07f93..b4930ac 100644
--- a/src/Virt_ComputerSystem.c
+++ b/src/Virt_ComputerSystem.c
@@ -417,6 +417,8 @@ static int set_other_id_info(const CMPIBroker *broker,
CMPI_string);
}
+ free(model);
+
CMSetProperty(instance, "OtherIdentifyingInfo",
&id_info, CMPI_stringA);
--
2.13.6
6 years, 11 months
[libvirt] [PATCH] add support of iSER transport type in qemu with libiscsi
by lichstor@gmail.com
From: zhangshengyu <zhangshengyu(a)fusionstack.cn>
---
src/conf/domain_conf.c | 10 ++++++
src/qemu/qemu_block.c | 24 +++++++++++--
src/qemu/qemu_command.c | 3 ++
src/qemu/qemu_parse_command.c | 10 +++++-
src/storage/storage_backend_gluster.c | 1 +
src/util/virstoragefile.c | 3 +-
src/util/virstoragefile.h | 1 +
.../qemuargv2xmldata/disk-drive-network-iser.args | 25 +++++++++++++
tests/qemuargv2xmldata/disk-drive-network-iser.xml | 41 ++++++++++++++++++++++
tests/qemuargv2xmltest.c | 1 +
.../qemuxml2argvdata/disk-drive-network-iser.args | 29 +++++++++++++++
tests/qemuxml2argvdata/disk-drive-network-iser.xml | 37 +++++++++++++++++++
tests/qemuxml2argvtest.c | 1 +
.../qemuxml2xmloutdata/disk-drive-network-iser.xml | 41 ++++++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
15 files changed, 224 insertions(+), 4 deletions(-)
create mode 100644 tests/qemuargv2xmldata/disk-drive-network-iser.args
create mode 100644 tests/qemuargv2xmldata/disk-drive-network-iser.xml
create mode 100644 tests/qemuxml2argvdata/disk-drive-network-iser.args
create mode 100644 tests/qemuxml2argvdata/disk-drive-network-iser.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-drive-network-iser.xml
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9a62bc472..5767575d0 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7080,6 +7080,7 @@ virDomainStorageNetworkParseHosts(xmlNodePtr node,
virStorageNetHostDefPtr *hosts,
size_t *nhosts)
{
+ char *transport = NULL;
xmlNodePtr child;
for (child = node->children; child; child = child->next) {
@@ -7091,6 +7092,11 @@ virDomainStorageNetworkParseHosts(xmlNodePtr node,
}
}
+ if ((*hosts) && (transport = virXMLPropString(node, "transport"))) {
+ //VIR_WARN("missing network source transport type");
+ (*hosts)->transport = virStorageNetHostTransportTypeFromString(transport);
+ }
+
return 0;
}
@@ -8495,6 +8501,7 @@ virDomainDiskSourceNetworkParse(xmlNodePtr node,
if (virDomainStorageNetworkParseHosts(node, &src->hosts, &src->nhosts) < 0)
goto cleanup;
+
virStorageSourceNetworkAssignDefaultPorts(src);
ret = 0;
@@ -22364,6 +22371,9 @@ virDomainDiskSourceFormatNetwork(virBufferPtr attrBuf,
VIR_FREE(path);
+ if (src->hosts->transport == VIR_STORAGE_NET_HOST_TRANS_ISER)
+ virBufferEscapeString(attrBuf, " transport='%s'", "iser");
+
if (src->haveTLS != VIR_TRISTATE_BOOL_ABSENT &&
!(flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE &&
src->tlsFromConfig))
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 585f0255e..49837205f 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -433,6 +433,12 @@ qemuBlockStorageSourceGetURI(virStorageSourcePtr src)
if (VIR_STRDUP(uri->scheme,
virStorageNetProtocolTypeToString(src->protocol)) < 0)
goto cleanup;
+ } else if (src->hosts->transport == VIR_STORAGE_NET_HOST_TRANS_ISER) {
+ uri->port = src->hosts->port;
+
+ if (VIR_STRDUP(uri->scheme,
+ virStorageNetHostTransportTypeToString(src->hosts->transport)) < 0)
+ goto cleanup;
} else {
if (virAsprintf(&uri->scheme, "%s+%s",
virStorageNetProtocolTypeToString(src->protocol),
@@ -506,6 +512,19 @@ qemuBlockStorageSourceBuildJSONSocketAddress(virStorageNetHostDefPtr host,
goto cleanup;
break;
+ case VIR_STORAGE_NET_HOST_TRANS_ISER:
+ transport = "iser";
+ if (virAsprintf(&port, "%u", host->port) < 0)
+ goto cleanup;
+
+ if (virJSONValueObjectCreate(&server,
+ "s:type", transport,
+ "s:host", host->name,
+ "s:port", port,
+ NULL) < 0)
+ goto cleanup;
+ break;
+
case VIR_STORAGE_NET_HOST_TRANS_UNIX:
if (virJSONValueObjectCreate(&server,
"s:type", "unix",
@@ -590,7 +609,8 @@ qemuBlockStorageSourceBuildJSONInetSocketAddress(virStorageNetHostDefPtr host)
virJSONValuePtr ret = NULL;
char *port = NULL;
- if (host->transport != VIR_STORAGE_NET_HOST_TRANS_TCP) {
+ if (host->transport != VIR_STORAGE_NET_HOST_TRANS_TCP &&
+ host->transport != VIR_STORAGE_NET_HOST_TRANS_ISER) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("only TCP protocol can be converted to InetSocketAddress"));
return NULL;
@@ -831,7 +851,7 @@ qemuBlockStorageSourceGetISCSIProps(virStorageSourcePtr src)
"s:portal", portal,
"s:target", target,
"u:lun", lun,
- "s:transport", "tcp",
+ "s:transport", virStorageNetHostTransportTypeToString(src->hosts->transport),
"S:user", username,
"S:password-secret", objalias,
NULL));
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 4d0c141e5..eb482097f 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -883,6 +883,8 @@ qemuBuildNetworkDriveStr(virStorageSourcePtr src,
if (!((src->hosts->name && strchr(src->hosts->name, ':')) ||
(src->hosts->transport == VIR_STORAGE_NET_HOST_TRANS_TCP &&
!src->hosts->name) ||
+ (src->hosts->transport == VIR_STORAGE_NET_HOST_TRANS_ISER &&
+ !src->hosts->name) ||
(src->hosts->transport == VIR_STORAGE_NET_HOST_TRANS_UNIX &&
src->hosts->socket &&
src->hosts->socket[0] != '/'))) {
@@ -891,6 +893,7 @@ qemuBuildNetworkDriveStr(virStorageSourcePtr src,
switch (src->hosts->transport) {
case VIR_STORAGE_NET_HOST_TRANS_TCP:
+ case VIR_STORAGE_NET_HOST_TRANS_ISER:
virBufferAsprintf(&buf, "%s:%u",
src->hosts->name, src->hosts->port);
break;
diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c
index 5fe3f97d0..d376af208 100644
--- a/src/qemu/qemu_parse_command.c
+++ b/src/qemu/qemu_parse_command.c
@@ -70,7 +70,9 @@ qemuParseDriveURIString(virDomainDiskDefPtr def, virURIPtr uri,
if (transp)
*transp++ = 0;
- if (STRNEQ(uri->scheme, scheme)) {
+ if (STREQ(uri->scheme, "iser")) {
+ transp = (char *)"iser";
+ } else if (STRNEQ(uri->scheme, scheme)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid transport/scheme '%s'"), uri->scheme);
goto error;
@@ -709,6 +711,12 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
if (qemuParseISCSIString(def) < 0)
goto error;
+ } else if (STRPREFIX(def->src->path, "iser:")) {
+ def->src->type = VIR_STORAGE_TYPE_NETWORK;
+ def->src->protocol = VIR_STORAGE_NET_PROTOCOL_ISCSI;
+
+ if (qemuParseISCSIString(def) < 0)
+ goto error;
} else if (STRPREFIX(def->src->path, "sheepdog:")) {
char *p = def->src->path;
char *port, *vdi;
diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_backend_gluster.c
index 5eea84f16..1452fa0cd 100644
--- a/src/storage/storage_backend_gluster.c
+++ b/src/storage/storage_backend_gluster.c
@@ -608,6 +608,7 @@ virStorageFileBackendGlusterInitServer(virStorageFileBackendGlusterPrivPtr priv,
hoststr = host->socket;
break;
+ case VIR_STORAGE_NET_HOST_TRANS_ISER:
case VIR_STORAGE_NET_HOST_TRANS_LAST:
break;
}
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 5780180a9..63253a9c4 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -92,7 +92,8 @@ VIR_ENUM_IMPL(virStorageNetProtocol, VIR_STORAGE_NET_PROTOCOL_LAST,
VIR_ENUM_IMPL(virStorageNetHostTransport, VIR_STORAGE_NET_HOST_TRANS_LAST,
"tcp",
"unix",
- "rdma")
+ "rdma",
+ "iser")
VIR_ENUM_IMPL(virStorageSourcePoolMode,
VIR_STORAGE_SOURCE_POOL_MODE_LAST,
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index ecd806c93..5a6ec7776 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -147,6 +147,7 @@ typedef enum {
VIR_STORAGE_NET_HOST_TRANS_TCP,
VIR_STORAGE_NET_HOST_TRANS_UNIX,
VIR_STORAGE_NET_HOST_TRANS_RDMA,
+ VIR_STORAGE_NET_HOST_TRANS_ISER,
VIR_STORAGE_NET_HOST_TRANS_LAST
} virStorageNetHostTransport;
diff --git a/tests/qemuargv2xmldata/disk-drive-network-iser.args b/tests/qemuargv2xmldata/disk-drive-network-iser.args
new file mode 100644
index 000000000..c476e759e
--- /dev/null
+++ b/tests/qemuargv2xmldata/disk-drive-network-iser.args
@@ -0,0 +1,25 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name QEMUGuest1 \
+-S \
+-M pc \
+-m 214 \
+-smp 1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-nographic \
+-monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi \
+-boot c \
+-usb \
+-drive file=iser://example.org:6000/iqn.1992-01.com.example,format=raw,\
+if=virtio \
+-drive file=iser://example.org:6000/iqn.1992-01.com.example/1,format=raw,\
+if=virtio \
+-net none \
+-serial none \
+-parallel none
diff --git a/tests/qemuargv2xmldata/disk-drive-network-iser.xml b/tests/qemuargv2xmldata/disk-drive-network-iser.xml
new file mode 100644
index 000000000..88f043f66
--- /dev/null
+++ b/tests/qemuargv2xmldata/disk-drive-network-iser.xml
@@ -0,0 +1,41 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i686</emulator>
+ <disk type='network' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source protocol='iscsi' name='iqn.1992-01.com.example/0' transport='iser'>
+ <host name='example.org' port='6000' transport='iser'/>
+ </source>
+ <target dev='vda' bus='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </disk>
+ <disk type='network' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source protocol='iscsi' name='iqn.1992-01.com.example/1' transport='iser'>
+ <host name='example.org' port='6000' transport='iser'/>
+ </source>
+ <target dev='vdb' bus='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c
index cb010268c..3a82630e0 100644
--- a/tests/qemuargv2xmltest.c
+++ b/tests/qemuargv2xmltest.c
@@ -213,6 +213,7 @@ mymain(void)
DO_TEST("disk-drive-network-nbd-unix");
DO_TEST("disk-drive-network-iscsi");
DO_TEST("disk-drive-network-iscsi-auth");
+ DO_TEST("disk-drive-network-iser");
DO_TEST("disk-drive-network-gluster");
DO_TEST("disk-drive-network-rbd");
DO_TEST("disk-drive-network-rbd-auth");
diff --git a/tests/qemuxml2argvdata/disk-drive-network-iser.args b/tests/qemuxml2argvdata/disk-drive-network-iser.args
new file mode 100644
index 000000000..49ea467ff
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-drive-network-iser.args
@@ -0,0 +1,29 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name QEMUGuest1 \
+-S \
+-M pc \
+-m 214 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-nographic \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-no-acpi \
+-boot c \
+-usb \
+-drive file=iser://example.org:6000/iqn.1992-01.com.example/0,format=raw,\
+if=none,id=drive-virtio-disk0 \
+-device virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,\
+id=virtio-disk0 \
+-drive file=iser://example.org:6000/iqn.1992-01.com.example/1,format=raw,\
+if=none,id=drive-virtio-disk1 \
+-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk1,\
+id=virtio-disk1
diff --git a/tests/qemuxml2argvdata/disk-drive-network-iser.xml b/tests/qemuxml2argvdata/disk-drive-network-iser.xml
new file mode 100644
index 000000000..b1634555c
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-drive-network-iser.xml
@@ -0,0 +1,37 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i686</emulator>
+ <disk type='network' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source protocol='iscsi' name='iqn.1992-01.com.example' transport='iser'>
+ <host name='example.org' port='6000'/>
+ </source>
+ <target dev='vda' bus='virtio'/>
+ </disk>
+ <disk type='network' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source protocol='iscsi' name='iqn.1992-01.com.example/1' transport='iser'>
+ <host name='example.org' port='6000'/>
+ </source>
+ <target dev='vdb' bus='virtio'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index ca24e0bbb..accfdaf4b 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -936,6 +936,7 @@ mymain(void)
DO_TEST("disk-drive-network-iscsi-lun",
QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_VIRTIO_SCSI,
QEMU_CAPS_SCSI_BLOCK);
+ DO_TEST("disk-drive-network-iser", NONE);
DO_TEST("disk-drive-network-gluster",
QEMU_CAPS_GLUSTER_DEBUG_LEVEL);
DO_TEST("disk-drive-network-rbd", NONE);
diff --git a/tests/qemuxml2xmloutdata/disk-drive-network-iser.xml b/tests/qemuxml2xmloutdata/disk-drive-network-iser.xml
new file mode 100644
index 000000000..88f043f66
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/disk-drive-network-iser.xml
@@ -0,0 +1,41 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i686</emulator>
+ <disk type='network' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source protocol='iscsi' name='iqn.1992-01.com.example/0' transport='iser'>
+ <host name='example.org' port='6000' transport='iser'/>
+ </source>
+ <target dev='vda' bus='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </disk>
+ <disk type='network' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source protocol='iscsi' name='iqn.1992-01.com.example/1' transport='iser'>
+ <host name='example.org' port='6000' transport='iser'/>
+ </source>
+ <target dev='vdb' bus='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 2be8eb2c1..23f9292c4 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -515,6 +515,7 @@ mymain(void)
DO_TEST("disk-drive-network-nbd-unix", NONE);
DO_TEST("disk-drive-network-iscsi", NONE);
DO_TEST("disk-drive-network-iscsi-auth", NONE);
+ DO_TEST("disk-drive-network-iser", NONE);
DO_TEST("disk-drive-network-gluster", NONE);
DO_TEST("disk-drive-network-rbd", NONE);
DO_TEST("disk-drive-network-rbd-auth", NONE);
--
2.13.6 (Apple Git-96)
6 years, 11 months
[libvirt] [PATCH] nodedev: Fix failing to parse PCI address for non-PCI network devices
by Fei Li
Commit 8708ca01c added virNetDevSwitchdevFeature to check whether
the NIC had Switchdev capabilities; however this causes errors for
network devices whose address is not in PCI format, like qeth device
whose address is 0.0.0800, when calling virPCIDeviceAddressParse.
Change virReportError to VIR_DEBUG to avoid these two error messages
occuring when starting the libvirtd service, just leave their callers
to handle the return values respectively.
Signed-off-by: Fei Li <fli(a)suse.com>
---
src/util/virpci.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/util/virpci.c b/src/util/virpci.c
index fe57bef32..880d7baba 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -2561,7 +2561,7 @@ logStrToLong_ui(char const *s,
ret = virStrToLong_ui(s, end_ptr, base, result);
if (ret != 0)
- VIR_ERROR(_("Failed to convert '%s' to unsigned int"), s);
+ VIR_DEBUG("Failed to convert '%s' to unsigned int", s);
return ret;
}
@@ -2638,9 +2638,7 @@ virPCIGetDeviceAddressFromSysfsLink(const char *device_link)
goto out;
if (virPCIDeviceAddressParse(config_address, bdf) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to parse PCI config address '%s'"),
- config_address);
+ VIR_DEBUG("Failed to parse PCI config address '%s'", config_address);
VIR_FREE(bdf);
goto out;
}
--
2.13.5
6 years, 11 months
[libvirt] [PATCH v3 0/5] Improvements to CPU frequency reporting
by Andrea Bolognani
Changes from [v2]:
* improve the parser;
* print the architecture name instead of "your architecture".
Changes from [v1]:
* adopt Bjoern's approach to refactoring.
[v2] https://www.redhat.com/archives/libvir-list/2017-December/msg00467.html
[v1] https://www.redhat.com/archives/libvir-list/2017-December/msg00356.html
Andrea Bolognani (4):
tests: Add host CPU data for Moonshot (RHEL 7.4)
util: Print architecture name in /proc/cpuinfo parser
util: Improve CPU frequency parsing
util: Don't report CPU frequency for ARM hosts
Bjoern Walk (1):
util: virhostcpu: factor out frequency parsing
src/Makefile.am | 1 +
src/util/virhostcpu.c | 188 ++++++++++++---------
.../linux-aarch64-rhel74-moonshot.cpuinfo | 72 ++++++++
.../linux-aarch64-rhel74-moonshot.expected | 1 +
.../linux-armv6l-raspberrypi.expected | 2 +-
.../linux-rhel74-moonshot/cpu/cpu0/node0 | 1 +
.../linux-rhel74-moonshot/cpu/cpu0/online | 1 +
.../cpu/cpu0/topology/core_id | 1 +
.../cpu/cpu0/topology/core_siblings | 1 +
.../cpu/cpu0/topology/core_siblings_list | 1 +
.../cpu/cpu0/topology/physical_package_id | 1 +
.../cpu/cpu0/topology/thread_siblings | 1 +
.../cpu/cpu0/topology/thread_siblings_list | 1 +
.../linux-rhel74-moonshot/cpu/cpu1/node0 | 1 +
.../linux-rhel74-moonshot/cpu/cpu1/online | 1 +
.../cpu/cpu1/topology/core_id | 1 +
.../cpu/cpu1/topology/core_siblings | 1 +
.../cpu/cpu1/topology/core_siblings_list | 1 +
.../cpu/cpu1/topology/physical_package_id | 1 +
.../cpu/cpu1/topology/thread_siblings | 1 +
.../cpu/cpu1/topology/thread_siblings_list | 1 +
.../linux-rhel74-moonshot/cpu/cpu2/node0 | 1 +
.../linux-rhel74-moonshot/cpu/cpu2/online | 1 +
.../cpu/cpu2/topology/core_id | 1 +
.../cpu/cpu2/topology/core_siblings | 1 +
.../cpu/cpu2/topology/core_siblings_list | 1 +
.../cpu/cpu2/topology/physical_package_id | 1 +
.../cpu/cpu2/topology/thread_siblings | 1 +
.../cpu/cpu2/topology/thread_siblings_list | 1 +
.../linux-rhel74-moonshot/cpu/cpu3/node0 | 1 +
.../linux-rhel74-moonshot/cpu/cpu3/online | 1 +
.../cpu/cpu3/topology/core_id | 1 +
.../cpu/cpu3/topology/core_siblings | 1 +
.../cpu/cpu3/topology/core_siblings_list | 1 +
.../cpu/cpu3/topology/physical_package_id | 1 +
.../cpu/cpu3/topology/thread_siblings | 1 +
.../cpu/cpu3/topology/thread_siblings_list | 1 +
.../linux-rhel74-moonshot/cpu/cpu4/node0 | 1 +
.../linux-rhel74-moonshot/cpu/cpu4/online | 1 +
.../cpu/cpu4/topology/core_id | 1 +
.../cpu/cpu4/topology/core_siblings | 1 +
.../cpu/cpu4/topology/core_siblings_list | 1 +
.../cpu/cpu4/topology/physical_package_id | 1 +
.../cpu/cpu4/topology/thread_siblings | 1 +
.../cpu/cpu4/topology/thread_siblings_list | 1 +
.../linux-rhel74-moonshot/cpu/cpu5/node0 | 1 +
.../linux-rhel74-moonshot/cpu/cpu5/online | 1 +
.../cpu/cpu5/topology/core_id | 1 +
.../cpu/cpu5/topology/core_siblings | 1 +
.../cpu/cpu5/topology/core_siblings_list | 1 +
.../cpu/cpu5/topology/physical_package_id | 1 +
.../cpu/cpu5/topology/thread_siblings | 1 +
.../cpu/cpu5/topology/thread_siblings_list | 1 +
.../linux-rhel74-moonshot/cpu/cpu6/node0 | 1 +
.../linux-rhel74-moonshot/cpu/cpu6/online | 1 +
.../cpu/cpu6/topology/core_id | 1 +
.../cpu/cpu6/topology/core_siblings | 1 +
.../cpu/cpu6/topology/core_siblings_list | 1 +
.../cpu/cpu6/topology/physical_package_id | 1 +
.../cpu/cpu6/topology/thread_siblings | 1 +
.../cpu/cpu6/topology/thread_siblings_list | 1 +
.../linux-rhel74-moonshot/cpu/cpu7/node0 | 1 +
.../linux-rhel74-moonshot/cpu/cpu7/online | 1 +
.../cpu/cpu7/topology/core_id | 1 +
.../cpu/cpu7/topology/core_siblings | 1 +
.../cpu/cpu7/topology/core_siblings_list | 1 +
.../cpu/cpu7/topology/physical_package_id | 1 +
.../cpu/cpu7/topology/thread_siblings | 1 +
.../cpu/cpu7/topology/thread_siblings_list | 1 +
.../linux-rhel74-moonshot/cpu/kernel_max | 1 +
.../linux-rhel74-moonshot/cpu/offline | 1 +
.../linux-rhel74-moonshot/cpu/online | 1 +
.../linux-rhel74-moonshot/cpu/possible | 1 +
.../linux-rhel74-moonshot/cpu/present | 1 +
.../linux-rhel74-moonshot/node/has_cpu | 1 +
.../linux-rhel74-moonshot/node/has_memory | 1 +
.../linux-rhel74-moonshot/node/has_normal_memory | 1 +
.../linux-rhel74-moonshot/node/node0/cpu0 | 1 +
.../linux-rhel74-moonshot/node/node0/cpu1 | 1 +
.../linux-rhel74-moonshot/node/node0/cpu2 | 1 +
.../linux-rhel74-moonshot/node/node0/cpu3 | 1 +
.../linux-rhel74-moonshot/node/node0/cpu4 | 1 +
.../linux-rhel74-moonshot/node/node0/cpu5 | 1 +
.../linux-rhel74-moonshot/node/node0/cpu6 | 1 +
.../linux-rhel74-moonshot/node/node0/cpu7 | 1 +
.../linux-rhel74-moonshot/node/node0/cpulist | 1 +
.../linux-rhel74-moonshot/node/node0/cpumap | 1 +
.../linux-rhel74-moonshot/node/online | 1 +
.../linux-rhel74-moonshot/node/possible | 1 +
tests/virhostcpudata/linux-x86_64-test1.cpuinfo | 4 +
tests/virhostcputest.c | 1 +
91 files changed, 273 insertions(+), 80 deletions(-)
create mode 100644 tests/virhostcpudata/linux-aarch64-rhel74-moonshot.cpuinfo
create mode 100644 tests/virhostcpudata/linux-aarch64-rhel74-moonshot.expected
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu0/node0
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu0/online
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu0/topology/core_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu0/topology/core_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu0/topology/core_siblings_list
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu0/topology/physical_package_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu0/topology/thread_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu0/topology/thread_siblings_list
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu1/node0
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu1/online
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu1/topology/core_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu1/topology/core_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu1/topology/core_siblings_list
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu1/topology/physical_package_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu1/topology/thread_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu1/topology/thread_siblings_list
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu2/node0
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu2/online
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu2/topology/core_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu2/topology/core_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu2/topology/core_siblings_list
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu2/topology/physical_package_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu2/topology/thread_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu2/topology/thread_siblings_list
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu3/node0
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu3/online
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu3/topology/core_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu3/topology/core_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu3/topology/core_siblings_list
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu3/topology/physical_package_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu3/topology/thread_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu3/topology/thread_siblings_list
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu4/node0
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu4/online
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu4/topology/core_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu4/topology/core_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu4/topology/core_siblings_list
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu4/topology/physical_package_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu4/topology/thread_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu4/topology/thread_siblings_list
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu5/node0
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu5/online
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu5/topology/core_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu5/topology/core_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu5/topology/core_siblings_list
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu5/topology/physical_package_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu5/topology/thread_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu5/topology/thread_siblings_list
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu6/node0
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu6/online
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu6/topology/core_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu6/topology/core_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu6/topology/core_siblings_list
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu6/topology/physical_package_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu6/topology/thread_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu6/topology/thread_siblings_list
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu7/node0
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu7/online
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu7/topology/core_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu7/topology/core_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu7/topology/core_siblings_list
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu7/topology/physical_package_id
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu7/topology/thread_siblings
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/cpu7/topology/thread_siblings_list
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/kernel_max
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/offline
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/online
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/possible
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/cpu/present
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/node/has_cpu
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/node/has_memory
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/node/has_normal_memory
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/node/node0/cpu0
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/node/node0/cpu1
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/node/node0/cpu2
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/node/node0/cpu3
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/node/node0/cpu4
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/node/node0/cpu5
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/node/node0/cpu6
create mode 120000 tests/virhostcpudata/linux-rhel74-moonshot/node/node0/cpu7
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/node/node0/cpulist
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/node/node0/cpumap
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/node/online
create mode 100644 tests/virhostcpudata/linux-rhel74-moonshot/node/possible
--
2.14.3
6 years, 11 months
[libvirt] [PATCH] domain_conf: skip boot order check of CD-ROM or floppy device
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)gmail.com>
If we insert or eject a CD-ROM/floppy device with a boot order,
we may get:
unsupported configuration: boot order 2 is already used by another device
This check should be skipped in this case.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)gmail.com>
---
src/conf/domain_conf.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9a62bc472..885ab88d2 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -26880,11 +26880,19 @@ virDomainDeviceInfoCheckBootIndex(virDomainDefPtr def ATTRIBUTE_UNUSED,
{
virDomainDeviceInfoPtr newinfo = opaque;
+ int disk_device = device->data.disk->device;
if (info->bootIndex == newinfo->bootIndex) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("boot order %u is already used by another device"),
- newinfo->bootIndex);
- return -1;
+ /* Skip check for insert or eject CD-ROM device */
+ if (disk_device == VIR_DOMAIN_DISK_DEVICE_FLOPPY ||
+ disk_device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
+ VIR_DEBUG("Skip boot index check for floppy or CDROM");
+ return 0;
+ } else {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("boot order %u is already used by another device"),
+ newinfo->bootIndex);
+ return -1;
+ }
}
return 0;
}
--
2.14.3
6 years, 11 months
[libvirt] [PATCH v3 0/2] qemu: Add support for hot unplugging
by Chen Hanxiao
v3:
use helper qemuDomainDelChardevTLSObjects and address some comments
v2:
rebased on master
Chen Hanxiao (2):
qemu: Add support for hot unplugging redirdev device which can use the
detach-device --live
news: add change of hot unplug redirdev
docs/news.xml | 11 ++++++
src/qemu/qemu_driver.c | 4 ++-
src/qemu/qemu_hotplug.c | 91 +++++++++++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_hotplug.h | 4 +++
4 files changed, 109 insertions(+), 1 deletion(-)
--
2.14.3
6 years, 11 months
[libvirt] [PATCH v4 00/13] Move qemu command line controller checks to qemuDomainDeviceDefValidateController* checks
by John Ferlan
v3: https://www.redhat.com/archives/libvir-list/2017-December/msg00209.html
Differences since v3:
* Pushed first 4 ACK'd patches of v3
* Rework/Separate out a few patches for the SCSI handling
* Alter the PCI handling as requested by code review (although I still
had a question to a review comment regarding whether or not the model
should be handled in PostParse).
* Alter the SATA code as indicated by code review
* Add Andrea's patch into the series
Andrea Bolognani (1):
qemu: Add missing checks for pcie-root-port options
John Ferlan (12):
qemu: Introduce qemuDomainDeviceDefValidateControllerAttributes
qemu: Move model set for qemuBuildControllerDevStr
qemu: Adjust SCSI controller switch in qemuBuildControllerDevStr
qemu: Add check for iothread attribute in validate controller
qemu: Introduce qemuDomainDeviceDefValidateControllerSCSI
qemu: Introduce qemuDomainDeviceDefValidateControllerPCI
qemu: Use virDomainPCIControllerOpts in qemuBuildControllerDevStr
qemu: Move PCI command modelName check to controller def validate
qemu: Move PCI command modelName TypeToString to controller def
validate
qemu: Move PCI more command checks to controller def validate
qemu: Complete PCI command checks to controller def validate
qemu: Introduce qemuDomainDeviceDefValidateControllerSATA
src/qemu/qemu_command.c | 403 ++++------------------------------------------
src/qemu/qemu_domain.c | 420 +++++++++++++++++++++++++++++++++++++++++++++++-
tests/qemumemlocktest.c | 14 ++
tests/qemuxml2xmltest.c | 5 +-
4 files changed, 466 insertions(+), 376 deletions(-)
--
2.13.6
6 years, 11 months
[libvirt] [PATCH] nodedev: update mdev_types caps before dumpxml
by Wu Zongyong
Wu Zongyong (1):
nodedev: update mdev_types caps before dumpxml
src/node_device/node_device_linux_sysfs.c | 42 +++++++++++++++++++++++++++++++
src/node_device/node_device_udev.c | 11 ++++++--
src/node_device/node_device_udev.h | 8 ++++++
3 files changed, 59 insertions(+), 2 deletions(-)
--
1.9.1
6 years, 11 months
[libvirt] [PATCH] qemuDomainDiskChangeSupported: Forbid alias change
by Michal Privoznik
Since we have user aliases it may happen that users want to
change it using 'update-device'. Instead of ignoring it silently,
error out loudly.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_domain.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 347fc0742..00d6c41c9 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -6762,6 +6762,14 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk,
return false;
}
+ if (disk->info.alias &&
+ STRNEQ_NULLABLE(disk->info.alias, orig_disk->info.alias)) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+ _("cannot modify field '%s' of the disk"),
+ "alias");
+ return false;
+ }
+
CHECK_EQ(info.bootIndex, "boot order", true);
CHECK_EQ(rawio, "rawio", true);
CHECK_EQ(sgio, "sgio", true);
--
2.13.6
6 years, 11 months
[libvirt] [PATCH] Fixed documentation for destroy storage pool
by frankie@telecos.upc.edu
From: Francesc Guasch <frankie(a)telecos.upc.edu>
---
lib/Sys/Virt/StoragePool.pm | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/lib/Sys/Virt/StoragePool.pm b/lib/Sys/Virt/StoragePool.pm
index 0bc1d50..2ba5101 100644
--- a/lib/Sys/Virt/StoragePool.pm
+++ b/lib/Sys/Virt/StoragePool.pm
@@ -115,14 +115,11 @@ C<define_storage_pool> method in L<Sys::Virt>.
Remove the configuration associated with a storage pool previously defined
with the C<define_storage pool> method in L<Sys::Virt>. If the storage pool is
-running, you probably want to use the C<shutdown> or C<destroy>
-methods instead.
+running, you probably want to use the C<destroy> method instead.
=item $pool->destroy()
-Immediately terminate the machine, and remove it from the virtual
-machine monitor. The C<$pool> handle is invalid after this call
-completes and should not be used again.
+Immediately stop the storage pool.
=item $flag = $pool->get_autostart();
--
2.14.1
6 years, 11 months