[libvirt] [PATCHv2 0/4] Introduce x86 RDT (CMT&MBM) host capability
by Wang Huaqiang
This series of patches introduced the x86 Cache Monitoring Technology
(CMT) to libvirt by interacting with kernel resource control (resctrl)
interface. CMT is one of the Intel(R) x86 CPU feature which belongs to
the Resource Director Technology (RDT). CMT reports the occupancy of the
last level cache, which is shared by all CPU cores.
In v1 series, we are introducing CMT for libvirt, including reporting
host capability and creating CMT groups. Introducing host capability
is pretty much a well self-contained step, we only cover this step in
this series. As an extension of v1, MBM capability is also introduced.
These patches will not cover the part of creating CMT groups, which
will be subsequent patches.
We have serval discussion about the enabling of CMT, please refer to
following links for the RFCs.
RFCv3
https://www.redhat.com/archives/libvir-list/2018-August/msg01213.html
RFCv2
https://www.redhat.com/archives/libvir-list/2018-July/msg00409.html
https://www.redhat.com/archives/libvir-list/2018-July/msg01241.html
RFCv1
https://www.redhat.com/archives/libvir-list/2018-June/msg00674.html
1. About reason why CMT is necessary for libvirt?
The perf events of 'CMT, MBML, MBMT' have been phased out since Linux
kernel commit c39a0e2c8850f08249383f2425dbd8dbe4baad69, in libvirt
the perf based cmt,mbm will not work with the latest linux kernel. These
patches add CMT feature to libvirt through kernel resctrlfs interface.
2. Interfaces for CMT from the high level.
CMT, CAT, MBM and MBA are orthogonal features, each could works
independently.
If 'CMT' is enabled in host, then a 'cache monitor' is introduced for
cache, which is role is monitoring the last level cache utilization
of target system process. Cache monitor capabilities is shown under
element <cache>.
'MBM', a monitor named memory bandwidth monitor is introduced, for
role of monitoring memory bandwidth utilization. The capability
information block is located under <memory bandwidth> element.
2.1 Query the host capability of CMT.
The element 'monitor' represents the host capabilities of CMT.
The explanations of involved attributes:
- 'maxMonitors': denotes the maximum monitoring groups could be
created, which is limited by the number of hardware 'RMID'.
- 'reuseThreshold': An adjustable value affects the final reuse of
resources used by monitor. After the action of removing a
monitor, the kernel may not release all hardware resources that
monitor used immediately if the cache occupancy value associated
with 'removed' monitor is above this threshold. Once the cache
occupancy is below this threshold, the underlying hardware
resource will be reclaimed and be put into the resource pool
for next reusing.
- 'llc_occupancy': a feature of CMT, reporting the last level cache
occupancy information.
- 'mbm_total_bytes': a feature of MBM, reporting total memory
bandwidth utilization, in bytes, including local memory and
remote memory for multi-node system.
- 'mbm_local_bytes': a feature of MBM, reporting only local memory
bandwidth utilization.
# virsh capabilities
...
<cache>
<bank id='0' level='3' type='both' size='15' unit='MiB' cpus='0-5'>
<control granularity='768' min='1536' unit='KiB' type='both' maxAllocs='4'/>
</bank>
<bank id='1' level='3' type='both' size='15' unit='MiB' cpus='6-11'>
<control granularity='768' min='1536' unit='KiB' type='both' maxAllocs='4'/>
</bank>
+ <monitor level='3' reuseThreshold='270336' maxMonitors='176'>
+ <feature name='llc_occupancy'/>
+ </monitor>
</cache>
<memory_bandwidth>
<node id='0' cpus='0-5'>
<control granularity='10' min ='10' maxAllocs='4'/>
</node>
<node id='1' cpus='6-11'>
<control granularity='10' min ='10' maxAllocs='4'/>
</node>
+ <monitor maxMonitors='176'>
+ <feature name='mbm_total_bytes'/>
+ <feature name='mbm_local_bytes'/>
+ </monitor>
</memory_bandwidth>
...
</host>
Changes since v1:
- Introduced MBM capability.
- Capability layout changed
* Moved <monitor> from cahe <bank> to <cache>
* Renamed <Threshold> to <reuseThreshold>
- Document for 'reuseThreshold' changed.
- Introduced API virResctrlInfoGetMonitorPrefix
- Added more tests, covering standalone CMT, fake new
feature.
- Creating CMT resource control group will be
subsequent job.
Wang Huaqiang (4):
util: Introduce monitor capability interface
conf: Refactor cache bank capability structure
conf: Refactor memory bandwidth capability structure
conf: Introduce RDT monitor host capability
docs/schemas/capability.rng | 37 +++-
src/conf/capabilities.c | 126 ++++++++---
src/conf/capabilities.h | 24 ++-
src/libvirt_private.syms | 2 +
src/util/virresctrl.c | 240 +++++++++++++++++++++
src/util/virresctrl.h | 62 ++++++
.../resctrl/info/L3_MON/max_threshold_occupancy | 1 +
.../resctrl/info/L3_MON/mon_features | 1 +
.../resctrl/info/L3_MON/num_rmids | 1 +
.../linux-resctrl-cmt/resctrl/manualres/cpus | 1 +
.../linux-resctrl-cmt/resctrl/manualres/schemata | 1 +
.../linux-resctrl-cmt/resctrl/manualres/tasks | 0
.../linux-resctrl-cmt/resctrl/schemata | 1 +
tests/vircaps2xmldata/linux-resctrl-cmt/system | 1 +
.../resctrl/info/L3/cbm_mask | 1 +
.../resctrl/info/L3/min_cbm_bits | 1 +
.../resctrl/info/L3/num_closids | 1 +
.../resctrl/info/L3_MON/max_threshold_occupancy | 1 +
.../resctrl/info/L3_MON/mon_features | 10 +
.../resctrl/info/L3_MON/num_rmids | 1 +
.../resctrl/info/MB/bandwidth_gran | 1 +
.../resctrl/info/MB/min_bandwidth | 1 +
.../resctrl/info/MB/num_closids | 1 +
.../resctrl/manualres/cpus | 1 +
.../resctrl/manualres/schemata | 1 +
.../resctrl/manualres/tasks | 0
.../linux-resctrl-fake-feature/resctrl/schemata | 1 +
.../linux-resctrl-fake-feature/system | 1 +
.../resctrl/info/L3_MON/max_threshold_occupancy | 1 +
.../linux-resctrl/resctrl/info/L3_MON/mon_features | 3 +
.../linux-resctrl/resctrl/info/L3_MON/num_rmids | 1 +
.../vircaps2xmldata/vircaps-x86_64-resctrl-cmt.xml | 53 +++++
.../vircaps-x86_64-resctrl-fake-feature.xml | 73 +++++++
tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml | 7 +
tests/vircaps2xmltest.c | 2 +
35 files changed, 624 insertions(+), 36 deletions(-)
create mode 100644 tests/vircaps2xmldata/linux-resctrl-cmt/resctrl/info/L3_MON/max_threshold_occupancy
create mode 100644 tests/vircaps2xmldata/linux-resctrl-cmt/resctrl/info/L3_MON/mon_features
create mode 100644 tests/vircaps2xmldata/linux-resctrl-cmt/resctrl/info/L3_MON/num_rmids
create mode 100644 tests/vircaps2xmldata/linux-resctrl-cmt/resctrl/manualres/cpus
create mode 100644 tests/vircaps2xmldata/linux-resctrl-cmt/resctrl/manualres/schemata
create mode 100644 tests/vircaps2xmldata/linux-resctrl-cmt/resctrl/manualres/tasks
create mode 100644 tests/vircaps2xmldata/linux-resctrl-cmt/resctrl/schemata
create mode 120000 tests/vircaps2xmldata/linux-resctrl-cmt/system
create mode 100644 tests/vircaps2xmldata/linux-resctrl-fake-feature/resctrl/info/L3/cbm_mask
create mode 100644 tests/vircaps2xmldata/linux-resctrl-fake-feature/resctrl/info/L3/min_cbm_bits
create mode 100644 tests/vircaps2xmldata/linux-resctrl-fake-feature/resctrl/info/L3/num_closids
create mode 100644 tests/vircaps2xmldata/linux-resctrl-fake-feature/resctrl/info/L3_MON/max_threshold_occupancy
create mode 100644 tests/vircaps2xmldata/linux-resctrl-fake-feature/resctrl/info/L3_MON/mon_features
create mode 100644 tests/vircaps2xmldata/linux-resctrl-fake-feature/resctrl/info/L3_MON/num_rmids
create mode 100644 tests/vircaps2xmldata/linux-resctrl-fake-feature/resctrl/info/MB/bandwidth_gran
create mode 100644 tests/vircaps2xmldata/linux-resctrl-fake-feature/resctrl/info/MB/min_bandwidth
create mode 100644 tests/vircaps2xmldata/linux-resctrl-fake-feature/resctrl/info/MB/num_closids
create mode 100644 tests/vircaps2xmldata/linux-resctrl-fake-feature/resctrl/manualres/cpus
create mode 100644 tests/vircaps2xmldata/linux-resctrl-fake-feature/resctrl/manualres/schemata
create mode 100644 tests/vircaps2xmldata/linux-resctrl-fake-feature/resctrl/manualres/tasks
create mode 100644 tests/vircaps2xmldata/linux-resctrl-fake-feature/resctrl/schemata
create mode 120000 tests/vircaps2xmldata/linux-resctrl-fake-feature/system
create mode 100644 tests/vircaps2xmldata/linux-resctrl/resctrl/info/L3_MON/max_threshold_occupancy
create mode 100644 tests/vircaps2xmldata/linux-resctrl/resctrl/info/L3_MON/mon_features
create mode 100644 tests/vircaps2xmldata/linux-resctrl/resctrl/info/L3_MON/num_rmids
create mode 100644 tests/vircaps2xmldata/vircaps-x86_64-resctrl-cmt.xml
create mode 100644 tests/vircaps2xmldata/vircaps-x86_64-resctrl-fake-feature.xml
--
2.7.4
6 years, 5 months
[libvirt] [PATCH] qemu: use "id" instead of deprecated "name" for -net
by Ján Tomko
-net name= will be deprecated in QEMU 3.1:
commit 101625a4d4ac7e96227a156bc5f6d21a9cc383cd
net: Deprecate the "name" parameter of -net
git describe: v3.0.0-791-g101625a4d4
Use the id option instead, supported since QEMU 1.2:
commit 6687b79d636cd60ed9adb1177d0d946b58fa7717
convert net_client_init() to OptsVisitor
git describe: v1.0-3564-g6687b79d63 contains: v1.2.0-rc0~142^2~8
Thankfully, libvirt only uses -net for non-PCI, non-virtio NICs
on ARM.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/qemu/qemu_command.c | 2 +-
tests/qemuxml2argvdata/arm-vexpressa9-basic.args | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index d77cf8c2d6..269276f2f9 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3516,7 +3516,7 @@ qemuBuildLegacyNicStr(virDomainNetDefPtr net)
net->info.alias,
(net->model ? ",model=" : ""),
(net->model ? net->model : ""),
- (net->info.alias ? ",name=" : ""),
+ (net->info.alias ? ",id=" : ""),
(net->info.alias ? net->info.alias : "")));
return str;
}
diff --git a/tests/qemuxml2argvdata/arm-vexpressa9-basic.args b/tests/qemuxml2argvdata/arm-vexpressa9-basic.args
index 90661d8b55..b925baa0e0 100644
--- a/tests/qemuxml2argvdata/arm-vexpressa9-basic.args
+++ b/tests/qemuxml2argvdata/arm-vexpressa9-basic.args
@@ -27,6 +27,6 @@ server,nowait \
-usb \
-drive file=/arm.raw,format=raw,if=sd,index=0 \
-netdev user,id=hostnet0 \
--net nic,macaddr=52:54:00:09:a4:37,netdev=hostnet0,model=lan9118,name=net0 \
+-net nic,macaddr=52:54:00:09:a4:37,netdev=hostnet0,model=lan9118,id=net0 \
-chardev pty,id=charserial0 \
-serial chardev:charserial0
--
2.16.4
6 years, 5 months
[libvirt] [PATCH] virFileIsSharedFSType: Copy mnt_dir when browsing mount table
by Han Han
virFileIsSharedFSType doesn't fix f_type when "fuse.glusterfs"
is not the last row of mount table. For example, it doesn't works on
the mount table like following:
10.XX.XX.XX:/gv0 /mnt fuse.glusterfs rw 0 0
root@XX.XX.XX:/tmp/mkdir /tmp/br0 fuse.sshfs rw 0 0
Copy mnt_dir of struct mntent in case its mnt_dir is changed by
getmntent_r in the loop later.
Signed-off-by: Han Han <hhan(a)redhat.com>
---
src/util/virfile.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 2a7e87102a..c503462633 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -3469,7 +3469,7 @@ virFileIsSharedFixFUSE(const char *path,
long *f_type)
{
char *dirpath = NULL;
- const char **mounts = NULL;
+ char **mounts = NULL;
size_t nmounts = 0;
char *p;
FILE *f = NULL;
@@ -3491,8 +3491,12 @@ virFileIsSharedFixFUSE(const char *path,
if (STRNEQ("fuse.glusterfs", mb.mnt_type))
continue;
- if (VIR_APPEND_ELEMENT_COPY(mounts, nmounts, mb.mnt_dir) < 0)
+ char *mnt_dir;
+ if (VIR_STRDUP(mnt_dir, mb.mnt_dir) < 0 ||
+ VIR_APPEND_ELEMENT_COPY(mounts, nmounts, mnt_dir) < 0) {
+ VIR_FREE(mnt_dir);
goto cleanup;
+ }
}
/* Add NULL sentinel so that this is a virStringList */
@@ -3512,7 +3516,7 @@ virFileIsSharedFixFUSE(const char *path,
else
*p = '\0';
- if (virStringListHasString(mounts, dirpath)) {
+ if (virStringListHasString((const char **)mounts, dirpath)) {
VIR_DEBUG("Found gluster FUSE mountpoint=%s for path=%s. "
"Fixing shared FS type", dirpath, path);
*f_type = GFS2_MAGIC;
@@ -3523,7 +3527,7 @@ virFileIsSharedFixFUSE(const char *path,
ret = 0;
cleanup:
endmntent(f);
- VIR_FREE(mounts);
+ virStringListFree(mounts);
VIR_FREE(dirpath);
return ret;
}
--
2.19.1
6 years, 5 months
[libvirt] [PATCH v2] qemu: agent: Avoid agentError when closing the QEMU agent
by Wang Yechao
After calling qemuAgentClose(), it is still possible for
the QEMU Agent I/O event callback to get invoked. This
will trigger an agent error because mon->fd has been set
to -1 at this point. Then vm->privateData->agentError is
always 'true' except that restart libvirtd or restart
qemu-guest-agent process in guest.
Silently ignore the case where mon->fd is -1, likewise for
mon->watch being zero.
Signed-off-by: Wang Yechao <wang.yechao255(a)zte.com.cn>
---
v1 patch:
https://www.redhat.com/archives/libvir-list/2018-September/msg01382.html
Changes in v2:
- do not set agentError, let agent state as disconnected instead of error.
---
src/qemu/qemu_agent.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index 97ad0e7..d842b0e 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -530,6 +530,9 @@ static void qemuAgentUpdateWatch(qemuAgentPtr mon)
VIR_EVENT_HANDLE_HANGUP |
VIR_EVENT_HANDLE_ERROR;
+ if (!mon->watch)
+ return;
+
if (mon->lastError.code == VIR_ERR_OK) {
events |= VIR_EVENT_HANDLE_READABLE;
@@ -555,6 +558,12 @@ qemuAgentIO(int watch, int fd, int events, void *opaque)
VIR_DEBUG("Agent %p I/O on watch %d fd %d events %d", mon, watch, fd, events);
#endif
+ if (mon->fd == -1 || mon->watch == 0) {
+ virObjectUnlock(mon);
+ virObjectUnref(mon);
+ return;
+ }
+
if (mon->fd != fd || mon->watch != watch) {
if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR))
eof = true;
@@ -788,8 +797,10 @@ void qemuAgentClose(qemuAgentPtr mon)
virObjectLock(mon);
if (mon->fd >= 0) {
- if (mon->watch)
+ if (mon->watch) {
virEventRemoveHandle(mon->watch);
+ mon->watch = 0;
+ }
VIR_FORCE_CLOSE(mon->fd);
}
--
1.8.3.1
6 years, 5 months
[libvirt] [PATCH 00/11] qemu: Improve / cleanup QEMU binary handling
by Andrea Bolognani
This is the output of 'virsh capabilities' on my laptop:
<guest>
<os_type>hvm</os_type>
<arch name='x86_64'>
<wordsize>64</wordsize>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<machine maxCpus='255'>pc-i440fx-3.0</machine>
<machine canonical='pc-i440fx-3.0' maxCpus='255'>pc</machine>
<machine maxCpus='288'>pc-q35-3.0</machine>
<machine canonical='pc-q35-3.0' maxCpus='288'>q35</machine>
<!-- Actually way more machine types listed here -->
<domain type='qemu'/>
<domain type='kvm'>
<emulator>/usr/bin/qemu-kvm</emulator>
<machine maxCpus='255'>pc-i440fx-3.0</machine>
<machine canonical='pc-i440fx-3.0' maxCpus='255'>pc</machine>
<machine maxCpus='288'>pc-q35-3.0</machine>
<machine canonical='pc-q35-3.0' maxCpus='288'>q35</machine>
<!-- Actually way more machine types listed here -->
</domain>
</arch>
<!-- Other stuff we don't care about -->
</guest>
Notice how all machine types are listed twice, and how we report
that qemu-system-x86_64 for TCG guests qemu-kvm must be used for
KVM guests - which is inaccurate, since the former can run KVM
guests just fine.
After this series, the output is much more reasonable:
<guest>
<os_type>hvm</os_type>
<arch name='x86_64'>
<wordsize>64</wordsize>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<machine maxCpus='255'>pc-i440fx-3.0</machine>
<machine canonical='pc-i440fx-3.0' maxCpus='255'>pc</machine>
<machine maxCpus='288'>pc-q35-3.0</machine>
<machine canonical='pc-q35-3.0' maxCpus='288'>q35</machine>
<!-- Actually way more machine types listed here -->
<domain type='qemu'/>
<domain type='kvm'/>
</arch>
<!-- Other stuff we don't care about -->
</guest>
As a bonus the code gets *simpler* in the process instead of more
complicated, and we even get to shave off ~100 lines! Yay!
Andrea Bolognani (11):
qemu: Move comments to virQEMUCapsGuestIsNative()
qemu: Don't duplicate binary name in capabilities
qemu: Move armv7l-on-aarch64 special case
qemu: Stop looking after finding the first binary
qemu: Expect a single binary in virQEMUCapsInitGuest()
qemu: Remove unnecessary variables
qemu: Don't look for "qemu-kvm" and "kvm" binaries
qemu: Simplify QEMU binary search
qemu: Rename qemubinCaps => qemuCaps
qemu: Refactor virQEMUCapsCacheLookupByArch()
qemu: Prefer qemu-system-* binaries
src/qemu/qemu_capabilities.c | 170 +++++++-----------
src/qemu/qemu_capabilities.h | 4 +-
.../qemucaps2xmloutdata/caps_1.5.3.x86_64.xml | 4 +-
.../qemucaps2xmloutdata/caps_1.6.0.x86_64.xml | 4 +-
.../qemucaps2xmloutdata/caps_1.7.0.x86_64.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.1.1.x86_64.xml | 4 +-
.../caps_2.10.0.aarch64.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.10.0.ppc64.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.10.0.s390x.xml | 4 +-
.../caps_2.10.0.x86_64.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.11.0.s390x.xml | 4 +-
.../caps_2.11.0.x86_64.xml | 4 +-
.../caps_2.12.0.aarch64.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.12.0.ppc64.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.12.0.s390x.xml | 4 +-
.../caps_2.12.0.x86_64.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.4.0.x86_64.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.5.0.x86_64.xml | 4 +-
.../caps_2.6.0.aarch64.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.6.0.ppc64.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.6.0.x86_64.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.7.0.s390x.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.7.0.x86_64.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.8.0.s390x.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.8.0.x86_64.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.9.0.ppc64.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.9.0.s390x.xml | 4 +-
.../qemucaps2xmloutdata/caps_2.9.0.x86_64.xml | 4 +-
.../qemucaps2xmloutdata/caps_3.0.0.ppc64.xml | 4 +-
.../qemucaps2xmloutdata/caps_3.0.0.x86_64.xml | 4 +-
tests/qemucaps2xmltest.c | 2 -
31 files changed, 97 insertions(+), 191 deletions(-)
--
2.17.1
6 years, 5 months
[libvirt] [PATCH v2 00/12] qemu: Fix media changing problems
by Peter Krempa
Fixes regression in media changing/disk hotplug as the ordering of the
alias allocation and disk preparation was bad.
v2:
- be more explicit about old and new definitions used in certain steps
- clean up legacy hotplug to not access old disk source definition
- also treat network disks as 'raw' if the format was not provided
Peter Krempa (12):
Revert "qemu: hotplug: Prepare disk source in
qemuDomainAttachDeviceDiskLive"
Revert "qemu: hotplug: consolidate media change code paths"
qemu: hotplug: Don't pretend that we support secrets for media change
qemu: domain: Assume 'raw' default storage format also for network
storage
qemu: hotplug: Remove code handling possible missing disk source
format
qemu: hotplug: Allow specifying explicit source for disk backend
hotplug code
qemu: hotplug: Be explicit about old/new sources when changing media
qemu: hotplug: Prepare disk source for media changing
qemu: hotplug: Add wrapper for disk hotplug code
qemu: conf: Export qemuAddSharedDisk
qemu: hotplug: Split out media change code from disk hotplug
qemu: hotplug: Refactor qemuDomainAttachDeviceDiskLiveInternal
src/qemu/qemu_conf.c | 2 +-
src/qemu/qemu_conf.h | 5 +
src/qemu/qemu_domain.c | 4 +-
src/qemu/qemu_driver.c | 7 +-
src/qemu/qemu_hotplug.c | 276 ++++++++++--------
src/qemu/qemu_hotplug.h | 9 +-
tests/qemuhotplugtest.c | 2 +-
.../disk-source-pool-mode.args | 6 +-
tests/qemuxml2argvdata/disk-source-pool.args | 4 +-
.../disk-source-pool-mode.xml | 6 +-
tests/qemuxml2xmloutdata/disk-source-pool.xml | 2 +-
11 files changed, 185 insertions(+), 138 deletions(-)
--
2.17.1
6 years, 5 months
[libvirt] [osinfo-db-tools PATCH v2 0/2] RFC: Make osinfo-db-import aware of URLs
by Fabiano Fidêncio
This is a simple draft of a work that has been discussed back in July as
part of this thread[0].
There are a few things which are not clear to me whether we want (or
whether we do *not* want).
For now I'm not using any progress callback to print the download status
and I don't even know whether it would be desired to have. But this is
something that could be easily done.
Also, for now the operation is synchronous and there's no cancellable
used ... but that's something that could be changed (although I don't
see the need for that right now).
In order to give it a try, please, just build our source with the patch
included and try:
./tools/osinfo-db-import https://releases.pagure.org/libosinfo/osinfo-db-20180920.tar.xz
./tools/osinfo-db-import https://foo.bar/foo.bar.tar.xz
[0]: https://www.redhat.com/archives/libosinfo/2018-July/msg00002.html
Changes since v1:
- Use Gio instead of curl;
- An additional patch removing a unused var;
Fabiano Fidêncio (2):
import: Learn how to deal with URLs
import: Remove unused variable
tools/osinfo-db-import.c | 91 ++++++++++++++++++++++++++++++++++++----
1 file changed, 84 insertions(+), 7 deletions(-)
--
2.19.1
6 years, 5 months
[libvirt] [PATCH 00/15] Move unix socket creation out of qemuBuildCommandLine
by Ján Tomko
Add test coverage for all the possible devices and move all the
socket creation to qemuProcessPrepareHost.
TBD: remove the racy qemuSecuritySetSocketLabel call
as well as the rest of host state modification out of
qemuBuildCommandLine
Ján Tomko (15):
tests: add smartcard-passthrough-unix
tests: add parallel-unix-chardev
tests: add channel-unix-guestfwd
tests: add console-virtio-unix
tests: add usb-redir-unix
tests: add virtio-rng-egd-unix
tests: use real capabilities for net-vhostuser
qemuProcessPrepareDomain: pass xmlopt when creating monConfig
qemu: add fd to qemuDomainChrSourcePrivate
qemuBuildChrChardevStr: split attribute formatting
qemuBuildChrChardevStr: increase scope of qemuBuildChrChardevStr
qemuBuildChrChardevStr: pass fd from private data
qemu: remove QEMU_BUILD_CHARDEV_UNIX_FD_PASS
qemuBuildCommandLine: do not pass security manager
qemuOpenChrChardevUNIXSocket: move to qemu_process
src/qemu/qemu_command.c | 192 +++++----------------
src/qemu/qemu_command.h | 5 -
src/qemu/qemu_domain.c | 3 +
src/qemu/qemu_domain.h | 2 +
src/qemu/qemu_process.c | 188 +++++++++++++++++++-
src/qemu/qemu_process.h | 3 +
.../channel-unix-guestfwd.x86_64-2.5.0.args | 33 ++++
.../channel-unix-guestfwd.x86_64-latest.args | 36 ++++
tests/qemuxml2argvdata/channel-unix-guestfwd.xml | 37 ++++
.../console-virtio-unix.x86_64-2.5.0.args | 34 ++++
.../console-virtio-unix.x86_64-latest.args | 37 ++++
tests/qemuxml2argvdata/console-virtio-unix.xml | 33 ++++
.../net-vhostuser.x86_64-2.5.0.args | 39 +++++
.../net-vhostuser.x86_64-latest.args | 42 +++++
.../parallel-unix-chardev.x86_64-2.5.0.args | 33 ++++
.../parallel-unix-chardev.x86_64-latest.args | 36 ++++
tests/qemuxml2argvdata/parallel-unix-chardev.xml | 35 ++++
.../smartcard-passthrough-unix.x86_64-2.5.0.args | 30 ++++
.../smartcard-passthrough-unix.x86_64-latest.args | 33 ++++
.../smartcard-passthrough-unix.xml | 19 ++
.../usb-redir-unix.x86_64-2.5.0.args | 35 ++++
.../usb-redir-unix.x86_64-latest.args | 38 ++++
tests/qemuxml2argvdata/usb-redir-unix.xml | 45 +++++
.../virtio-rng-egd-unix.x86_64-2.5.0.args | 30 ++++
.../virtio-rng-egd-unix.x86_64-latest.args | 33 ++++
tests/qemuxml2argvdata/virtio-rng-egd-unix.xml | 29 ++++
tests/qemuxml2argvmock.c | 3 +-
tests/qemuxml2argvtest.c | 14 ++
28 files changed, 939 insertions(+), 158 deletions(-)
create mode 100644 tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-2.5.0.args
create mode 100644 tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/channel-unix-guestfwd.xml
create mode 100644 tests/qemuxml2argvdata/console-virtio-unix.x86_64-2.5.0.args
create mode 100644 tests/qemuxml2argvdata/console-virtio-unix.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/console-virtio-unix.xml
create mode 100644 tests/qemuxml2argvdata/net-vhostuser.x86_64-2.5.0.args
create mode 100644 tests/qemuxml2argvdata/net-vhostuser.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/parallel-unix-chardev.x86_64-2.5.0.args
create mode 100644 tests/qemuxml2argvdata/parallel-unix-chardev.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/parallel-unix-chardev.xml
create mode 100644 tests/qemuxml2argvdata/smartcard-passthrough-unix.x86_64-2.5.0.args
create mode 100644 tests/qemuxml2argvdata/smartcard-passthrough-unix.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/smartcard-passthrough-unix.xml
create mode 100644 tests/qemuxml2argvdata/usb-redir-unix.x86_64-2.5.0.args
create mode 100644 tests/qemuxml2argvdata/usb-redir-unix.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/usb-redir-unix.xml
create mode 100644 tests/qemuxml2argvdata/virtio-rng-egd-unix.x86_64-2.5.0.args
create mode 100644 tests/qemuxml2argvdata/virtio-rng-egd-unix.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-rng-egd-unix.xml
--
2.16.4
6 years, 5 months
[libvirt] [PATCH] virresctrl: remove bogus virResetLastError
by Ján Tomko
virFileReadValueUint does not log errors for non-existient files,
it merely returns -2.
Commit 12093f1 introduced this.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/util/virresctrl.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
index fb25ca84f0..df5b5124e6 100644
--- a/src/util/virresctrl.c
+++ b/src/util/virresctrl.c
@@ -638,7 +638,6 @@ virResctrlGetMonitorInfo(virResctrlInfoPtr resctrl)
VIR_INFO("The file '" SYSFS_RESCTRL_PATH "/info/L3_MON/num_rmids' "
"does not exist");
ret = 0;
- virResetLastError();
goto cleanup;
} else if (rv < 0) {
/* Other failures are fatal, so just quit */
@@ -653,7 +652,6 @@ virResctrlGetMonitorInfo(virResctrlInfoPtr resctrl)
* will not exist. */
VIR_DEBUG("File '" SYSFS_RESCTRL_PATH
"/info/L3_MON/max_threshold_occupancy' does not exist");
- virResetLastError();
} else if (rv < 0) {
goto cleanup;
}
--
2.16.4
6 years, 5 months
[libvirt] [PATCH] virt-host-validate: Fix build on non-Linux
by Michal Privoznik
For non-Linux platforms we have
virHostValidateCGroupControllers() stub which only reports an
error. But we are not marking the ignored arguments the way we
should.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tools/virt-host-validate-common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c
index 4e70fe9e9c..73e3bdb34c 100644
--- a/tools/virt-host-validate-common.c
+++ b/tools/virt-host-validate-common.c
@@ -322,8 +322,8 @@ int virHostValidateCGroupControllers(const char *hvname,
return ret;
}
#else /* !__linux__ */
-int virHostValidateCGroupControllers(const char *hvname,
- int controllers,
+int virHostValidateCGroupControllers(const char *hvname ATTRIBUTE_UNUSED,
+ int controllers ATTRIBUTE_UNUSED,
virHostValidateLevel level)
{
virHostMsgFail(level, "%s", "This platform does not support cgroups");
--
2.18.0
6 years, 5 months