[libvirt] [PATCH 0/2] conf: refresh network ports missing from network driver
by Laine Stump
Patch 2/2 is the actual fix. 1/2 is just to make the fix simpler.
NB: these two patches should also be included with the other patches for
https://bugzilla.redhat.com/1745815
Laine Stump (2):
conf: take advantage of VIR_AUTO* in virDomainNetCreatePort()
conf: refresh network ports missing from network driver on restart
src/conf/domain_conf.c | 82 +++++++++++++++++++-----------------
src/conf/virnetworkportdef.h | 1 +
2 files changed, 44 insertions(+), 39 deletions(-)
--
2.21.0
5 years, 1 month
[libvirt] [PATCH] domain_conf: Unref video private data in virDomainVideoDefClear()
by Michal Privoznik
The private data for video definition is created in
virDomainVideoDefNew() and we attempt to free it in
virDomainVideoDefFree(). This seems to work, except
the free function calls clear function which zeroes
out the whole structure and thus virObjectUnref()
which is called on private data does nothing.
2,568 bytes in 107 blocks are definitely lost in loss record 207 of 213
at 0x4A35476: calloc (vg_replace_malloc.c:752)
by 0x50A6048: virAllocVar (viralloc.c:346)
by 0x513CC5A: virObjectNew (virobject.c:243)
by 0x4DC1DEE: qemuDomainVideoPrivateNew (qemu_domain.c:1337)
by 0x51A6BD6: virDomainVideoDefNew (domain_conf.c:2831)
by 0x51B9F06: virDomainVideoDefParseXML (domain_conf.c:15541)
by 0x51CB761: virDomainDefParseXML (domain_conf.c:21158)
by 0x51C5973: virDomainDefParseNode (domain_conf.c:21708)
by 0x51C583A: virDomainDefParse (domain_conf.c:21663)
by 0x51C58AE: virDomainDefParseFile (domain_conf.c:21688)
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 67555c9be3..c290baf953 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2853,6 +2853,7 @@ virDomainVideoDefClear(virDomainVideoDefPtr def)
if (def->driver)
VIR_FREE(def->driver->vhost_user_binary);
VIR_FREE(def->driver);
+ virObjectUnref(def->privateData);
memset(def, 0, sizeof(*def));
}
@@ -2864,7 +2865,6 @@ void virDomainVideoDefFree(virDomainVideoDefPtr def)
return;
virDomainVideoDefClear(def);
- virObjectUnref(def->privateData);
VIR_FREE(def);
}
--
2.21.0
5 years, 1 month
[libvirt] [glib PATCH] gconfig-domain-video: Add bochs video device
by Fabiano Fidêncio
https://bugzilla.redhat.com/show_bug.cgi?id=1753670
Signed-off-by: Fabiano Fidêncio <fidencio(a)redhat.com>
---
libvirt-gconfig/libvirt-gconfig-domain-video.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-video.h b/libvirt-gconfig/libvirt-gconfig-domain-video.h
index 973ba72..8431f6b 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-video.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-video.h
@@ -63,7 +63,8 @@ typedef enum {
GVIR_CONFIG_DOMAIN_VIDEO_MODEL_XEN,
GVIR_CONFIG_DOMAIN_VIDEO_MODEL_VBOX,
GVIR_CONFIG_DOMAIN_VIDEO_MODEL_QXL,
- GVIR_CONFIG_DOMAIN_VIDEO_MODEL_VIRTIO
+ GVIR_CONFIG_DOMAIN_VIDEO_MODEL_VIRTIO,
+ GVIR_CONFIG_DOMAIN_VIDEO_MODEL_BOCHS,
} GVirConfigDomainVideoModel;
GType gvir_config_domain_video_get_type(void);
--
2.23.0
5 years, 1 month
[libvirt] [PATCH 1/1] conf: handle empty string in interface target name
by Nikolay Shirokovskiy
Empty name is not allowed by schema but qemu is able to start with such
a config (and I guess some other hypervisors too). As a result name will
be generated by kernel and have form 'tap<N>'. At the same time if
target element is ommited in config the name will be generated by
libvirt and have form 'vnet<N>'. Let's have only the latter pattern
for autogenerated names by treating empty name as ommited.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
There is a RFS for the issue - https://www.redhat.com/archives/libvir-list/2019-September/msg00645.html
src/conf/domain_conf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 76aaa63f57..7ff3972cbb 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11592,6 +11592,8 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
} else if (!ifname &&
virXMLNodeNameEqual(cur, "target")) {
ifname = virXMLPropString(cur, "dev");
+ if (ifname[0] == '\0')
+ VIR_FREE(ifname);
managed_tap = virXMLPropString(cur, "managed");
} else if ((!ifname_guest || !ifname_guest_actual) &&
virXMLNodeNameEqual(cur, "guest")) {
--
2.23.0
5 years, 1 month
[libvirt] [PATCH v3 00/11] remove repetition of URI path validation
by Daniel Henrique Barboza
This is a code repetition that I crossed a few times, then
I noticed that Cole Robinson suggested a solution for it
in the wiki. Here it is.
changes from v2:
- use a boolean to determine 'QEMU' and 'vbox' case to avoid block
repetition (patch 8)
- avoid 80+ chars lines in all patches
changes from v1:
- handle QEMU and vbox cases separately inside the validation
function
v2: https://www.redhat.com/archives/libvir-list/2019-September/msg01007.html
v1: https://www.redhat.com/archives/libvir-list/2019-September/msg00983.html
Daniel Henrique Barboza (11):
src/driver.c: add virConnectValidateURIPath()
interface_backend_netcf.c: use virConnectValidateURIPath()
interface_backend_udev.c: use virConnectValidateURIPath()
bridge_driver.c: virConnectValidateURIPath()
node_device_driver.c: use virConnectValidateURIPath()
secret_driver.c: use virConnectValidateURIPath()
storage_driver.c: use virConnectValidateURIPath()
driver.c: change URI validation to handle QEMU and vbox case
qemu_driver.c: use virConnectValidateURIPath()
vbox_common.c: use virConnectValidateURIPath()
vbox_driver.c: use virConnectValidateURIPath()
src/driver.c | 38 +++++++++++++++++++++++++
src/driver.h | 4 +++
src/interface/interface_backend_netcf.c | 19 +++----------
src/interface/interface_backend_udev.c | 19 +++----------
src/libvirt_private.syms | 1 +
src/network/bridge_driver.c | 19 +++----------
src/node_device/node_device_driver.c | 19 +++----------
src/qemu/qemu_driver.c | 20 +++----------
src/secret/secret_driver.c | 19 +++----------
src/storage/storage_driver.c | 19 +++----------
src/vbox/vbox_common.c | 16 ++---------
src/vbox/vbox_driver.c | 16 ++---------
12 files changed, 75 insertions(+), 134 deletions(-)
--
2.21.0
5 years, 1 month
[libvirt] [libvirt-rust PATCH 0/1] Fix unsoundness in wrapper new constructor
by Linus Färnstrand
There are safety issues with all wrapper type constructors.
All safe wrappers can be created without `unsafe` from raw pointers.
Meaning any subsequent use will cause undefined behavior if the pointer
does not point to a valid object:
```rust
// This will segfault / Cause undefined behavior
virt::connect::Connect::new(ptr::null_mut()).get_hostname()
```
These methods to create safe wrappers from raw pointers must be `unsafe`.
And optimally is if all unsafe methods have a `# Safety` section
explaining what conditions must hold to call them.
Since these methods should not be the main way of instantiating these types,
they should likely not be called `new`, but rather something like `from_ptr`.
Let's see if I manage to make the patch appear under the same email thread this time.
Linus Färnstrand (1):
Make creating safe wrapper from raw pointer unsafe
src/connect.rs | 10 ++++++++--
src/domain.rs | 10 ++++++++--
src/domain_snapshot.rs | 10 ++++++++--
src/interface.rs | 10 ++++++++--
src/network.rs | 10 ++++++++--
src/nodedev.rs | 10 ++++++++--
src/nwfilter.rs | 10 ++++++++--
src/secret.rs | 10 ++++++++--
src/storage_pool.rs | 10 ++++++++--
src/storage_vol.rs | 10 ++++++++--
src/stream.rs | 8 +++++++-
11 files changed, 87 insertions(+), 21 deletions(-)
--
2.21.0
5 years, 1 month
[libvirt] QEMU bitmap backup usability FAQ
by John Snow
Hi, downstream here at Red Hat I've been fielding some questions about
the usability and feature readiness of Bitmaps (and related features) in
QEMU.
Here are some questions I answered internally that I am copying to the
list for two reasons:
(1) To make sure my answers are actually correct, and
(2) To share this pseudo-reference with the community at large.
This is long, and mostly for reference. There's a summary at the bottom
with some todo items and observations about the usability of the feature
as it exists in QEMU.
Before too long, I intend to send a more summarized "roadmap" mail which
details all of the current and remaining work to be done in and around
the bitmaps feature in QEMU.
Questions:
> "What format(s) is/are required for this functionality?"
>From the QEMU API, any format can be used to create and author
incremental backups. The only known format limitations are:
1. Persistent bitmaps cannot be created on any format except qcow2,
although there are hooks to add support to other formats at a later date
if desired.
DANGER CAVEAT #1: Adding bitmaps to QEMU by default creates transient
bitmaps instead of persistent ones.
Possible TODO: Allow users to 'upgrade' transient bitmaps to persistent
ones in case they made a mistake.
2. When using push backups (blockdev-backup, drive-backup), you may use
any format as a target format.
DANGER CAVEAT #2: without backing file and/or filesystem-less sparse
support, these images will be unusable.
EXAMPLE: Backing up to a raw file loses allocation information, so we
can no longer distinguish between zeroes and unallocated regions. The
cluster size is also lost. This file will not be usable without
additional metadata recorded elsewhere.*
(* This is complicated, but it is in theory possible to do a push backup
to e.g. an NBD target with custom server code that saves allocation
information to a metadata file, which would allow you to reconstruct
backups. For instance, recording in a .json file which extents were
written out would allow you to -- with a custom binary -- write this
information on top of a base file to reconstruct a backup.)
3. Any format can be used for either shared storage or live storage
migrations. There are TWO distinct mechanisms for migrating bitmaps:
A) The bitmap is flushed to storage and re-opened on the destination.
This is only supported for qcow2 and shared-storage migrations.
B) The bitmap is live-migrated to the destination. This is supported for
any format and can be used for either shared storage or live storage
migrations.
DANGER CAVEAT #3: The second bitmap migration technique there is an
optional migration capability that must be enabled explicitly.
Otherwise, some migration combinations may drop bitmaps.
Matrix:
> migrate = migrate_capability or (persistent and shared_storage)
Enumerated:
live storage + raw : transient + no-capability: Dropped
live-storage + raw : transient + bm-capability: Migrated
live-storage + qcow2 : transient + no-capability: Dropped
live-storage + qcow2 : transient + bm-capability: Migrated
live-storage + qcow2 : persistent + no-capability: Dropped (!)
live-storage + qcow2 : persistent + bm-capability: Migrated
shared-storage + raw : transient - no-capability: Dropped
shared-storage + raw : transient + bm-capability: Migrated
shared-storage + qcow2 : transient + no-capability: Migrated
shared-storage + qcow2 : transient + bm-capability: Migrated
shared-storage + qcow2 : persistent + no-capability: Migrated
shared-storage + qcow2 : persistent + bm-capability: Migrated
Enabling the bitmap migration capability will ALWAYS migrate the bitmap.
If it's disabled, we will only migrate the bitmaps for shared storage
migrations where the bitmap is persistent, which is a qcow2-only case.
There is no warning or error if you attempt to migrate in a manner that
loses your bitmaps.
(I might be persuaded to add a case for when you are doing a live
storage migration of qcow2 with persistent bitmaps, which is somewhat a
conflicting case: you've asked for the bitmap to be persistent, but it
seems likely that if this ever happens in practice, it's because you
have neglected to ask for it to be migrated to the new host.)
See iotest 169 for more details on this.
At present, these are the only format limitations I am consciously aware
of. From a management API/GUI perspective, it makes sense to restrict
the feature set to "qcow2 only" to minimize edge cases.
> "Is libvirt aware of these 'gotcha' cases?"
>From talks I've had with Eric Blake and Peter Krempa, they certainly are
now.
> "Is it possible to make persistent the default?"
Not quickly.
In QEMU, not without a deprecation period or some other incompatibility.
Default values are not (yet?) introspectable via the schema. We need
(possibly) up to two QAPI extensions:
I) The ability to return deprecation warnings when issuing a command
that will cease to work in the future.
This has been being discussed somewhat on-list recently. It seems like
there is not a big appetite for tackling something perceived as
low-value because it is likely to be ignored.
II) The ability to document default values in the QAPI schema for the
purposes of introspection.
With one or both of these extensions, we could remove the default value
for persistence and promote it to a required argument with a
transitionary period where it will work with a warning. Then, in the
future, users will be forced to specify if they want persistent=true or
persistent=false.
This is not on my personal roadmap to implement.
> "Is it possible to make bitmap migration the default?"
I don't know at present. Migration capabilities are either "on" or "off"
and the existing negotiation mechanisms for capabilities are extremely
rudimentary.
Changing this might require fiddling with machine compat properties,
adding features to the migration protocol, or more. I don't know what I
don't know, so I will estimate this change as likely invasive.
I've discussed this with David Gilbert and it seems like a complicated
project for the benefit of this sub-project alone, so this isn't on my
personal roadmap to resolve.
The general consensus appears to be that protecting the user is
libvirt's job.
> "Where do we stand with external snapshot support?"
Still broken. In the aftermath of 4.1, it's the most obvious outstanding
broken feature. Vladimir has patches to fix it, but they need some
attention.
> "What needs to happen to bitmaps when doing stream or commit?"
Uncertain in QEMU; creating an external snapshot implicitly ends the
timeslice represented by the old bitmap, but an explicit checkpoint is
better.
I think some little ascii charts will help people understand what we're
talking about here, so let's cover some examples.
SCENARIO 1)
Here's a timeline for a single node (one image, no backing files), with
some points in time highlighted:
Time T = 0.........................n
+rec: [--X------Y------Z--------]
-rec: [---------x------y--------]
region: [aabbbbbbbcccccccddddddddd]
X, Y, and Z are points in time where bitmaps 'x', 'y', and 'z' were
created and began recording. x and y are points in time where bitmaps
'x' and 'y' stopped recording.
This creates a few distinct regions / timeslices.
a: Data written before we began tracking writes.
b: Data written to bitmap 'x'
c: Data written to bitmap 'y'
d: data written to bitmap 'z'
region 'a' is of an unknown size and indeterminate length, because there
is no reference point (checkpoint) prior to it.
regions 'b' and 'c' are of finite size and determinate length, because
they have fixed reference points on either sides of their timeslice.
region 'd' is also of an unknown size and indeterminate length, because
it is actively recording and has no checkpoint to its right. It may be
fixed at any time by disabling bitmap 'z'.
In QEMU, generally what we want to do is to do several things at one
atomic moment to keep these regions adjacent, contiguous, and disjoint.
So from a high-level (using a fictional simplified syntax), we do:
Transaction(
create('y'),
disable('x'),
backup('x')
)
which together performs a backup+checkpoint.
We can do a backup without a checkpoint:
4.1:
Transaction(
create('tmp')
merge('tmp', 'x')
backup('tmp')
)
4.2:
> backup('x', bitmap_sync=never)
Or a checkpoint without a backup:
Transaction(
create('y'),
disable('x')
)
SCENARIO 2)
Now, what happens when we make an external snapshot and do nothing at
all to our bitmaps?
Time T = 0.......................................n
+rec: [--X------Y------Z--------] <-- [-------]
-rec: [---------x------y--------] <-- [-------]
region: [aabbbbbbbcccccccddddddddd] <-- [eeeeeee]
{ base } <-- { top }
We've created a new implicit timeslice, "e" without creating a new
bitmap. Because the bitmap 'z' was still active at the time of the
snapshot, it now has a temporarily-determinate endpoint to its region.
This is kind of like an "implied checkpoint", but it's a very poor one
because it's not really addressable.
DANGER CAVEAT #4: We have no way to create incremental backups anymore,
because the current moment in time has no addressable point.
That's not great; but it is likely a fixable scenario when commit is
fixed: committing the top layer back down into the base layer will add
all new writes to the end of the old region; restoring our backup chain:
Time T = 0.........................C.......n
+rec: [--X------Y------Z-------- -------]
-rec: [---------x------y-------- -------]
region: [aabbbbbbbcccccccddddddddd ddddddd]
Here, region 'e' just gets appended to region d, and we can make
incremental backups from any checkpoint X, Y, Z to the current moment again.
SCENARIO 3)
What happens if we make a firm checkpoint at the same time we make the
snapshot?
Transaction(
disable('z'),
snapshot('top'),
create('w')
)
Time T = 0......................... ......n
+rec: [--X------Y------Z-------- ] <-- [W------]
-rec: [---------x------y--------z] <-- [-------]
region: [aabbbbbbbcccccccddddddddd ] <-- [eeeeeee]
{ base } <-- { top }
Now instead of the new region 'e' being implied, it's explicit. We can
make backups between any point and the current moment *across* the gap.
It was my thought that this was the most preferable method that libvirt
should use, but there is some doubt from Peter Krempa. We'll see how it
shakes out.
There are questions about what QEMU should do by default, without
libvirt's help. At the moment, it's "nothing" but there have been
questions about "something".
Keeping in mind that we likely can't change our existing behavior
without some kind of flag, there are still some API/usability questions:
> If we create an external snapshot on top of an image with actively
> recording bitmaps, should we disable them?
We can leave them enabled, but they'll never see any writes. Or we can
explicitly disable them. Explicitly disabling them may make more sense
to prevent modifying bitmaps accidentally on commit.
My guess: No. we should leave them alone; allow checkpoint creation
mechanisms to do the disable+create dance for bitmaps as needed.
Potential problems: The backing image is read-only, and if we change our
mind later, we will need to find a way to re-open the backing image as
read-write for the purposes of toggling the recording bit prior to any
legitimate guest usage of that node. Then, re-open as RO again.
> Should we fork bitmaps (on snapshot)?
If a bitmap named 'z' is recording when we create an external snapshot,
should that bitmap be *copied* into the top layer?
My guess: No.
This would allow us to create external snapshots *without* creating a
checkpoint, but conceptually that's a nightmare: It would allow for
mutually independent creation of snapshots OR checkpoints. This would be
hard to corral when undoing a snapshot, for instance.
In my opinion, snapshots MUST be checkpoints, and therefore allowing a
snapshot without creating a checkpoint is a no-go.
> (Should we fork bitmaps) if we're not using checkpoints?
If we are using a checkpoint-less paradigm (i.e. the rolling incremental
backup using only one bitmap) we might want to copy the bitmap up to
make the next incremental backup as if nothing ever happened.
However, rolling incremental backups doesn't need any kind of auto-copy
feature. This is possible today:
> create('base', 'A')
> transact(snapshot('top'), create('top', 'B'))
> merge('B', [('base', 'A'), ('top', 'B')])
i.e., we create a new bitmap on the top layer, then merge in the old
data from the backing file, which remains addressable.
Whether the user wants to copy up or not, there are commands that will
do that already.
> Should we create new bitmaps by default when we can?
If a backing image has bitmaps, should QEMU automatically create a new
bitmap for the top layer? Should it be named something new, something
user-provided, or based on existing active bitmaps?
If a user creates a new external snapshot with no consideration paid to
bitmaps (like "SCENARIO 2" above), they temporarily lose the ability to
do incremental backups. They might be able to commit the image back to
"try again."
That's not great. Here are some options for resolving this:
- Automatic names: Might cause collisions out-of-band with management
tooling by accident, tooling has to query to discover what bitmaps were
automatically created.
- Same names: Can create namespace confusion when committing snapshots
later; although each layer of a backing chain can have bitmaps named the
same thing, it causes future problems when committing together that can
be hard to resolve.
- User-provided name: This is workable, and requires an amendment to the
snapshot command to automatically create a new bitmap on the snapshot.
My guess: No, we can't automatically create a new bitmap for the user.
We can amend the snapshot commands to accept bitmap names, but at that
point we've just duplicated transactions:
Transact(
snapshot('top'),
create('top', 'new-bitmap')
)
All that said (Mostly a lot "No, let's not do anything"), maybe there's
room for an "assistive" mode for users, a bitmap-aware snapshot creation
command. It could do the following well-defined magic:
bitmap-snapshot(base, top, bitmap_name):
1. disable any active bitmaps in the base node.
2. create a bitmap named "bitmap_name" in the top node, failing if
a bitmap by that name already exists on either node.
What this accomplishes:
- Disables any bitmaps in the base layer ahead of time, in preparation
for an eventual commit operation.
- Always creates a new, enabled bitmap on the snapshot mode which is
guaranteed not to conflict with a name on the base node. This bitmap can
be used to create additional copies post-hoc, if desired.
- Formalizes our "best practice" suggestion for mixing bitmaps and
snapshots into a single, documented command.
Is this strictly needed? No, if you have the foresight, you can do this
instead:
Transact(
disable('a'),
disable('b'),
disable('c'),
# plus however many more ...
snapshot('top', ...),
create('top', 'd')
)
but a convenience command might still have a role to play in helping
take the guesswork out for non-libvirt users.
That's the bulk of what was discussed.
Summary:
GOTCHAs:
#1: Bitmaps are created non-persistent by default, and can't be changed.
#2: Push backup destination formats will happily back up to a format
that isn't semantically useful.
#3: Migrating non-shared block storage can drop even persistent bitmaps
if you don't pass the bitmap migration capability flag to both QEMU
instances.
#4: Creating a snapshot without doing some bitmap manipulation
beforehand can temporarily render your bitmaps unusable. Failing to
disable bitmaps before creating a snapshot might make commits very
tricky later on.
Gotchas 1 and 4 can be at least partially alleviated. gotcha 2 remains a
pain point we cannot intercept at the QEMU layer. gotcha 3 has potential
remedies, but they are complicated.
QEMU todo items:
- Fix bitmap data corruption on commit (Ongoing, by Vladimir@Virtuozzo)
- add a set_persistence method for bitmaps that allows us to change the
storage class of a bitmap after creation. (Helps alleviate gotcha #1.)
- Add a command that allows us to merge allocation data into a bitmap.
This helps alleviate gotcha #4: If we create a new image but neglected
to do the proper transaction dance, we can simply copy the allocation
data into a new bitmap. (Note, we'd still need set_persistence to help
us disable the old bitmap before any commit happens.)
- Add convenience command for easy + safe combination of bitmaps +
snapshots. Helps prevent #4.
Research items:
- How hard is it to reopen a backing image as RW while it's in-use,
disable a bitmap, and then reopen as RO? This is to partially address
gotcha #4; if we forget to disable bitmaps before creating the snapshot.
- How hard is the reverse operation? Can we reopen a backing image RW,
enable a bitmap, and then reopen as RO? This gives us better control
over what happens on commit.
- After we fix the commit bug, what does/should commit actually do with
bitmaps? What about bitmaps that collide? The current behavior is that
any bitmaps don't transfer from top to base. Any bitmaps active in the
base record all the new writes from the top.
That's all!
--js
5 years, 1 month
[libvirt] [jenkins-ci PATCH] jenkins: Don't try to build libosinfo on Debian sid
by Andrea Bolognani
We support the platform as a target for lcitool-driven builds, but
we don't have a corresponding worker in the CentOS CI environment.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Pushed as a fix to the CI environment.
jenkins/projects/libosinfo.yaml | 1 -
1 file changed, 1 deletion(-)
diff --git a/jenkins/projects/libosinfo.yaml b/jenkins/projects/libosinfo.yaml
index c744b38..b38524e 100644
--- a/jenkins/projects/libosinfo.yaml
+++ b/jenkins/projects/libosinfo.yaml
@@ -5,7 +5,6 @@
# CentOS 7, Debian 9, Ubuntu 18;
machines:
- libvirt-debian-10
- - libvirt-debian-sid
- libvirt-fedora-29
- libvirt-fedora-30
- libvirt-fedora-rawhide
--
2.21.0
5 years, 1 month
[libvirt] [PATCH] domain_conf: Fix str2enum translation of video driver name
by Michal Privoznik
In bc1e924cf0d we've introduced video driver name and whilst
doing so we've utilized VIR_ENUM_IMPL() macro. Then, in domain
XML parsing code the generated
virDomainVideoBackendTypeFromString() is called and its return
value is assigned directly to an unsigned int variable which is
wrong. Also, the video driver enum has 'default' value which is
not formatted into domain XML but is accepted during parsing.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under trivial & build breaker rules.
src/conf/domain_conf.c | 4 +++-
src/conf/domain_conf.h | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6dea670257..67555c9be3 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -15504,11 +15504,13 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xmlopt,
}
if (driver_name) {
- if ((def->backend = virDomainVideoBackendTypeFromString(driver_name)) < 0) {
+ int backend;
+ if ((backend = virDomainVideoBackendTypeFromString(driver_name)) <= 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unknown video driver '%s'"), driver_name);
goto error;
}
+ def->backend = backend;
} else {
def->backend = VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT;
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index cff33f6682..53bdee22fb 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1378,7 +1378,7 @@ struct _virDomainWatchdogDef {
/* the backend driver used for virtio interfaces */
typedef enum {
- VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT,
+ VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT = 0,
VIR_DOMAIN_VIDEO_BACKEND_TYPE_QEMU,
VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER,
--
2.21.0
5 years, 1 month
[libvirt] [PATCH] qemu_blockjob: Remove secdriver metadata for whole backing chain on job completion
by Michal Privoznik
Turns out, block mirror is not the only job a disk can have. It
can also do commits of one layer into the other. Or possibly some
other tricks too. Problem is that while we set seclabels on given
layers of backing chain when the job is starting (via
qemuDomainStorageSourceAccessAllow()) we don't restore them when
job finishes. This leaves XATTRs set and corresponding images
unusable.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Not sure if we want to remove XATTRs for the top layer too or just the
rest of the backing chain (n=disk->src vs. n=disk->src->backingStore).
Peter?
src/qemu/qemu_blockjob.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index a991309ee7..6408f95e4e 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -658,9 +658,9 @@ qemuBlockJobEventProcessLegacyCompleted(virQEMUDriverPtr driver,
virObjectUnref(disk->src);
disk->src = disk->mirror;
} else {
+ virStorageSourcePtr n;
+
if (disk->mirror) {
- virStorageSourcePtr n;
-
virDomainLockImageDetach(driver->lockManager, vm, disk->mirror);
/* Ideally, we would restore seclabels on the backing chain here
@@ -678,6 +678,16 @@ qemuBlockJobEventProcessLegacyCompleted(virQEMUDriverPtr driver,
virObjectUnref(disk->mirror);
}
+
+ for (n = disk->src; virStorageSourceIsBacking(n); n = n->backingStore) {
+ if (qemuSecurityMoveImageMetadata(driver, vm, n, NULL) < 0) {
+ VIR_WARN("Unable to remove disk metadata on "
+ "vm %s from %s (disk target %s)",
+ vm->def->name,
+ NULLSTR(n->path),
+ disk->dst);
+ }
+ }
}
/* Recompute the cached backing chain to match our
--
2.21.0
5 years, 1 month