[libvirt] [PATCH 00/18] qemu: virtio-{non-}transitional support
by Cole Robinson
This series adds support for virtio-transitional and
virtio-non-transitional qemu devices.
qemu patches, queued for qemu 4.0.0:
https://lists.gnu.org/archive/html/qemu-devel/2018-12/msg00923.html
Previous libvirt discussion around this:
https://www.redhat.com/archives/libvir-list/2018-August/msg01073.html
Previous incomplete RFC here:
https://www.redhat.com/archives/libvir-list/2019-January/msg00346.html
Long story short we need to expose these options so apps have a
usable way to support rhel6 + virtio + q35. This series exposes
the new devices as model= values. This required adding new
model= attributes for several devices.
Here's the breakdown. 'standard names' here means the model names
virtio, virtio-transitional, and virtio-non-transitional
* Simply extended:
virtio-rng: extend existing <rng model=X> to handle standard names
vhost-vsock: extend existing <vsock model=X> to handle standard names
virtio-memballoon: extend existings <memballoon model=X> to handle
standard names
virtio-net: extend existing qemu <model type=X> handling to
support standard names
* Extended with caveats:
virtio-serial: extend <controller type='virtio-serial'> to handle
existing model=X attribute, with standard names
virtio-scsi: extend <controller type='scsi' model=X> to handle the
additional names virtio-transitional and virtio-non-transitional.
model= already supports virtio-scsi here which is a departure from
just model='virtio' which most others use, but I chose to not
extend that pattern and stick with the names the other devices
are using
vhost-scsi: extend <hostdev model=X> handling for the protocol=vhost
case, to accept standard names. I stuck with standard names over
using vhost-transitional or similar, for consistency with other
devices.
* New XML elements
virtio-blk: add new <disk model=X/> attribute with standard names
virtio-fs: add new <filesystem model=X> attribute with standard names
virtio-input-host: add new <input model=X> attribute with
standard names
At the end is an extension to domaincapabilities to report the
disk bus model values. Until domaincapabilities is fully fleshed
out with support for all the above devices, apps can use that
disk model check to assume transitional devices are available
for all of the above.
Cole Robinson (18):
tests: Add capabilities data for QEMU 4.0.0 x86_64
conf: Add <disk model='virtio-{non-}transitional'/>
qemu: Support disk model=virtio-{non-}transitional
conf: Add virDomainNetHasVirtioModel
qemu: Support interface model=virtio-{non-}transitional
conf: Add <hostdev model='virtio-{non-}transitional'/>
qemu: Support hostdev model=virtio-{non-}transitional
qemu: Support rng model=virtio-{non-}transitional
conf: Add <filesystem model='virtio-{non-}transitional'/>
qemu: Support filesystem model=virtio-{non-}transitional
qemu: Move memballoon validation out of command.c
qemu: Support memballoon model=virtio-{non-}transitional
qemu: Support vsock model=virtio-{non-}transitional
conf: Add <input model='virtio-{non-}transitional'/>
qemu: Support input model=virtio-{non-}transitional
qemu: Support scsi controller model=virtio-{non-}transitional
qemu: Support virtio-serial controller model=virtio-{non-}transitional
qemu: domcaps: Report disk <enum name="model">
docs/formatdomain.html.in | 39 +-
docs/schemas/domaincommon.rng | 60 +-
src/conf/domain_capabilities.c | 1 +
src/conf/domain_capabilities.h | 1 +
src/conf/domain_conf.c | 216 +-
src/conf/domain_conf.h | 68 +-
src/libvirt_private.syms | 5 +
src/libxl/libxl_conf.c | 2 +
src/qemu/qemu_capabilities.c | 55 +
src/qemu/qemu_capabilities.h | 28 +
src/qemu/qemu_command.c | 219 +-
src/qemu/qemu_domain.c | 47 +-
src/qemu/qemu_domain_address.c | 69 +-
src/qemu/qemu_driver.c | 9 +-
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_interface.c | 8 +-
src/qemu/qemu_process.c | 3 +-
src/security/virt-aa-helper.c | 2 +-
src/vbox/vbox_common.c | 2 +
src/vmx/vmx.c | 4 +-
.../bhyve_basic.x86_64.xml | 1 +
.../bhyve_fbuf.x86_64.xml | 1 +
.../bhyve_uefi.x86_64.xml | 1 +
tests/domaincapsschemadata/full.xml | 6 +
.../domaincapsschemadata/libxl-xenfv-usb.xml | 1 +
.../domaincapsschemadata/libxl-xenpv-usb.xml | 1 +
.../qemu_1.7.0.x86_64.xml | 1 +
.../qemu_2.12.0-virt.aarch64.xml | 1 +
.../qemu_2.12.0.ppc64.xml | 1 +
.../qemu_2.12.0.s390x.xml | 1 +
.../qemu_2.12.0.x86_64.xml | 1 +
.../qemu_2.6.0-virt.aarch64.xml | 1 +
.../qemu_2.6.0.aarch64.xml | 1 +
.../domaincapsschemadata/qemu_2.6.0.ppc64.xml | 1 +
.../qemu_2.6.0.x86_64.xml | 1 +
.../domaincapsschemadata/qemu_2.7.0.s390x.xml | 1 +
.../qemu_2.8.0-tcg.x86_64.xml | 1 +
.../domaincapsschemadata/qemu_2.8.0.s390x.xml | 1 +
.../qemu_2.8.0.x86_64.xml | 1 +
.../qemu_2.9.0-q35.x86_64.xml | 1 +
.../qemu_2.9.0-tcg.x86_64.xml | 1 +
.../qemu_2.9.0.x86_64.xml | 1 +
.../domaincapsschemadata/qemu_3.0.0.s390x.xml | 1 +
.../qemu_4.0.0.x86_64.xml | 153 +
tests/domaincapstest.c | 4 +
.../caps_4.0.0.x86_64.replies | 23180 ++++++++++++++++
.../caps_4.0.0.x86_64.xml | 1404 +
tests/qemucapabilitiestest.c | 1 +
.../virtio-non-transitional.x86_64-3.1.0.args | 63 +
...virtio-non-transitional.x86_64-latest.args | 62 +
.../virtio-non-transitional.xml | 40 +
.../virtio-transitional.x86_64-3.1.0.args | 50 +
.../virtio-transitional.x86_64-latest.args | 52 +
.../qemuxml2argvdata/virtio-transitional.xml | 40 +
tests/qemuxml2argvmock.c | 2 +-
tests/qemuxml2argvtest.c | 6 +
.../virtio-non-transitional.xml | 121 +
.../virtio-transitional.xml | 80 +
tests/qemuxml2xmltest.c | 17 +
59 files changed, 26031 insertions(+), 112 deletions(-)
create mode 100644 tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml
create mode 100644 tests/qemucapabilitiesdata/caps_4.0.0.x86_64.replies
create mode 100644 tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml
create mode 100644 tests/qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args
create mode 100644 tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-non-transitional.xml
create mode 100644 tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args
create mode 100644 tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-transitional.xml
create mode 100644 tests/qemuxml2xmloutdata/virtio-non-transitional.xml
create mode 100644 tests/qemuxml2xmloutdata/virtio-transitional.xml
--
2.20.1
5 years, 8 months
[libvirt] [PATCH] dosc: schema: fix usb source address device attribute format
by Nikolay Shirokovskiy
Device attribute does not have dotted "portAddr" format. Instead it
has single number format described but "usbAddr" which corresponds
to device parsing code in virDomainHostdevSubsysUSBDefParseXML.
Looks like [1] mistakenly changed device format for hostdev devices.
And [2] copy-n-paste this for hostdev network interfaces.
[1] 31710a53 Modify USB port to be defined as a port path
[2] 3b1c191f conf: parse/format type='hostdev' network interfaces
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
docs/schemas/domaincommon.rng | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index aa50eac..8c8d87e 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2765,7 +2765,7 @@
<ref name="usbAddr"/>
</attribute>
<attribute name="device">
- <ref name="usbPort"/>
+ <ref name="usbAddr"/>
</attribute>
</group>
</choice>
@@ -4709,7 +4709,7 @@
<ref name="usbAddr"/>
</attribute>
<attribute name="device">
- <ref name="usbPort"/>
+ <ref name="usbAddr"/>
</attribute>
</element>
</define>
--
1.8.3.1
5 years, 8 months
[libvirt] [jenkins-ci PATCH] Add support for cross compiling libvirt via Debian
by Daniel P. Berrangé
Debian's filesystem layout has a nice advantage over Fedora which is
that it can install non-native RPMs in the main root filesystem. It is
thus possible to prepare an x86_64 filesystem containing -dev packages
for a foreign architecture, along with a GCC cross compiler.
QEMU has used this technique to facilitate developer build testing of
non-x86 architectures, since few people have access to physical
hardware for most of these architectures. For the same reason it would
be helpful to libvirt developers.
This docker file allows creation of containers buildenv-cross-$ARCH
for arm64, armel, armhf, mips, mipsel, mips64el, ppc64el, s390x, based
off Debian 9, in which libvirt can be cross-compiled. Debian can support
further architectures, but only by using the unstable 'sid' repos. This
does not enable use of 'sid' but it could be added fairly easily at a
later date if desired. Most of the other architectures are fairly
old & obscure, the main interesting exception being riscv64.
If qemu-user emulators are registered with the kernel binfmt, then it
is theoretically possible to run "make check" tool, though this has not
been tested.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
.gitignore | 1 +
cross-build/arch-config.csv | 8 +++
cross-build/buildenv-cross.docker.in | 96 ++++++++++++++++++++++++++++
3 files changed, 105 insertions(+)
create mode 100644 cross-build/arch-config.csv
create mode 100644 cross-build/buildenv-cross.docker.in
diff --git a/.gitignore b/.gitignore
index b25c15b..4884352 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
*~
+cross-build/*docker
diff --git a/cross-build/arch-config.csv b/cross-build/arch-config.csv
new file mode 100644
index 0000000..36fcb5f
--- /dev/null
+++ b/cross-build/arch-config.csv
@@ -0,0 +1,8 @@
+arm64,crossbuild-essential-arm64,aarch64-linux-gnu
+armel,crossbuild-essential-armel,arm-linux-gnueabi
+armhf,crossbuild-essential-armhf,arm-linux-gnueabihf
+mips64el,gcc-mips64el-linux-gnuabi64,mips64el-linux-gnuabi64
+mips,gcc-mips-linux-gnu,mips-linux-gnu
+mipsel,gcc-mipsel-linux-gnu,mipsel-linux-gnu
+ppc64el,crossbuild-essential-ppc64el,powerpc64le-linux-gnu
+s390x,gcc-multilib-s390x-linux-gnu,s390x-linux-gnu
diff --git a/cross-build/buildenv-cross.docker.in b/cross-build/buildenv-cross.docker.in
new file mode 100644
index 0000000..97a9e69
--- /dev/null
+++ b/cross-build/buildenv-cross.docker.in
@@ -0,0 +1,96 @@
+#
+# ::ARCH:: cross-compiler target
+#
+FROM debian:stretch-slim
+
+# Grab the updated list of packages
+RUN apt update && apt dist-upgrade -yy
+
+# First some common native binaries. Any program that the
+# build will execute needs to have a native binary package
+# installed. We don't want to rely on qemu-user emulation
+# for executing non-native binaries as that is slow & flaky
+RUN DEBIAN_FRONTEND=noninteractive \
+ apt-get install -y --no-install-recommends \
+ git \
+ build-essential \
+ ca-certificates \
+ libtool\
+ autoconf \
+ automake \
+ python3 \
+ xsltproc \
+ parted \
+ radvd \
+ qemu-system-common \
+ dwarves \
+ libxml2-utils \
+ dnsmasq-base \
+ openssh-client \
+ netcat-openbsd \
+ ebtables \
+ iptables \
+ sheepdog \
+ qemu-utils \
+ qemu-system-x86 \
+ pkg-config
+
+
+# Add the ::ARCH:: architecture
+RUN dpkg --add-architecture ::ARCH::
+
+
+# Grab the freshly updated list of packages
+RUN apt update
+
+
+# Pull in the native package for the cross-compiler
+RUN DEBIAN_FRONTEND=noninteractive \
+ apt-get install -y --no-install-recommends \
+ ::COMPILER::
+
+# Finally pull in the foreign architecture library
+# packages that we're going to link against. Everything
+# here should be a -dev package. Binaries belong earlier
+RUN DEBIAN_FRONTEND=noninteractive \
+ apt-get install -y --no-install-recommends \
+ libxml2-dev:::ARCH:: \
+ libncurses5-dev:::ARCH:: \
+ libreadline-dev:::ARCH:: \
+ zlib1g-dev:::ARCH:: \
+ libgcrypt20-dev:::ARCH:: \
+ libgnutls28-dev:::ARCH:: \
+ libavahi-client-dev:::ARCH:: \
+ libsasl2-dev:::ARCH:: \
+ libparted-dev:::ARCH:: \
+ libdevmapper-dev:::ARCH:: \
+ uuid-dev:::ARCH:: \
+ libudev-dev:::ARCH:: \
+ libpciaccess-dev:::ARCH:: \
+ libpolkit-gobject-1-dev:::ARCH:: \
+ libcap-ng-dev:::ARCH:: \
+ libnl-3-dev:::ARCH:: \
+ libnl-route-3-dev:::ARCH:: \
+ libyajl-dev:::ARCH:: \
+ libpcap0.8-dev:::ARCH:: \
+ libsanlock-dev:::ARCH:: \
+ libaudit-dev:::ARCH:: \
+ libselinux1-dev:::ARCH:: \
+ libapparmor-dev:::ARCH:: \
+ libdbus-1-dev:::ARCH:: \
+ librbd-dev:::ARCH:: \
+ librados-dev:::ARCH:: \
+ libfuse-dev:::ARCH:: \
+ libssh2-1-dev:::ARCH:: \
+ libcurl4-gnutls-dev:::ARCH:: \
+ libacl1-dev:::ARCH:: \
+ libiscsi-dev:::ARCH:: \
+ xfslibs-dev:::ARCH:: \
+ libssh-dev:::ARCH:: \
+ libgnutls28-dev:::ARCH::
+
+# Tell libvirt which architecture we want to target
+ENV LIBVIRT_CONFIGURE_OPTS "--host=::ABI:: --build=x86_64-linux-gnu --target=::ABI::"
+
+# Tell pkg-config where to find the non-native .pc files
+ENV PKG_CONFIG_LIBDIR=/usr/lib/::ABI::/pkgconfig
--
2.20.1
5 years, 8 months
[libvirt] [PATCH 00/10] snapshot: misc fixes
by Nikolay Shirokovskiy
The patch series aims to uniformly handle snapshot attribute for disks from
multiple places - snapshot definitions, domain definitions, snapshot operation
and defaults which is done in [1] utimately. Patch [2] makes a step towards
this goal. Other patches are fixes along the way that disables some invalid
cases on conversely enable previously disable valid cases.
The patches with most reasoning ([2] and [3]) are effectively revert Eric's
patch f9670bf thus I hope Eric will take a look.
Nikolay Shirokovskiy (10):
conf: snapshot: fix comment in _virDomainSnapshotDef
conf: snapshot: don't pass flags from different family
conf: snapshot: check disk with path on parse
conf: snapshot: align exernal/internal snapshot the same way [2]
conf: snapshot: remove snapshot mode checking from disk align [3]
conf: virDomainSnapshotAlignDisks: use convinient variable
qemu: disable internal snapshot of readonly disk
qemu: snapshot: fix for case of disk with empty source
qemu: snapshot: align disks consistently [1]
conf: snapshot: make disk aligns same on redefinition
src/conf/domain_conf.c | 6 +--
src/conf/snapshot_conf.c | 103 ++++++++++++++++++++++-------------------------
src/conf/snapshot_conf.h | 5 +--
src/qemu/qemu_driver.c | 27 ++++++++++---
src/test/test_driver.c | 5 +--
5 files changed, 74 insertions(+), 72 deletions(-)
--
1.8.3.1
5 years, 8 months
[libvirt] [PATCH v2] qemu: Assume migration with a network disk migration is safe
by Michal Privoznik
If a domain has a disk that is type='network' we require specific
cache mode to allow migration with it (either 'directsync' or
'none'). This doesn't make much sense since network disks are
supposed to be safe to migrate by default.
At the same time, we should be checking for the actual source
type, not apparent type set in the domain XML.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
v2 of:
https://www.redhat.com/archives/libvir-list/2019-January/msg01070.html
diff to v1:
- Allow just every network disk
- Check for actual disk type not the apparent one
src/qemu/qemu_migration.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 52aa665640..1433b2c2f3 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1236,7 +1236,7 @@ qemuMigrationSrcIsSafe(virDomainDefPtr def,
continue;
/* However, disks on local FS (e.g. ext4) are not safe. */
- if (virDomainDiskGetType(disk) == VIR_STORAGE_TYPE_FILE) {
+ if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_FILE) {
if ((rc = virFileIsSharedFS(src)) < 0) {
return false;
} else if (rc == 0) {
@@ -1248,8 +1248,8 @@ qemuMigrationSrcIsSafe(virDomainDefPtr def,
return false;
else if (rc == 1)
continue;
- } else if (disk->src->type == VIR_STORAGE_TYPE_NETWORK &&
- disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_RBD) {
+ } else if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_NETWORK) {
+ /* But network disks are safe again. */
continue;
}
--
2.19.2
5 years, 9 months
[libvirt] [PATCH 0/3] scsi-disk: Device Identification fixes
by Kevin Wolf
The vendor specific designator in the Device Identification VPD page has
two problems:
1. It defaults to the BlockBackend name (-drive id=...), which everyone
expected to be a host detail that the guest never sees
2. With -blockdev based setups it defaults to an empty string; if this
default is used with more than one disk, the guest OS will interpret
this as a single multipath disk.
We can address problem 2 immediately, and start running the deprecation
clock for problem 1.
Related bug reports:
https://bugzilla.redhat.com/show_bug.cgi?id=1669446
https://bugzilla.redhat.com/show_bug.cgi?id=1668248
Kevin Wolf (3):
scsi-disk: Don't use empty string as device id
scsi-disk: Add device_id property
scsi-disk: Deprecate device_id fallback to BlockBackend name
hw/scsi/scsi-disk.c | 41 ++++++++++++++++++++++++++++-------------
qemu-deprecated.texi | 22 +++++++++++++++++++++-
2 files changed, 49 insertions(+), 14 deletions(-)
--
2.20.1
5 years, 9 months
[libvirt] [PATCH 0/9] Add semicolon to macro calls
by Cole Robinson
Recently I was experimenting with the vim-ale plugin for
basic code validation on file write. For C the simplest
option seemed to be using cppcheck. However cppcheck when
trivially invoked on many files in our codebase will error
if a macro call is missing an ending semicolon. Example:
$ cppcheck -q src/qemu/qemu_command.c
[src/qemu/qemu_command.c:109]: (error) There is an unknown macro here somewhere. Configuration is required. If VIR_ENUM_DECL is a macro then please configure it.
Googling around it sounds like it's generally considered
good practice to end macro calls with a semicolon, and
we have mixed usage throughout the code. So let's standardize
on adding semicolon to a few macro calls.
The first 4 patches add semicolons to all VIR_ENUM_DECL,
VIR_ENUM_IMPL, VIR_LOG_INIT, VIR_ONCE_GLOBAL INIT calls
The next 4 patches rework the macro definitions slightly
so that the compiler will _require_ callers to specify
use a semicolon. I don't know if this is controversial
or not so I kept the patches separate, but they can
be squashed together if desired. The only one that's
kinda suspect is adding a dummy struct to eat the
semicolon in VIR_ONCE_GLOBAL_INIT, maybe someone has a
better suggestion.
The last patch is a bit of a detour but if we are
interested in doing it now is as good a time as we
will get: it changes VIR_ENUM_IMPL to add a newline
after the last entry. This means diffs extending the
enum value list only generate one line diff instead of
two. An example is in the patch description. If people
agree with the idea, it could be squashed into patch #2
to reduce 'git blame' pollution
Thanks,
Cole
Cole Robinson (9):
Add semicolon to VIR_ENUM_DECL calls
Add semicolon to VIR_ENUM_IMPL calls
Add semicolon to VIR_LOG_INIT calls
Add semicolon to VIR_ONCE_GLOBAL_INIT calls
Require a semicolon for VIR_ENUM_DECL calls
Require a semicolon for VIR_ENUM_IMPL calls
Require a semicolon for VIR_LOG_INIT calls
Require a semicolon for VIR_ONCE_GLOBAL_INIT calls
Add newline after last entry in VIR_ENUM_IMPL calls
src/access/viraccessperm.c | 30 ++-
src/bhyve/bhyve_conf.c | 2 +-
src/conf/capabilities.c | 9 +-
src/conf/cpu_conf.c | 21 +-
src/conf/cpu_conf.h | 12 +-
src/conf/domain_capabilities.c | 5 +-
src/conf/domain_conf.c | 313 ++++++++++++++++--------
src/conf/domain_conf.h | 220 ++++++++---------
src/conf/domain_event.c | 2 +-
src/conf/interface_conf.c | 3 +-
src/conf/interface_conf.h | 2 +-
src/conf/netdev_vlan_conf.c | 3 +-
src/conf/network_conf.c | 17 +-
src/conf/network_conf.h | 8 +-
src/conf/network_event.c | 2 +-
src/conf/node_device_conf.c | 12 +-
src/conf/node_device_conf.h | 8 +-
src/conf/node_device_event.c | 2 +-
src/conf/numa_conf.c | 9 +-
src/conf/numa_conf.h | 6 +-
src/conf/nwfilter_conf.c | 21 +-
src/conf/object_event.c | 2 +-
src/conf/secret_event.c | 2 +-
src/conf/snapshot_conf.c | 6 +-
src/conf/snapshot_conf.h | 4 +-
src/conf/storage_adapter_conf.c | 3 +-
src/conf/storage_adapter_conf.h | 2 +-
src/conf/storage_conf.c | 24 +-
src/conf/storage_conf.h | 16 +-
src/conf/storage_event.c | 2 +-
src/conf/virdomainobjlist.c | 2 +-
src/conf/virinterfaceobj.c | 2 +-
src/conf/virnetworkobj.c | 2 +-
src/conf/virnodedeviceobj.c | 2 +-
src/conf/virnwfilterbindingobj.c | 2 +-
src/conf/virnwfilterbindingobjlist.c | 2 +-
src/conf/virsecretobj.c | 2 +-
src/conf/virstorageobj.c | 4 +-
src/datatypes.c | 2 +-
src/interface/interface_backend_netcf.c | 2 +-
src/libxl/libxl_conf.c | 2 +-
src/libxl/libxl_domain.c | 2 +-
src/libxl/libxl_domain.h | 2 +-
src/libxl/libxl_migration.c | 2 +-
src/locking/lock_daemon.c | 5 +-
src/logging/log_daemon.c | 5 +-
src/logging/log_handler.c | 2 +-
src/lxc/lxc_conf.c | 2 +-
src/lxc/lxc_domain.c | 6 +-
src/lxc/lxc_domain.h | 6 +-
src/lxc/lxc_monitor.c | 2 +-
src/network/leaseshelper.c | 3 +-
src/node_device/node_device_udev.c | 2 +-
src/qemu/qemu_agent.c | 8 +-
src/qemu/qemu_blockjob.c | 2 +-
src/qemu/qemu_capabilities.c | 2 +-
src/qemu/qemu_command.c | 43 ++--
src/qemu/qemu_command.h | 2 +-
src/qemu/qemu_conf.c | 2 +-
src/qemu/qemu_domain.c | 14 +-
src/qemu/qemu_domain.h | 8 +-
src/qemu/qemu_driver.c | 10 +-
src/qemu/qemu_extdevice.c | 2 +-
src/qemu/qemu_migration.h | 2 +-
src/qemu/qemu_migration_cookie.c | 3 +-
src/qemu/qemu_migration_params.c | 4 +-
src/qemu/qemu_migration_params.h | 2 +-
src/qemu/qemu_monitor.c | 16 +-
src/qemu/qemu_monitor.h | 8 +-
src/qemu/qemu_monitor_json.c | 18 +-
src/qemu/qemu_tpm.c | 2 +-
src/remote/remote_daemon.c | 5 +-
src/rpc/virkeepalive.c | 2 +-
src/rpc/virnetclient.c | 2 +-
src/rpc/virnetclientprogram.c | 2 +-
src/rpc/virnetclientstream.c | 2 +-
src/rpc/virnetdaemon.c | 2 +-
src/rpc/virnetsaslcontext.c | 2 +-
src/rpc/virnetserver.c | 2 +-
src/rpc/virnetserverclient.c | 2 +-
src/rpc/virnetserverprogram.c | 2 +-
src/rpc/virnetserverservice.c | 2 +-
src/rpc/virnetsocket.c | 2 +-
src/rpc/virnettlscontext.c | 2 +-
src/test/test_driver.c | 2 +-
src/util/vircgroup.c | 3 +-
src/util/vircgroupbackend.c | 3 +-
src/util/vircgroupv1.c | 3 +-
src/util/vircgroupv2.c | 3 +-
src/util/virclosecallbacks.c | 2 +-
src/util/virconf.c | 3 +-
src/util/virconf.h | 2 +-
src/util/virdevmapper.c | 2 +-
src/util/virdnsmasq.c | 2 +-
src/util/virerror.c | 4 +-
src/util/virfdstream.c | 2 +-
src/util/virfilecache.c | 4 +-
src/util/virfirewall.c | 12 +-
src/util/virgic.c | 2 +-
src/util/virhash.c | 2 +-
src/util/virhook.c | 35 +--
src/util/virhostdev.c | 2 +-
src/util/viridentity.c | 2 +-
src/util/virkeycode.c | 2 +-
src/util/virlog.c | 5 +-
src/util/virlog.h | 2 +-
src/util/virmdev.c | 5 +-
src/util/virmdev.h | 2 +-
src/util/virnetdev.c | 9 +-
src/util/virnetdev.h | 6 +-
src/util/virnetdevmacvlan.c | 3 +-
src/util/virnetdevmacvlan.h | 2 +-
src/util/virnetdevvlan.h | 2 +-
src/util/virnetdevvportprofile.c | 6 +-
src/util/virnetdevvportprofile.h | 4 +-
src/util/virpci.c | 9 +-
src/util/virpci.h | 4 +-
src/util/virperf.c | 3 +-
src/util/virportallocator.c | 2 +-
src/util/virprocess.c | 3 +-
src/util/virresctrl.c | 18 +-
src/util/virscsi.c | 2 +-
src/util/virscsivhost.c | 2 +-
src/util/virsecret.c | 3 +-
src/util/virsecret.h | 2 +-
src/util/virstorageencryption.c | 7 +-
src/util/virstorageencryption.h | 4 +-
src/util/virstoragefile.c | 20 +-
src/util/virstoragefile.h | 10 +-
src/util/virstoragefilebackend.c | 2 +-
src/util/virsysinfo.c | 3 +-
src/util/virsysinfo.h | 2 +-
src/util/virthread.h | 5 +-
src/util/virthreadjob.c | 2 +-
src/util/virtypedparam.c | 3 +-
src/util/virtypedparam.h | 2 +-
src/util/virusb.c | 2 +-
src/util/virutil.c | 6 +-
src/util/virutil.h | 10 +-
src/vmware/vmware_conf.c | 3 +-
src/vmware/vmware_conf.h | 2 +-
src/vmx/vmx.c | 2 +-
src/vz/vz_driver.c | 2 +-
tests/virfilecachetest.c | 2 +-
tools/virsh-domain-monitor.c | 60 +++--
tools/virsh-domain.c | 102 ++++----
tools/virsh-network.c | 12 +-
tools/virsh-nodedev.c | 4 +-
tools/virsh-pool.c | 8 +-
tools/virsh-secret.c | 4 +-
tools/virsh-volume.c | 6 +-
tools/virt-admin.c | 4 +-
152 files changed, 861 insertions(+), 622 deletions(-)
--
2.20.1
5 years, 9 months
[libvirt] [PATCH 0/3] bhyve: bhyve:commandline followup fixes
by Roman Bogorodskiy
Roman Bogorodskiy (3):
bhyve: bhyveDomainDefNamespaceFormatXML cleanup
bhyve: emit warning when using bhyve:commandline
docs: bhyve: warn about bhyve:commandline risks
docs/drvbhyve.html.in | 5 +++++
src/bhyve/bhyve_command.c | 4 ++++
src/bhyve/bhyve_domain.c | 4 ++--
3 files changed, 11 insertions(+), 2 deletions(-)
--
2.20.1
5 years, 9 months
[libvirt] [PATCH v2] qemu-nbd: Deprecate qemu-nbd --partition
by Eric Blake
The existing qemu-nbd --partition code claims to handle logical
partitions up to 8, since its introduction in 2008 (commit 7a5ca86).
However, the implementation is bogus (actual MBR logical partitions
form a sort of linked list, with one partition per extended table
entry, rather than four logical partitions in a single extended
table), making the code unlikely to work for anything beyond -P5 on
actual guest images. What's more, the code does not support GPT
partitions, which are becoming more popular, and maintaining device
subsetting in both NBD and the raw device is unnecessary duplication
of effort (even if it is not too difficult).
Note that obtaining the offsets of a partition (MBR or GPT) can be
learned by using 'qemu-nbd -c /dev/nbd0 file.qcow2 && sfdisk --dump
/dev/nbd0', but by the time you've done that, you might as well
just mount /dev/nbd0p1 that the kernel creates for you instead of
bothering with qemu exporting a subset. Or, keeping to just
user-space code, use nbdkit's partition filter, which has already
known both GPT and primary MBR partitions for a while, and was
just recently enhanced to support arbitrary logical MBR parititions.
Start the clock on the deprecation cycle, with examples of how
to write device subsetting without using -P.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
v2: actual nbdkit example [Rich], improved doc wording
---
qemu-deprecated.texi | 33 +++++++++++++++++++++++++++++++++
qemu-nbd.texi | 6 ++++--
qemu-nbd.c | 2 ++
3 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 219206a836f..d35e78c81ff 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -175,3 +175,36 @@ The above, converted to the current supported format:
@subsubsection "irq": "" (since 3.0.0)
The ``irq'' property is obsoleted.
+
+@section Related binaries
+
+@subsection qemu-nbd --partition (since 4.0.0)
+
+The ``qemu-nbd --partition $digit'' code (also spelled @option{-P})
+can only handle MBR partitions, and has never correctly handled
+logical partitions beyond partition 5. If you know the offset and
+length of the partition (perhaps by using @code{sfdisk} within the
+guest), you can achieve the effect of exporting just that subset of
+the disk by use of the @option{--image-opts} option with a raw
+blockdev using the @code{offset} and @code{size} parameters layered on
+top of any other existing blockdev. For example, if partition 1 is
+100MiB long starting at 1MiB, the old command:
+
+@code{qemu-nbd -t -P 1 -f qcow2 file.qcow2}
+
+can be rewritten as:
+
+@code{qemu-nbd -t --image-opts driver=raw,offset=1M,size=100M,file.driver=qcow2,file.backing.driver=file,file.backing.filename=file.qcow2}
+
+Alternatively, the @code{nbdkit} project provides a more powerful
+partition filter on top of its nbd plugin, which can be used to select
+an arbitrary MBR or GPT partition on top of any other full-image NBD
+export. Using this to rewrite the above example results in:
+
+@code{qemu-nbd -t -k /tmp/sock -f qcow2 file.qcow2 &}
+@code{nbdkit -f --filter=partition nbd socket=/tmp/sock partition=1}
+
+Note that if you are exposing the export via /dev/nbd0, it is easier
+to just export the entire image and then mount only /dev/nbd0p1 than
+it is to reinvoke @command{qemu-nbd -c /dev/nbd0} limited to just a
+subset of the image.
diff --git a/qemu-nbd.texi b/qemu-nbd.texi
index 386bece4680..d0c51828149 100644
--- a/qemu-nbd.texi
+++ b/qemu-nbd.texi
@@ -56,8 +56,10 @@ auto-detecting.
@item -r, --read-only
Export the disk as read-only.
@item -P, --partition=@var{num}
-Only expose MBR partition @var{num}. Understands physical partitions
-1-4 and logical partitions 5-8.
+Deprecated: Only expose MBR partition @var{num}. Understands physical
+partitions 1-4 and logical partition 5. New code should instead use
+@option{--image-opts} with the raw driver wrapping a subset of the
+original image.
@item -B, --bitmap=@var{name}
If @var{filename} has a qcow2 persistent bitmap @var{name}, expose
that bitmap via the ``qemu:dirty-bitmap:@var{name}'' context
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 1f7b2a03f5d..00c07fd27ea 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -787,6 +787,8 @@ int main(int argc, char **argv)
flags &= ~BDRV_O_RDWR;
break;
case 'P':
+ warn_report("The '-P' option is deprecated; use --image-opts with "
+ "a raw device wrapper for subset exports instead");
if (qemu_strtoi(optarg, NULL, 0, &partition) < 0 ||
partition < 1 || partition > 8) {
error_report("Invalid partition '%s'", optarg);
--
2.20.1
5 years, 9 months
[libvirt] [PATCH 0/3] qemu: Improve handling of format for 'network' and 'volume' disks (blockdev-add saga)
by Peter Krempa
Peter Krempa (3):
tests: qemu: Test network disks without format specified explicitly
qemu: domain: Assume 'raw' default storage format also for network
storage
qemu: domain: Treat 'volume' disks as 'raw' if neiter user nor pool
provided format
src/qemu/qemu_domain.c | 8 ++++++--
tests/qemuxml2argvdata/disk-network-gluster.xml | 2 +-
tests/qemuxml2argvdata/disk-network-iscsi.xml | 2 +-
tests/qemuxml2argvdata/disk-network-nbd.xml | 2 +-
tests/qemuxml2argvdata/disk-source-pool-mode.args | 6 +++---
tests/qemuxml2argvdata/disk-source-pool.args | 4 ++--
6 files changed, 14 insertions(+), 10 deletions(-)
--
2.20.1
5 years, 9 months