[libvirt] [PATCH 0/3] qemu: report block job errors from qemu to the user
by Nikolay Shirokovskiy
So that you can see nice report on migration:
"error: operation failed: migration of disk sda failed: No space left on device"
Nikolay Shirokovskiy (3):
qemu: simplify switch case for blockjob events
qemu: use blockjob completed event's error field to detect errors
qemu: report block job errors from qemu to the user
src/qemu/qemu_blockjob.c | 13 +++++++++++--
src/qemu/qemu_blockjob.h | 3 ++-
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_driver.c | 4 ++--
src/qemu/qemu_migration.c | 34 ++++++++++++++++++++++------------
src/qemu/qemu_monitor.c | 5 +++--
src/qemu/qemu_monitor.h | 4 +++-
src/qemu/qemu_monitor_json.c | 12 +++++-------
src/qemu/qemu_process.c | 3 +++
9 files changed, 52 insertions(+), 27 deletions(-)
--
1.8.3.1
8 years, 1 month
[libvirt] [libvirt-glib 00/20] gconfig: <graphics> configuration work
by Christophe Fergeau
Hey,
This series groups 2 series which were sent previously for review,
one from Visarion https://www.redhat.com/archives/libvir-list/2016-August/msg00868.html
and one from Fidencio https://www.redhat.com/archives/libvir-list/2016-March/msg00993.html
I'm putting them together as they touch the same piece of code and thus
conflict with each other. The separation would happen at 11/20 "gconfig:
Implement gvir_config_domain_graphics_spice_get_tls_port()" if I were to send
these separately.
Visarion's changes add support for configuring the <listen> node for the
graphics node, and Fidencio's changes add some base classes to make generic
configuration of local/remote graphics nodes easier, regardless of their
type (VNC/SPICE for example).
This incorporate the various changes I suggested during review, in particular
it renames _set_listen_nodes() in the original series to just _set_listen(),
better naming suggestions welcome.
I've also added a few patches of my own which made sense to have for
completeness.
Christophe
8 years, 1 month
[libvirt] [[PATCH v2] 0/4] try harder to get dest qemu errors on migation
by Nikolay Shirokovskiy
Hi, all.
In case migration fails due to destination qemu exits unexpectedly user
recevies the qemu log in the error message. Unfortunately log is truncated and
the most interesting part is missed (below is the example of such a log [1]).
Actually for the most cases the first patch will be enough to fix the issue.
Originally I thought the problem is qemu logging and reading the log are not in
sync (which is true) so I tried to fix it as well in the next patches.
* diff from v1:
1. split changes to libvirtd and virtlogd to different patches
2. split virtlogd patch further
3. simplify handling eofs and hangups in draining function
[1] log example:
CPU Reset (CPU 0)
EAX=00000000 EBX=00000000 ECX=00000000 EDX=00000000
ESI=00000000 EDI=00000000 EBP=00000000 ESP=00000000
EIP=00000000 EFL=00000000 [-------] CPL=0 II=0 A20=0 SMM=0 HLT=0
ES =0000 00000000 00000000 00000000
CS =0000 00000000 00000000 00000000
SS =0000 00000000 00000000 00000000
DS =0000 00000000 00000000 00000000
FS =0000 00000000 00000000 00000000
GS =0000 00000000 00000000 00000000
LDT=0000 00000000 00000000 00000000
TR =0000 00000000 00000000 00000000
GDT= 00000000 00000000
IDT= 00000000 00000000
CR0=00000000 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
DR6=0000000000000000 DR7=0000000000000000
CCS=00000000 CCD=00000000 CCO=DYNAMIC
EFER=0000000000000000
FCW=0000 FSW=0000 [ST=0] FTW=ff MXCSR=00000000
FPR0=0000000000000000 0000 FPR1=0000000000000000 0000
FPR2=0000000000000000 0000 FPR3=0000000000000000 0000
FPR4=0000000000000000 0000 FPR5=0000000000000000 0000
FPR6=0000000000000000 0000 FPR7=0000000000000000 0000
XMM00=00000000000000000000000000000000 XMM01=00000000000000000000000000000000
XMM02=00000000000000000000000000000000 XMM03=00000000000000000000000000000000
XMM04=00000000000000000000000000000000 XMM05=00000000000000000000000000000000
XMM06=00000000000000000000000000000000 XMM07=00000000000000000000000000000000
CPU Reset (CPU 1)
EAX=00000000 EBX=00000000 ECX=00000000 EDX=000206a1
ESI=00000000 EDI=00000000 EBP=00000000 ESP=00000000
EIP=0000fff0 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0000 00000000 0000ffff 00009300
CS =f000 ffff0000 0000ffff 00009b00
SS =0000 00000000 0000ffff 00009300
DS =0000 00000000 0000ffff 00009300
FS =0000 00000000 0000ffff 00009300
GS =0000 00000000 0000ffff 00009300
LDT=0000 00000000 0000ffff 00008200
TR =0000 00000000 0000ffff 00008b00
GDT= 00000000 0000ffff
IDT= 00000000 0000ffff
CR0=60000010 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=00000000 CCD=00000000 CCO=DYNAMIC
EFER=0000000000000000
FCW=037f FSW=0000 [ST=0] FTW=00 MXCSR=00001f80
FPR0=0000000000000000 0000 FPR1=0000000000000000 0000
FPR2=0000000000000000 0000 FPR3=0000000000000000 0000
FPR4=0000000000000000 0000 FPR5=0000000000000000 0000
FPR6=0000000000000000 0000 FPR7=0000000000000000 0000
XMM00=00000000000000000000000000000000 XMM01=00000000000000000000000000000000
XMM02=00000000000000000000000000000000 XMM03=00000000000000000000000000000000
XMM04=00000000000000000000000000000000 XMM05=00000000000000000000000000000000
XMM06=00000000000000000000000000000000 XMM07=000
qemu: terminating on signal 15 from pid 168133
Nikolay Shirokovskiy (4):
util: remove 1k limit for error messages
virtlogd: stop reading on EOF instead of hangup
virtlogd: add flag to wait for log end on read
qemu: if virtlogd is used then read log tail correctly
src/logging/log_handler.c | 46 ++++++++++++++++++++++++++++++++++++++++------
src/logging/log_protocol.x | 5 +++++
src/qemu/qemu_domain.c | 7 ++++++-
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_process.c | 2 ++
src/util/virerror.c | 9 ++++-----
6 files changed, 58 insertions(+), 12 deletions(-)
--
1.8.3.1
8 years, 1 month
[libvirt] [PATCH V2 0/4]] qemu: report actual vcpu state in virVcpuInfo
by Viktor Mihajlovski
Currently, the virVcpuInfo returned by virDomainGetVcpus() will always
report a state of VIR_VCPU_RUNNING for each defined domain vcpu even if
the vcpu is currently in the halted state.
As the monitor interface is in fact reporting the accurate state, it is
rather easy to transport this information with the existing API.
This is done by
- adding a new state of VIR_VCPU_HALTED
- extending the monitor to pass back the halted state for the vcpus
- adding a new field to the private domain vcpu object reflecting the
halted state for the vcpu
- modifying the driver code to report the vcpu state based on the halted
indicator
- extending virsh vcpuinfo to also display the halted state
The vcpu state is however not recorded in the internal XML format, since
the state can change asynchronously (without notification).
V2 is a rebase on top of Peter Krempa's CPU hotplug modernization.
Viktor Mihajlovski (4):
domain: Add new VCPU state "halted"
qemu: Add monitor support for CPU halted state
qemu: Add domain support for VCPU halted state
qemu: Ensure reported VCPU state is current in driver API
include/libvirt/libvirt-domain.h | 1 +
src/qemu/qemu_domain.c | 69 ++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_domain.h | 5 +++
src/qemu/qemu_driver.c | 23 ++++++++++++--
src/qemu/qemu_monitor.c | 6 +++-
src/qemu/qemu_monitor.h | 5 +++
src/qemu/qemu_monitor_json.c | 3 ++
src/qemu/qemu_monitor_text.c | 8 ++++-
tests/qemumonitorjsontest.c | 8 ++---
tools/virsh-domain.c | 3 +-
10 files changed, 122 insertions(+), 9 deletions(-)
--
1.9.1
8 years, 1 month
[libvirt] [PATCH 0/6] qemu: fix UDP chardev hotplug and make qemumonitorjsontest less useless
by Peter Krempa
Most of the time qemumonitorjson test isn't really testing much. Add support
for actually testing chardev hotplug and fix it for the UDP case.
Peter Krempa (6):
conf: Sanitize formatting of UDP chardev source
tests: qemu: Add support for testing aguments on monitor verbatim
tests: qemumonitorjson: Don't do multiple tests in one virTestRun
tests: qemumonitorjsontest: Do some actual testing in
qemuMonitorJSONTestAttachChardev
qemu: monitor: Simplify construction of chardev backends
qemu: monitor: Properly configure backend for UDP chardevs
src/conf/domain_conf.c | 42 ++++----
src/qemu/qemu_monitor_json.c | 51 +++++-----
tests/qemumonitorjsontest.c | 222 ++++++++++++++++++++++++++++++++-----------
tests/qemumonitortestutils.c | 112 ++++++++++++++++++++++
tests/qemumonitortestutils.h | 6 ++
5 files changed, 326 insertions(+), 107 deletions(-)
--
2.10.0
8 years, 1 month
[libvirt] [PATCH 00/12] Add length (duration) params for iotune throttling
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1349898
Do a little housekeeping and minor adjustments to existing code, then
add the various "-length" options for the <iotune> code.
John Ferlan (12):
docs: Fix typo in libvirt-domain.h parameter description
include: Update description for <iotune> max params
tests: Add blkdeviotune-max xml2xmltest
qemu: Convert from shorthand to longer throttling names
qemu: Adjust how supportMaxOptions is used.
include: Add new definitions for duration for bps/iops throttling
caps: Add new capability for the bps/iops throttling length
qemu: Add length for bps/iops throttling parameters to driver
conf: Add a formatting macro for all the blkiotune values
conf: Adjust the PARSE_IOTUNE macro
conf: Add support for blkiotune "_length" options
qemu: Add the length options to the iotune command line
docs/formatdomain.html.in | 40 +++++-
docs/schemas/domaincommon.rng | 38 ++++++
include/libvirt/libvirt-domain.h | 124 ++++++++++++++++--
src/conf/domain_conf.c | 142 +++++++++++----------
src/conf/domain_conf.h | 6 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 96 ++++++--------
src/qemu/qemu_driver.c | 106 ++++++++++++++-
src/qemu/qemu_monitor.c | 7 +-
src/qemu/qemu_monitor.h | 3 +-
src/qemu/qemu_monitor_json.c | 72 ++++++-----
src/qemu/qemu_monitor_json.h | 3 +-
.../caps_2.6.0-gicv2.aarch64.xml | 1 +
.../caps_2.6.0-gicv3.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 +
tests/qemumonitorjsontest.c | 17 ++-
.../qemuxml2argv-blkdeviotune-max-length.args | 34 +++++
.../qemuxml2argv-blkdeviotune-max-length.xml | 65 ++++++++++
.../qemuxml2argv-blkdeviotune-max.args | 10 +-
.../qemuxml2argv-blkdeviotune-max.xml | 14 +-
.../qemuxml2argv-blkdeviotune.args | 5 +-
tests/qemuxml2argvtest.c | 4 +
.../qemuxml2xmlout-blkdeviotune-max-length.xml | 1 +
.../qemuxml2xmlout-blkdeviotune-max.xml | 1 +
tests/qemuxml2xmltest.c | 2 +
28 files changed, 616 insertions(+), 182 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max-length.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max-length.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-blkdeviotune-max-length.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-blkdeviotune-max.xml
--
2.7.4
8 years, 1 month
[libvirt] [PATCH] qemu: allow 32 slots on pcie-expander-bus, not just 1
by Laine Stump
When I added support for the pcie-expander-bus controller in commit
bc07251f, I incorrectly thought that it only had a single slot
available. Actually it has 32 slots, just like the root complex aka
pcie-root (the part that I *did* get correct is that unlike pcie-root
a pcie-expander-bus doesn't allow any integrated endpoint devices -
only pcie-root-ports and dmi-to-pci-controllers are allowed).
---
src/conf/domain_addr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index 93026c2..0406b50 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -304,13 +304,13 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST;
break;
case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS:
- /* single slot, no hotplug, only accepts pcie-root-port or
+ /* 32 slots, no hotplug, only accepts pcie-root-port or
* dmi-to-pci-bridge
*/
bus->flags = (VIR_PCI_CONNECT_TYPE_PCIE_ROOT_PORT |
VIR_PCI_CONNECT_TYPE_DMI_TO_PCI_BRIDGE);
bus->minSlot = 0;
- bus->maxSlot = 0;
+ bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST;
break;
default:
--
2.7.4
8 years, 1 month
[libvirt] libvirt zsh completions
by Marko Myllynen
Hi,
FWIW, FYI, I've contributed completions for the commands part of libvirt
to zsh upstream, here's a quick screenshot:
$ virsh <TAB>
zsh: do you wish to see all 222 possibilities (111 lines)? n
$ virsh allocpages <TAB>
--add --all --cellno --pagecount --pagesize
$ virsh start <TAB>
f23-test fedora-24-beta rhel-7-server
$ virsh stop <TAB>
f24-test rhel-6-server ubuntu-16.04
$
There's also support for the -c/--connect flag and selective completion
support for the following (domains seen as an example above):
+ domains
+ interfaces
+ networks
+ devices
+ nwfilters
+ pools
+ secrets
+ snapshots
+ volumes
Supported commands are:
virsh virt-admin virt-host-validate virt-pki-validate virt-xml-validate
Since virt-admin requires root/sudo, there are some additional security
checks in zsh upstream to enable sudo for completions only by request.
This will require the next zsh release. I've uploaded a version of these
completions which uses sudo unconditionally to my fedorapeople.org page
and it can be used by the adventurous already today (by placing it under
/usr/share/zsh/*/functions/):
https://myllynen.fedorapeople.org/_libvirt
Cheers,
--
Marko Myllynen
8 years, 1 month
[libvirt] [PATCH v3 0/4] Combine various query-block json call paths
by John Ferlan
I'm not unreasonable ;-) - making the suggested alterations from the review
and NACK of v2/v1 which combined the for loops as well.
v2: http://www.redhat.com/archives/libvir-list/2016-September/msg01483.html
Changes - new patch 1, 3, 4
Alteration to patch 1 of previous series to use the new Steal API
John Ferlan (4):
util: Introduce virJSONValueObjectStealArray
qemu: Create common code for JSON "query-block" call
qemu: Create helper qemuMonitorJSONGetBlockDev
qemu: Create helper qemuMonitorJSONGetBlockDevDevice
src/libvirt_private.syms | 1 +
src/qemu/qemu_monitor_json.c | 157 ++++++++++++++++++++++---------------------
src/util/virjson.c | 43 ++++++++++++
src/util/virjson.h | 2 +
4 files changed, 125 insertions(+), 78 deletions(-)
--
2.7.4
8 years, 1 month
[libvirt] [PATCH RESEND v2 0/5] Implementation of QEMU vhost-scsi
by Eric Farman
[Resending after the release of 2.2.0; no changes other than a rebase
to current master and the associated tweaking to the capabilities patch]
This patch series provides a libvirt implementation of the vhost-scsi
interface in QEMU. As near as I can see, this was discussed upstream in
July 2014[1], and ended in a desire to replace a vhost-scsi controller
in favor of a hostdev element instead[2].
There is no capability check in this series for vhost-scsi in the underlying
QEMU. Using a recent QEMU built with --disable-vhost-scsi fails with "not a
valid device model name."
Host Filesystem Example:
# ls /sys/kernel/config/target/vhost/
discovery_auth naa.5001405df3e54061 version
# ls /sys/kernel/config/target/vhost/naa.5001405df3e54061/tpgt_1/lun/
lun_0
QEMU Example (snippet):
-device vhost-scsi-ccw,wwpn=naa.5001405df3e54061,devno=fe.0.1000
Libvirt Example (snippet):
<hostdev mode='subsystem' type='scsi_host'>
<source protocol='vhost' wwpn='naa.5001405df3e54061'/>
<address type='ccw' cssid='0xfe' ssid='0x0' devno='0x1000'/>
</hostdev>
Guest Viewpoint:
# lsscsi
[1:0:1:0] disk LIO-ORG disk0 4.0 /dev/sda
# dmesg | grep 1:
[ 6.065735] scsi host1: Virtio SCSI HBA
[ 6.093892] scsi 1:0:1:0: Direct-Access LIO-ORG disk0 4.0 PQ: 0 ANSI: 5
[ 6.313615] sd 1:0:1:0: Attached scsi generic sg0 type 0
[ 6.314981] sd 1:0:1:0: [sda] 29360128 512-byte logical blocks: (15.0 GB/14.0 GiB)
[ 6.317290] sd 1:0:1:0: [sda] Write Protect is off
[ 6.317566] sd 1:0:1:0: [sda] Mode Sense: 43 00 10 08
[ 6.317853] sd 1:0:1:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA
[ 6.352722] sd 1:0:1:0: [sda] Attached SCSI disk
Changelog:
v2->v2.1:
- Rebased to current master (6 September)
v1->v2: https://www.redhat.com/archives/libvir-list/2016-August/msg01028.html
- Rebase
- Applies to current master (20 August)
- Added a capability check for QEMU 2.7
- Fixed the qemuxml2argv tests as the -smp options had changed
- Reworked ccwaddrs parameter in virDomainCCWAddressAssign call
- Comments
- Squashed documentation, XML schema, XML parsing, and infrastructure
patches into a single patch
- Switched from "hostdev type='scsi'" to "hostdev type='scsi_host'";
this removes the refactoring patches since we're not shoe-horning
a new SCSI protocol into the existing code
- Reworked the handling of the fd's such that we send them to qemu
after any possible errors could occur and cause us to back out
- s/qemuBuildSCSIVhostHostdevDevStr/qemuBuildHostHostdevDevStr/
- Added virBufferCheckError, and an error message for vhostfdSize > 1,
in qemuBuildHostHostdevDevStr
- Added qemuBuildDeviceAddressStr in qemuBuildHostHostdevDevStr, thus
superceding the last patch in the v1 series
- Other
- Simplified the vhostfd logic to just be a single int, rather than
an alloc'd array (left the vhostfdSize described above as an
identifier for if QEMU ever supports multiple vhostfds)
- Replaced "qemuMonitorAddDevice" with "qemuMonitorAddDeviceWithFd"
in hotplug routine
v1: https://www.redhat.com/archives/libvir-list/2016-July/msg01004.html
[1] http://www.redhat.com/archives/libvir-list/2014-July/msg01235.html
[2] http://www.redhat.com/archives/libvir-list/2014-July/msg01390.html
Eric Farman (5):
Introduce a "scsi_host" hostdev type
qemu: Introduce vhost-scsi capability
qemu: Add vhost-scsi string for -device parameter
qemu: Allow hotplug of vhost-scsi device
tests: Introduce basic vhost-scsi test
docs/formatdomain.html.in | 24 ++++
docs/schemas/domaincommon.rng | 23 ++++
src/conf/domain_audit.c | 2 +
src/conf/domain_conf.c | 62 ++++++++-
src/conf/domain_conf.h | 17 +++
src/libvirt_private.syms | 1 +
src/qemu/qemu_capabilities.c | 3 +
src/qemu/qemu_capabilities.h | 3 +
src/qemu/qemu_command.c | 80 +++++++++++
src/qemu/qemu_command.h | 6 +
src/qemu/qemu_domain_address.c | 10 ++
src/qemu/qemu_hotplug.c | 149 +++++++++++++++++++++
src/security/security_dac.c | 2 +
src/util/virscsi.c | 26 ++++
src/util/virscsi.h | 1 +
tests/domaincapsschemadata/full.xml | 1 +
tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 +
.../caps_2.6.0-gicv2.aarch64.xml | 1 +
.../caps_2.6.0-gicv3.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 +
.../qemuxml2argv-hostdev-scsi-vhost-scsi.args | 24 ++++
.../qemuxml2argv-hostdev-scsi-vhost-scsi.xml | 33 +++++
tests/qemuxml2argvmock.c | 12 ++
tests/qemuxml2argvtest.c | 3 +
31 files changed, 491 insertions(+), 2 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi.xml
--
1.9.1
8 years, 1 month