[libvirt] [PATCH] util: storage: drop VIR_STORAGE_FILE_AUTO_SAFE
by Yi Li
merge VIR_STORAGE_FILE_AUTO_SAFE/VIR_STORAGE_FILE_AUTO to VIR_STORAGE_FILE_AUTO
virStorageFileProbeFormatFromBuf will probe the backingStore format.
Fix the booting issue when setting backingStore format (QCOW image) to RAW image.
Signed-off-by: Yi Li <yili(a)winhong.com>
---
src/qemu/qemu_block.c | 2 --
src/util/virstoragefile.c | 4 +---
src/util/virstoragefile.h | 1 -
3 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 66b1d11..0b99efc 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -1367,7 +1367,6 @@ qemuBlockStorageSourceGetBlockdevFormatProps(virStorageSourcePtr src)
driver = virStorageFileFormatTypeToString(src->format);
break;
- case VIR_STORAGE_FILE_AUTO_SAFE:
case VIR_STORAGE_FILE_AUTO:
case VIR_STORAGE_FILE_NONE:
case VIR_STORAGE_FILE_COW:
@@ -2275,7 +2274,6 @@ qemuBlockStorageSourceCreateGetFormatProps(virStorageSourcePtr src,
case VIR_STORAGE_FILE_DIR:
return 0;
- case VIR_STORAGE_FILE_AUTO_SAFE:
case VIR_STORAGE_FILE_AUTO:
case VIR_STORAGE_FILE_NONE:
virReportError(VIR_ERR_INTERNAL_ERROR,
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 7288e18..2ebb2f1 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -692,7 +692,7 @@ qedGetBackingStore(char **res,
if (flags & QED_F_BACKING_FORMAT_NO_PROBE)
*format = VIR_STORAGE_FILE_RAW;
else
- *format = VIR_STORAGE_FILE_AUTO_SAFE;
+ *format = VIR_STORAGE_FILE_AUTO;
return BACKING_STORE_OK;
}
@@ -4916,8 +4916,6 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
goto cleanup;
if (backingFormat == VIR_STORAGE_FILE_AUTO)
- backingStore->format = VIR_STORAGE_FILE_RAW;
- else if (backingFormat == VIR_STORAGE_FILE_AUTO_SAFE)
backingStore->format = VIR_STORAGE_FILE_AUTO;
else
backingStore->format = backingFormat;
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index b65cd4c..c9deb6f 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -60,7 +60,6 @@ VIR_ENUM_DECL(virStorage);
typedef enum {
- VIR_STORAGE_FILE_AUTO_SAFE = -2,
VIR_STORAGE_FILE_AUTO = -1,
VIR_STORAGE_FILE_NONE = 0,
VIR_STORAGE_FILE_RAW,
--
2.7.5
5 years, 4 months
[libvirt] [PATCH v4 00/42] Split the libvirtd daemon into per-driver daemons
by Daniel P. Berrangé
This is what all the driver refactoring I've done has been about
enabling.
We gain new daemons for each driver, for the primary virt drivers:
virtlibxld
virtlxcd
virtqemud
virtvboxd
virtvzd
And again for the secondary drivers
virtinterfaced
virtnetworkd
virtnodedevd
virtnwfilterd
virtsecretd
virtstoraged
Finally to support IP connectivity, and also the legacy lbivirtd UNIX
domain socket (for the old libvirt remote driver SSH tunnelling):
virtproxyd
The the sake of facilitating upgrades, the existing libvirtd still
exists and works the same way it always has.
You either run libvirtd, or you run the per-driver daemons, never both.
The remote driver will look to see whether libvirtd is running to figure
out whether to connect to libvirtd or the new per-driver daemons.
When auto-spawning daemons for nonroot users, we default to spawning the
per-driver daemons.
This can be controlled with a UR parameter "?mode=direct|legacy|auto",
where 'direct' means per-driver and 'legacy' means libvirtd (or indirect
via virtproxyd if that's running).
Canged in v4:
- Addressed previous review feedback
- Temporarily drop identity patches, which will continue
in a separate patch series, once this is merged.
Changed in v3:
- Add identity forwarding between daemons for polkit auth
- Make virtxend sockets conditional on Xen kernel
- Other misc review fixes
Changed in v2:
- Added systemd unit files for service & sockets, ensuring
conflicts with libvirtd
- Fixed proxy to actually handle probing of URIs (still not
quite perfect)
- Renamed virtlibxld to virtxend as "xen" is the user facing
name of the URI
- Lazy loading of secondary drivers, so connecting to virtqemud
does't auto-spawn all secondary driver daemons, until a
relevant API is actually invoked
- Actually generated config files / augeas files per daemon
- Abort daemon startup if driver fails to load
- Many other fixes
A few nice to have things, but not merge blocking
- MAYBE make it possible to disable build of libvirtd, or of the per-driver
daemons so downstream vendors can decide which to ship. Alternatively
they can just not include the binary in the package file list ?
- Tuning of the daemon defaults for worker threads to better suit
the fact that we have per-driver daemons
- More work on RPM packaging to allow install of per-driver daemosn
without pulling in libvirtd too
Daniel P. Berrangé (42):
build: make augeas-gentest.pl write to stdout
build: collapse rules adding augeas tests to CLEANFILES
build: create all augeas test files in same dir as their source
build: use a common rule for checking augeas test data files
build: centralize rule for handling generated config files
remote: stop trying to print help as giant blocks of text
remote: conditionalize daemon name in libvirtd daemon
remote: conditionalize driver loading in libvirtd daemon
remote: conditionalize IP socket usage in libvirtd daemon
build: use @CONFIG@ instead of ::CONFIG:: in augeas tests
remote: conditionalize IP socket config in libvirtd.conf
remote: conditionalize IP socket config in augeas definitions
remote: remove useless $(LIBSOCKET) variable
remote: refactor & rename variables for building libvirtd
build: don't hardcode /etc in the config related files
remote: reduce duplication in systemd unit file make rules into one
remote: conditionalize systemd socket unit files
remote: refactor how list of systemd unit files is built
remote: in per-driver daemons ensure that state initialize succeeds
remote: introduce virtproxyd daemon to handle IP connectivity
secret: introduce virtsecretd daemon
network: introduce virtnetworkd daemon
interface: introduce virtinterfaced daemon
storage: introduce virtstoraged daemon
nodedev: introduce virtnodedevd daemon
nwfilter: introduce virtnwfilterd daemon
libxl: introduce virtxend daemon
qemu: introduce virtqemud daemon
lxc: introduce virtlxcd daemon
vbox: introduce virtvboxd daemon
bhyve: introduce virtbhyved daemon
vz: introduce virtvzd daemon
admin: add ability to connect to the per-driver daemon sockets
remote: get rid of bogus ATTRIBUTE_UNUSED annotation client param
remote: change generated methods to not directly access connection
remote: fix lock ordering mistake in event registration
remote: change hand written methods to not directly access connection
remote: open secondary drivers via remote driver if needed
remote: handle autoprobing of driver within virtproxyd
remote: use enum helpers for parsing remote driver transport
remote: refactor the code for choosing the UNIX socket path
remote: enable connecting to the per-driver daemons
.gitignore | 63 +-
.gnulib | 2 +-
build-aux/augeas-gentest.pl | 22 +-
docs/remote.html.in | 18 +
libvirt.spec.in | 91 ++
m4/virt-driver-remote.m4 | 15 +
src/Makefile.am | 32 +-
src/admin/admin_server_dispatch.c | 9 +
src/bhyve/Makefile.inc.am | 56 +-
src/bhyve/bhyve_driver.c | 10 +-
src/bhyve/test_libvirtd_bhyve.aug.in | 2 +-
src/driver-state.h | 8 +-
src/driver.h | 2 +
src/interface/Makefile.inc.am | 63 +
src/interface/interface_backend_netcf.c | 8 +-
src/interface/interface_backend_udev.c | 4 +-
src/interface/virtinterfaced.service.in | 24 +
src/libvirt-admin.c | 33 +-
src/libvirt.c | 42 +-
src/libvirt_internal.h | 1 +
src/libxl/Makefile.inc.am | 81 +-
src/libxl/libxl_driver.c | 10 +-
src/libxl/test_libvirtd_libxl.aug.in | 2 +-
src/libxl/virtxend.service.in | 29 +
src/locking/Makefile.inc.am | 77 +-
src/locking/test_libvirt_lockd.aug.in | 2 +-
src/locking/test_libvirt_sanlock.aug.in | 2 +-
src/locking/test_virtlockd.aug.in | 2 +-
src/locking/virtlockd.service.in | 2 +-
src/logging/Makefile.inc.am | 23 +-
src/logging/test_virtlogd.aug.in | 2 +-
src/logging/virtlogd.service.in | 2 +-
src/lxc/Makefile.inc.am | 78 +-
src/lxc/lxc_driver.c | 12 +-
src/lxc/test_libvirtd_lxc.aug.in | 2 +-
src/lxc/virtlxcd.service.in | 40 +
src/network/Makefile.inc.am | 62 +
src/network/bridge_driver.c | 4 +-
src/network/virtnetworkd.service.in | 25 +
src/node_device/Makefile.inc.am | 63 +
src/node_device/node_device_hal.c | 12 +-
src/node_device/node_device_udev.c | 8 +-
src/node_device/virtnodedevd.service.in | 24 +
src/nwfilter/Makefile.inc.am | 63 +
src/nwfilter/nwfilter_driver.c | 12 +-
src/nwfilter/virtnwfilterd.service.in | 24 +
src/qemu/Makefile.inc.am | 77 +-
src/qemu/qemu_driver.c | 8 +-
src/qemu/test_libvirtd_qemu.aug.in | 2 +-
src/qemu/virtqemud.service.in | 40 +
src/remote/Makefile.inc.am | 285 ++--
src/remote/libvirtd-admin.socket.in | 15 +-
src/remote/libvirtd-ro.socket.in | 15 +-
src/remote/libvirtd-tcp.socket.in | 13 +-
src/remote/libvirtd-tls.socket.in | 13 +-
src/remote/{libvirtd.aug => libvirtd.aug.in} | 26 +-
.../{libvirtd.conf => libvirtd.conf.in} | 62 +-
src/remote/libvirtd.service.in | 2 +-
src/remote/libvirtd.socket.in | 11 +-
src/remote/remote_daemon.c | 303 ++--
src/remote/remote_daemon.h | 13 +
src/remote/remote_daemon_config.c | 47 +-
src/remote/remote_daemon_config.h | 10 +-
src/remote/remote_daemon_dispatch.c | 1263 ++++++++++-------
src/remote/remote_driver.c | 422 ++++--
src/remote/remote_driver.h | 4 -
src/remote/test_libvirtd.aug.in | 24 +-
src/remote/virtproxyd.service.in | 24 +
src/rpc/gendispatch.pl | 96 +-
src/secret/Makefile.inc.am | 63 +
src/secret/secret_driver.c | 8 +-
src/secret/virtsecretd.service.in | 24 +
src/storage/Makefile.inc.am | 62 +
src/storage/storage_driver.c | 8 +-
src/storage/virtstoraged.service.in | 26 +
src/vbox/Makefile.inc.am | 63 +
src/vbox/virtvboxd.service.in | 25 +
src/vz/Makefile.inc.am | 63 +
src/vz/virtvzd.service.in | 25 +
src/vz/vz_driver.c | 14 +-
tools/libvirt-guests.service.in | 2 +-
81 files changed, 3051 insertions(+), 1275 deletions(-)
create mode 100644 src/interface/virtinterfaced.service.in
create mode 100644 src/libxl/virtxend.service.in
create mode 100644 src/lxc/virtlxcd.service.in
create mode 100644 src/network/virtnetworkd.service.in
create mode 100644 src/node_device/virtnodedevd.service.in
create mode 100644 src/nwfilter/virtnwfilterd.service.in
create mode 100644 src/qemu/virtqemud.service.in
rename src/remote/{libvirtd.aug => libvirtd.aug.in} (89%)
rename src/remote/{libvirtd.conf => libvirtd.conf.in} (92%)
create mode 100644 src/remote/virtproxyd.service.in
create mode 100644 src/secret/virtsecretd.service.in
create mode 100644 src/storage/virtstoraged.service.in
create mode 100644 src/vbox/virtvboxd.service.in
create mode 100644 src/vz/virtvzd.service.in
--
2.21.0
5 years, 4 months
[libvirt] [PATCH v2 0/9] Add virDomainGetGuestInfo()
by Jonathon Jongsma
This series adds several bits of guest information provided by a new API
function virDomainGetGuestInfo(). There is an implementation for qemu using the
guest agent. In particular, it adds information about logged-in users, guest
OS, timezone, hostname, and filesystem info.
This is the second version of this patch series. Various things were improved,
but the biggest difference is that this version includes filesystem
information. Filesystem information is already accessible via the public API
virDomainGetFSInfo(), but recent versions of the qemu guest agent added
additional information, and the existing public API is not able to be extended
without breaking API since it returns a C struct. This new API uses typed
parameters so that it can be extended as necessary when new fields are added.
The overall API follows the bulk stats API quite closely, and tries to return
data in similar ways (for example, the "users.N.*" field name scheme was
inspired by various stats fields).
It should be noted that like version 1 of this patch series, the API still only
operates on a single domain, not a list of domains. I'm willing to consider
changing the API to operate on a list of domains if that is the concensus, but
I lean toward keeping it simpler.
Here's an example of the output of the virsh command added in this patch
operating on a fedora 30 guest:
virsh # guestinfo fedora30
user.count : 1
user.0.name : test
user.0.login-time : 1566422940895
os.id : fedora
os.name : Fedora
os.pretty-name : Fedora 30 (Workstation Edition)
os.version : 30 (Workstation Edition)
os.version-id : 30
os.machine : x86_64
os.variant : Workstation Edition
os.variant-id : workstation
os.kernel-release : 5.2.7-200.fc30.x86_64
os.kernel-version : #1 SMP Thu Aug 8 05:35:29 UTC 2019
timezone.name : CDT
timezone.offset : -18000
hostname : myhostname
fs.count : 3
fs.0.name : dm-0
fs.0.mountpoint : /
fs.0.fstype : ext4
fs.0.total-bytes : 25928306688
fs.0.used-bytes : 10762133504
fs.0.disk.count : 1
fs.0.disk.0.alias : vda
fs.0.disk.0.serial : 947684ABZ8639Q
fs.0.disk.0.device : /dev/vda2
fs.1.name : vda1
fs.1.mountpoint : /boot
fs.1.fstype : ext4
fs.1.total-bytes : 952840192
fs.1.used-bytes : 229019648
fs.1.disk.count : 1
fs.1.disk.0.alias : vda
fs.1.disk.0.serial : 947684ABZ8639Q
fs.1.disk.0.device : /dev/vda1
fs.2.name : md127
fs.2.mountpoint : /run/media/test/971b1edc-da61-4015-b465-560a9b1b6e9b
fs.2.fstype : ext4
fs.2.total-bytes : 1950134272
fs.2.used-bytes : 6291456
fs.2.disk.count : 2
fs.2.disk.0.alias : vdb
fs.2.disk.0.device : /dev/vdb1
fs.2.disk.1.alias : vdc
fs.2.disk.1.device : /dev/vdc1
In contrast, here is the output of the virsh command operating on a fedora24
guest:
virsh # guestinfo fedora24
error: Reconnected to the hypervisor
fs.count : 2
fs.0.name : dm-0
fs.0.mountpoint : /
fs.0.fstype : ext4
fs.0.disk.count : 1
fs.0.disk.0.alias : vda
fs.1.name : vda1
fs.1.mountpoint : /boot
fs.1.fstype : ext4
fs.1.disk.count : 1
fs.1.disk.0.alias : vda
However, if you specifically request an info category that is not supported by
the guest agent:
virsh # guestinfo --user fedora24
error: internal error: unable to execute QEMU agent command 'guest-get-users': The command guest-get-users has not been found
Jonathon Jongsma (9):
lib: add virDomainGetGuestInfo()
remote: implement virDomainGetGuestInfo
qemu: add helper for getting guest users
qemu: add helper function for querying OS info
qemu: add helper for querying timezone info
qemu: add support for new fields in FSInfo
qemu: add helper for getting full FSInfo
qemu: Implement virDomainGetGuestInfo()
virsh: add 'guestinfo' command
include/libvirt/libvirt-domain.h | 14 +
src/driver-hypervisor.h | 8 +
src/libvirt-domain.c | 117 ++++++
src/libvirt_public.syms | 1 +
src/qemu/qemu_agent.c | 482 ++++++++++++++++++++++-
src/qemu/qemu_agent.h | 9 +
src/qemu/qemu_driver.c | 110 ++++++
src/remote/remote_daemon_dispatch.c | 41 ++
src/remote/remote_driver.c | 53 +++
src/remote/remote_protocol.x | 21 +-
src/remote_protocol-structs | 12 +
tests/qemuagenttest.c | 576 +++++++++++++++++++++++++++-
tools/virsh-domain.c | 85 ++++
13 files changed, 1494 insertions(+), 35 deletions(-)
--
2.21.0
5 years, 4 months
[libvirt] [PATCH 00/19] Add vhost-user-gpu support
by marcandre.lureau@redhat.com
From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Hi,
This series of patches adds support for running virtio GPUs in
seperate processes, thanks to vhost-user backend.
The QEMU support landed for 4.1. There are several benefits of running
the GPU/virgl in an external process, since Mesa is rather heavy on
the qemu main loop, and may block for a while, or crash.
The external GPU process is started with one end of a socket pair, the
other end is given to a QEMU chardev attached to a device. The
external process is also added to the cgroup to limit resources usage.
Thanks
Since RFC:
- discover helpers following the vhost-user spec
- change vhost-user <video> model for a vhostuser attribute
- add a patch to specify the rendernode on <accel>
- change the way command line is built, following qemu series changes
- socket labeling
- a few cleanup patches
- rebased
Marc-André Lureau (19):
device-conf: removed unneeded virDomainDeviceInfoCopy()
tpm: minor argument comment fix
qemu_firmware: only set nfeatures on success
qemu: extract out qemuFetchConfigs from firmware
domain: add "vhostuser" attribute to virtio video model
domain: add rendernode attribute on <accel>
qemu-cgroup: allow accel rendernode access
qemu: add vhost-user-gpu capabilities checks
qemu: check that qemu is vhost-user-vga capable
qemu: validate virtio-gpu with vhost-user
qemu: restrict 'virgl=' option to non-vhostuser video type
qemu: add vhost-user helpers
qemu: add qemuSecurityStartVhostUserGPU helper
qemu: add vhost-user-gpu helper unit
qemu: prepare domain for vhost-user GPU
qemu: start/stop the vhost-user-gpu external device
qemu: build vhost-user GPU devices
tests: mock execv/execve
tests: add vhost-user-gpu xml2argv tests
docs/formatdomain.html.in | 11 +
docs/schemas/domaincommon.rng | 16 +-
src/conf/device_conf.c | 22 +-
src/conf/device_conf.h | 4 +-
src/conf/domain_conf.c | 33 +-
src/conf/domain_conf.h | 2 +
src/libvirt_private.syms | 1 -
src/qemu/Makefile.inc.am | 6 +
src/qemu/qemu_capabilities.c | 6 +
src/qemu/qemu_capabilities.h | 4 +
src/qemu/qemu_cgroup.c | 24 ++
src/qemu/qemu_command.c | 54 ++-
src/qemu/qemu_configs.c | 183 ++++++++
src/qemu/qemu_configs.h | 31 ++
src/qemu/qemu_domain.c | 10 +-
src/qemu/qemu_extdevice.c | 79 +++-
src/qemu/qemu_extdevice.h | 5 +
src/qemu/qemu_firmware.c | 146 +------
src/qemu/qemu_process.c | 18 +-
src/qemu/qemu_security.c | 48 +++
src/qemu/qemu_security.h | 6 +
src/qemu/qemu_tpm.c | 2 +-
src/qemu/qemu_vhost_user.c | 395 ++++++++++++++++++
src/qemu/qemu_vhost_user.h | 51 +++
src/qemu/qemu_vhost_user_gpu.c | 307 ++++++++++++++
src/qemu/qemu_vhost_user_gpu.h | 54 +++
tests/Makefile.am | 9 +
.../etc/qemu/vhost-user/40-gpu.json | 1 +
.../etc/qemu/vhost-user/50-gpu.json | 0
.../qemu/vhost-user/test-vhost-user-gpu | 11 +
.../usr/share/qemu/vhost-user/30-gpu.json | 1 +
.../usr/share/qemu/vhost-user/50-gpu.json | 8 +
.../usr/share/qemu/vhost-user/60-gpu.json | 1 +
tests/qemuvhostusertest.c | 132 ++++++
.../vhost-user-gpu-secondary.args | 35 ++
.../vhost-user-gpu-secondary.xml | 44 ++
tests/qemuxml2argvdata/vhost-user-vga.args | 32 ++
tests/qemuxml2argvdata/vhost-user-vga.xml | 41 ++
tests/qemuxml2argvtest.c | 21 +
tests/virfilewrapper.c | 22 +
40 files changed, 1690 insertions(+), 186 deletions(-)
create mode 100644 src/qemu/qemu_configs.c
create mode 100644 src/qemu/qemu_configs.h
create mode 100644 src/qemu/qemu_vhost_user.c
create mode 100644 src/qemu/qemu_vhost_user.h
create mode 100644 src/qemu/qemu_vhost_user_gpu.c
create mode 100644 src/qemu/qemu_vhost_user_gpu.h
create mode 120000 tests/qemuvhostuserdata/etc/qemu/vhost-user/40-gpu.json
create mode 100644 tests/qemuvhostuserdata/etc/qemu/vhost-user/50-gpu.json
create mode 100755 tests/qemuvhostuserdata/usr/libexec/qemu/vhost-user/test-vhost-user-gpu
create mode 120000 tests/qemuvhostuserdata/usr/share/qemu/vhost-user/30-gpu.json
create mode 100644 tests/qemuvhostuserdata/usr/share/qemu/vhost-user/50-gpu.json
create mode 120000 tests/qemuvhostuserdata/usr/share/qemu/vhost-user/60-gpu.json
create mode 100644 tests/qemuvhostusertest.c
create mode 100644 tests/qemuxml2argvdata/vhost-user-gpu-secondary.args
create mode 100644 tests/qemuxml2argvdata/vhost-user-gpu-secondary.xml
create mode 100644 tests/qemuxml2argvdata/vhost-user-vga.args
create mode 100644 tests/qemuxml2argvdata/vhost-user-vga.xml
--
2.22.0.rc2.384.g1a9a72ea1d
5 years, 4 months
[libvirt] [PATCH] storage_driver: Don't crash in storagePoolCreateXML
by Michal Privoznik
In my recent patches I've introduced
virStoragePoolObjIsStarting() which is then used to protect
storage pool definition when the pool object is locked and
unlocked during long running jobs. Well, my patches did not
anticipate that @obj can be NULL under 'cleanup' label in
storagePoolCreateXML() (for instance when parsing XML fails).
This imperfection is causing libvirtd to crash then.
Fixes: 13284a6b83 storage_driver: Protect pool def during startup and build
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/storage/storage_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index cd9f14a2c0..30940b5dcf 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -808,7 +808,7 @@ storagePoolCreateXML(virConnectPtr conn,
pool = virGetStoragePool(conn, def->name, def->uuid, NULL, NULL);
cleanup:
- if (virStoragePoolObjIsStarting(obj)) {
+ if (obj && virStoragePoolObjIsStarting(obj)) {
if (!virStoragePoolObjIsActive(obj))
virStoragePoolUpdateInactive(obj);
virStoragePoolObjSetStarting(obj, false);
--
2.21.0
5 years, 4 months
[libvirt] [PATCH 0/2] rpm: fix usage of 'nc' dep
by Daniel P. Berrangé
Daniel P. Berrangé (2):
rpm: depend on /usr/bin/nc instead of nc
rpm: move nc dep into the libvirt-daemon sub-RPM
libvirt.spec.in | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--
2.21.0
5 years, 4 months
[libvirt] [PATCH v3] tools: console: Relax stream EOF handling
by Roman Bolshakov
Regular VM shutdown triggers the error for existing session of virsh
console and it returns with non-zero exit code:
error: internal error: console stream EOF
The message and status code are misleading because there's no real
error. virStreamRecv returns 0 correctly when EOF is reached.
Existing implementations of esx, fd, and remote streams behave the same
for virStreamFinish and virStreamAbort: they close the stream. So, we
can continue to use virStreamAbort to handle EOF and errors from
virStreamRecv but additonally we can report error if virStreamAbort
fails.
Fixes: 29f2b5248c6 ("tools: console: pass stream/fd errors to user")
Signed-off-by: Roman Bolshakov <r.bolshakov(a)yadro.com>
---
tools/virsh-console.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/tools/virsh-console.c b/tools/virsh-console.c
index e16f841e57..a235a9a283 100644
--- a/tools/virsh-console.c
+++ b/tools/virsh-console.c
@@ -106,7 +106,9 @@ virConsoleShutdown(virConsolePtr con)
if (con->st) {
virStreamEventRemoveCallback(con->st);
- virStreamAbort(con->st);
+ if (virStreamAbort(con->st) < 0)
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot terminate console stream"));
virStreamFree(con->st);
con->st = NULL;
}
@@ -172,10 +174,6 @@ virConsoleEventOnStream(virStreamPtr st,
if (got == -2)
goto cleanup; /* blocking */
if (got <= 0) {
- if (got == 0)
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("console stream EOF"));
-
virConsoleShutdown(con);
goto cleanup;
}
--
2.22.0
5 years, 4 months
[libvirt] [PATCH v1 00/11] Couple of storage driver improvements
by Michal Privoznik
Patches 02/11, 09/11 and finally 11/11 are actual bug fixes. The
rest is a preparation work. More detailed:
02/11 - Fixes a refcounting issue (and thus invalid memory access)
09/11 - Fixes a problem where starting a transitive pool which
has a persistent config may lead to it's disappearance
11/11 - Tries to relax locking to allow more concurrent access
Michal Prívozník (11):
virStoragePoolObjRemove: Don't unlock pool object upon return
virStoragePoolObjListForEach: Grab a reference for pool object
storagePoolRefreshImpl: Fix variable name in comment
virStoragePoolUpdateInactive: Don't call virStoragePoolObjEndAPI
virstorageobj: Rename virStoragePoolObjAssignDef
virStoragePoolObjListAdd: Turn boolean arg into flags
virStoragePoolObjListAdd: Separate out definition assignment
virstorageobj: Introduce VIR_STORAGE_POOL_OBJ_LIST_ADD_LIVE flag
storagePoolCreateXML: Don't lose persistent storage on failed create
storage_driver: Protect pool def during startup and build
storage: Drop and reacquire pool obj lock in some backends
src/conf/virstorageobj.c | 89 ++++++++++++++++++++------
src/conf/virstorageobj.h | 17 ++++-
src/libvirt_private.syms | 4 +-
src/storage/storage_backend_disk.c | 11 +++-
src/storage/storage_backend_fs.c | 13 +++-
src/storage/storage_backend_logical.c | 15 +++--
src/storage/storage_backend_vstorage.c | 9 ++-
src/storage/storage_backend_zfs.c | 7 +-
src/storage/storage_driver.c | 67 +++++++++++--------
src/test/test_driver.c | 21 ++----
10 files changed, 181 insertions(+), 72 deletions(-)
--
2.21.0
5 years, 4 months
[libvirt] RFC: revival of hotplug/unplug for PCI Multifunction devices in QEMU guests
by Daniel Henrique Barboza
Hi,
This is labeled as RFC but it's more like a FYI to let people know and
comment beforehand. Shiva sent a 28 patch series last year that implements
hotplug/unplug support for PCI multifunction devices [1]. The design
motivation of his work was based in a RFC sent to this mailing list back
in 2016 [2].
I'll briefly summarize the goals and motivations here. What we have today
in Libvirt:
- no hotplug/unplug support for multifunction PCI devices
This is explained in details in [2]. When hotplugging a multifunction
device, QEMU will queue the hotplug operation of all non-zero functions and,
when function 0 is hotplugged, all functions are hotplugged together. This
is true for all archs that supports PCI multifunction devices in QEMU. For
unplug it varies: x86 will unplug all functions if any function is
unplugged,
ppc64 needs to unplug each one.
Due to the nature of how Libvirt hotplug works now, hotplug of these devices
is not possible. All hotplugs are considered in an isolated manner. Even if
we hotplug each function in the proper order (i.e. leaving function 0 last),
Libvirt can assign different slots in the guest for each. Similar problems
happens with hot-unplug.
This feature aims to address these by creating a new <devices> element,
exclusive for multifunction devices, that aggregates all functions of a
device
in a single operation. To handle this new element, the existing
attach/detach
functions in the QEMU driver now handles multiple devices.
Attaching/detaching
a single device is routed away from the specialized multifunction code to be
handled to the existing attach/detach code base.
- no support for partial assignment of functions
We can't make the assumption that the guest will always assign all devices
of a multifunction device. Some functions might be a security risk to expose
to a guest, or the device can behave differently depending on the amount
of functions assigned.
Even if the 'leftover' functions can't be used to anything else in the host,
the decision of full/partial assignment of functions should come from the
user, not us. We can't predict how any other hardware vendor will setup
its devices.
This patch series also handles this case.
------
The latest version of this feature, rebase to cdd362e0e7a (the current
master as I'm writing this), can be found at:
https://github.com/danielhb/libvirt/tree/multifunction-rc2
This is a work still ongoing that it's not ready for contribution yet
(first patches that changes the unit test code are breaking existing
tests). The feature itself is being stress tested using a Broadcom BCM5719
with 4 functions and it looks solid. I'll see if I can grab a x86 env
with a multifunction card to test it there too when I have the chance.
Thoughts/comments are welcome. Instead of dropping a 28+ patch set for
review, I'm planning into sending smaller chunks that makes senses
individually.
Thanks,
DHB
[1] https://www.redhat.com/archives/libvir-list/2018-March/msg00729.html
[2] https://www.redhat.com/archives/libvir-list/2016-April/msg01057.html
5 years, 4 months
[libvirt] [PATCH] virpci: Rename virPCIDevice{Bind, Unbind}FromStubWithOverride
by Michal Privoznik
After my previous patches we have virPCIDeviceBindToStub() and
virPCIDeviceUnbindFromStub() which really do nothing but call
virPCIDeviceBindToStubWithOverride() and
virPCIDeviceUnbindFromStubWithOverride() respectively.
Drop "WithOverride" from the names and drop the thin wrappers.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under trivial rule.
src/util/virpci.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/src/util/virpci.c b/src/util/virpci.c
index 6724a8ad9e..ee78151e74 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -1136,7 +1136,7 @@ virPCIDeviceBindWithDriverOverride(virPCIDevicePtr dev,
}
static int
-virPCIDeviceUnbindFromStubWithOverride(virPCIDevicePtr dev)
+virPCIDeviceUnbindFromStub(virPCIDevicePtr dev)
{
if (!dev->unbind_from_stub) {
VIR_DEBUG("Unbind from stub skipped for PCI device %s", dev->name);
@@ -1147,13 +1147,7 @@ virPCIDeviceUnbindFromStubWithOverride(virPCIDevicePtr dev)
}
static int
-virPCIDeviceUnbindFromStub(virPCIDevicePtr dev)
-{
- return virPCIDeviceUnbindFromStubWithOverride(dev);
-}
-
-static int
-virPCIDeviceBindToStubWithOverride(virPCIDevicePtr dev)
+virPCIDeviceBindToStub(virPCIDevicePtr dev)
{
const char *stubDriverName;
VIR_AUTOFREE(char *) stubDriverPath = NULL;
@@ -1192,12 +1186,6 @@ virPCIDeviceBindToStubWithOverride(virPCIDevicePtr dev)
return 0;
}
-static int
-virPCIDeviceBindToStub(virPCIDevicePtr dev)
-{
- return virPCIDeviceBindToStubWithOverride(dev);
-}
-
/* virPCIDeviceDetach:
*
* Detach this device from the host driver, attach it to the stub
--
2.21.0
5 years, 4 months