[libvirt] [PATCH glib] Remove dep on libvirt 1.2.6
by Daniel P. Berrange
Going back on what I said a few hours ago....
On closer inspection, I re-discovered that we have already taken
the approach of conditionally compiling code in libvirt-gobject
to avoid increasing the min libvirt. So given this, I would like
to avoid increasing the min required libvirt in the release we're
about to do today for benefit of GNOME boxes.
I think we can still have a valid discussion about increasing
the min libvirt after this release is done, since I think that
0.10.2 is really far too old. It is based on RHEL-6 vintage
libvirt and that's not really useful due to lack of gobject
introspection.
So to clarify, I think we should set a clear policy on what
platforms we're going to target going forward. This will let
us make an easy & clear decision about when a patch needs to
use the conditional compilation approach.
Daniel P. Berrange (1):
Make use of DHCP API conditionally compiled
configure.ac | 6 ++-
.../libvirt-gobject-network-dhcp-lease.c | 50 ++++++++++++++++++++++
libvirt-gobject/libvirt-gobject-network.c | 12 ++++++
3 files changed, 67 insertions(+), 1 deletion(-)
--
2.4.3
9 years, 4 months
[libvirt] [RFC] domain xml validation for source elements
by Boris Fiuczynski
I ran into a problem that was caused by a missing leading slash (/) in
the value of the file attribute of a disks source element.
Defining the domain worked without a problem.
Editing the domain and trying to save it resulted in a very generic
error message:
error: XML document failed to validate against schema: Unable to
validate doc against /usr/share/libvirt/schemas/domain.rng
Extra element devices in interleave
Element domain failed to validate content
Failed. Try again? [y,n,i,f,?]:
It took me some time to find out that the schema defines in absFilePath
a leading slash as required for a fully qualified file path but the C
code parsing does not require/validate it.
<define name="diskSourceFile">
...
<interleave>
<optional>
<element name="source">
<optional>
<attribute name="file">
<ref name="absFilePath"/>
</attribute>
</optional>
...
</element>
</optional>
</interleave>
</define>
<define name="absFilePath">
<data type="string">
<param
name="pattern">/[a-zA-Z0-9_\.\+\-\\&"'<>/%,:]+</param>
</data>
</define>
I tried to fix the behavior by implementing additional validation code
in method virDomainDiskSourceParse checking for the leading slash on the
absolute file path.
This resulted in breaking the VMware tests (xml2vmxtest), e.g.
8) VMware XML-2-VMX cdrom-scsi-file -> cdrom-scsi-file
When looking at the related test data I found:
<disk type='file' device='cdrom'>
<source file='[testing] isos/cdrom.iso'/>
<target dev='sda' bus='scsi'/>
</disk>
Besides the fact that the file path string also contains the characters
space, opening and closing square brackets which are not specified as
valid characters the file path string does not have a leading slash but
instead some kind of 'datastore' specific name.
What is the way to approach this since I am not a VMware user?
1) Change the schema to include the missing characters and removing the
requirement for the leading slash and include additional schema aligned
validation in the parsing code (method virDomainDiskSourceParse) or
2) fix the VMware tests to use absolute paths only and include
additional schema aligned validation in the parsing code (method
virDomainDiskSourceParse).
--
Mit freundlichen Grüßen/Kind regards
Boris Fiuczynski
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martina Köderitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
9 years, 4 months
[libvirt] Continuation of Admin APIs
by Martin Kletzander
So now that we have the Admin API backend merged in, the code is
prepared to have new APIs added in. There are many things to be
added, but we should start out slowly with the most desired ones.
I'll try to outline what I have in my mind so the discussion can
sprout into existence.
As Erik (Cc'd) expressed his interest in this, I'm just summarizing my
ideas here, feel free to trash them if you feel like your idea is
better.
Apart from adding new APIs, we also need to split virsh to create
virt-admin. I've hit a few bumps on that and Erik started looking at
that either, but that's outside of the scope of this email.
* What to start with
** Changing debugging settings
This is something that makes sense and should be easy to do. I
imagine something along the lines of virAdmSetDebug() being able to
setup log_level, log_filters, log_outputs (and maybe log_buffer_size).
The question is whether we want these to be three (or four) parameters
(since that number in unlikely to change) or typed parameters. Even
though I like the extensibility of typed parameters, I'd probably vote
for the former. Mainly because this might become syntactic sugar to
some heavier API (see below). There might be flags for persisting
such settings, but that's highly debatable and might be also done
later on.
The only situation in which we might not want this API is if there is
another one that is able to stream debug logs using virStream. There
must be some "double-buffering" done for this since we would ran into
bunch of problems.
** Reporting connection/client information
This is a harder one to design since there is not primary key
associated with each client. We'll need to come up with some, maybe
combined one (based on more information, e.g. socket info, connection
time). And if there's nothing better, then I guess associating a ID
with each new connection (be it uint64 or UUID) will have to do.
Then we have to come up with how to represent the client data so it's
scalable. We might need to resort to something else than a structure,
for binary extensibility.
** Forcibly disconnecting a client
I haven't checked this thoroughly, but I can certainly see the problem
where setting client->wantClose = true might just not be enough. If
all non-workers are occupied with blocking API, disconnecting clients
won't help with making the server accessible again. And that leads me
to another one.
** Changing worker pool parameters
In case the (maximum) number of workers needs to be changed, it should
be possible by this API. However, there's yet again a question
whether this is needed if we'll have a bigger gun for all daemon
settings. That's described in the next section.
* Future ideas (for consideration)
** Changing any settings for the libvirt daemon.
I had an idea that we should have a "universal" API for changing any
settings that comes from config files. The API that would implement
this would have a string parameter (or list of strings) that would say
what setting(s) to change, similarly to augtool. So let's say instead
of:
$ augtool -s set /files/etc/libvirt/libvirtd.conf/max_workers 10
one would call:
virAdmSetConfig("libvirtd.conf/max_workers", "10", ...);
Good thing about this is that it is highly scalable (even to
qemu.conf). Bad thing is that we need to be able to say whether there
is a setting that we don't yet support (return error_unsupported) and
also we'd need to rework the configuration module to be able to do
such thing and have a function to call for each change.
Having this would render changing max_workers, log_level etc. obsolete
(although I feel like changing debug parameters still deserves its own
API function).
** Reloading the server's TLS certificates?
This was requested by Lee (Cc'd) in a reply to one of the PoC series.
It is something that I feel like we really want as well, but I haven't
yet put much thought into it.
That's all from me now. I won't have much access to my mail in couple
of following days, so I'll be slower to respond, even slower than my
usual slow.
Have a nice day,
Martin
9 years, 4 months
[libvirt] [PATCH] qemu: fix the error cover issue in SetMemoryParameters
by Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1245476
We won't return the errno after commit 0d7f45ae, and
the more clearly error will be set in the code in vircgroup*.
Also We will always report error "Operation not permitted",
because the return is -1.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/qemu/qemu_driver.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9dbe635..3130fe3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9809,12 +9809,8 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
#define QEMU_SET_MEM_PARAMETER(FUNC, VALUE) \
if (set_ ## VALUE) { \
if (flags & VIR_DOMAIN_AFFECT_LIVE) { \
- if ((rc = FUNC(priv->cgroup, VALUE)) < 0) { \
- virReportSystemError(-rc, _("unable to set memory %s tunable"), \
- #VALUE); \
- \
- goto endjob; \
- } \
+ if ((rc = FUNC(priv->cgroup, VALUE)) < 0) \
+ goto endjob; \
vm->def->mem.VALUE = VALUE; \
} \
\
--
1.8.3.1
9 years, 4 months
[libvirt] [PATCH v2 00/10] nodeinfo: Various cleanups
by Andrea Bolognani
This should take care of Peter's remarks, except the ones
that I've addressed separately.
Andrea Bolognani (10):
nodeinfo: Introduce linuxGetCPUGlobalPath()
nodeinfo: Introduce linuxGetCPUOnlinePath()
nodeinfo: Rename linuxParseCPUmax() to linuxParseCPUCount()
nodeinfo: Add old kernel compatibility to nodeGetPresentCPUBitmap()
nodeinfo: Remove out parameter from nodeGetCPUBitmap()
nodeinfo: Rename nodeGetCPUBitmap() to nodeGetOnlineCPUBitmap()
nodeinfo: Phase out cpu_set_t usage
nodeinfo: Use nodeGetOnlineCPUBitmap() when parsing node
nodeinfo: Use a bitmap to keep track of node CPUs
nodeinfo: Calculate present and online CPUs only once
src/libvirt_private.syms | 2 +-
src/nodeinfo.c | 214 +++++++++++++++++++++++++++++------------------
src/nodeinfo.h | 2 +-
3 files changed, 136 insertions(+), 82 deletions(-)
--
2.4.3
9 years, 4 months
[libvirt] [PATCH v4] qemu: Use heads parameter for QXL driver
by Frediano Ziglio
Allows to specify maximum number of head to QXL driver.
Actually can be a compatiblity problem as heads in the XML configuration
was set by default to '1'.
Signed-off-by: Frediano Ziglio <fziglio(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 5 ++++
.../qemuxml2argv-video-qxl-device-max-outputs.args | 7 ++++++
.../qemuxml2argv-video-qxl-device-max-outputs.xml | 29 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 3 +++
6 files changed, 47 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.xml
Changes from v4:
- rebased on new master;
- add test case to qemuxml2argvtest.
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index d8cb32d..0769316 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -288,6 +288,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"vhost-user-multiqueue", /* 190 */
"migration-event",
+ "qxl-vga.max_outputs",
);
@@ -1651,6 +1652,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxl[] = {
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxlVga[] = {
{ "vgamem_mb", QEMU_CAPS_QXL_VGA_VGAMEM },
+ { "max_outputs", QEMU_CAPS_QXL_VGA_MAX_OUTPUTS },
};
struct virQEMUCapsObjectTypeProps {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index f77bd06..88116af 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -231,6 +231,7 @@ typedef enum {
QEMU_CAPS_CPU_AARCH64_OFF = 189, /* -cpu ...,aarch64=off */
QEMU_CAPS_VHOSTUSER_MULTIQUEUE = 190, /* vhost-user with -netdev queues= */
QEMU_CAPS_MIGRATION_EVENT = 191, /* MIGRATION event */
+ QEMU_CAPS_QXL_VGA_MAX_OUTPUTS = 192, /* qxl-vga.max_outputs */
QEMU_CAPS_LAST, /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 42906a8..34a0574 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5684,6 +5684,11 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def,
/* QEMU accepts mebibytes for vgamem_mb. */
virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vgamem / 1024);
}
+
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_MAX_OUTPUTS) &&
+ video->heads > 0) {
+ virBufferAsprintf(&buf, ",max_outputs=%u", video->heads);
+ }
} else if (video->vram &&
((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) ||
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.args
new file mode 100644
index 0000000..bb477a9
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.args
@@ -0,0 +1,7 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \
+-hda /var/lib/libvirt/images/QEMUGuest1 \
+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16\
+,max_outputs=3,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0\
+,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.xml
new file mode 100644
index 0000000..9426efc
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.xml
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>1048576</memory>
+ <currentMemory unit='KiB'>1048576</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='qcow2' cache='none'/>
+ <source file='/var/lib/libvirt/images/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'/>
+ <video>
+ <model type='qxl' heads='3'/>
+ </video>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index f9b30d9..4cd6892 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1441,6 +1441,9 @@ mymain(void)
DO_TEST("video-qxl-device-vgamem", QEMU_CAPS_DEVICE,
QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
QEMU_CAPS_QXL_VGA_VGAMEM);
+ DO_TEST("video-qxl-device-max-outputs", QEMU_CAPS_DEVICE,
+ QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
+ QEMU_CAPS_QXL_VGA_VGAMEM, QEMU_CAPS_QXL_VGA_MAX_OUTPUTS);
DO_TEST_FAILURE("video-qxl-sec-nodevice", QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL);
DO_TEST("video-qxl-sec-device", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_QXL_VGA,
QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
--
2.1.0
9 years, 4 months
[libvirt] [PATCH] Revert "qemu: Use heads parameter for QXL driver"
by Martin Kletzander
This reverts commit 7b401c3bdacdf8367a0070e625d73eafb802045d.
Until libvirt is able to differentiate whether heads='1' is just a
leftover from previous libvirt or whether that's added by user on
purpose and also whether the domain was started with the support for
qxl's max_outputs, we cannot incorporate this patch into the tree
due to compatibility reasons.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
The discussion about this can be found in this thread:
https://www.redhat.com/archives/libvir-list/2015-July/msg00808.html
src/qemu/qemu_capabilities.c | 2 --
src/qemu/qemu_capabilities.h | 1 -
src/qemu/qemu_command.c | 5 ----
.../qemuxml2argv-video-qxl-device-max-outputs.args | 7 ------
.../qemuxml2argv-video-qxl-device-max-outputs.xml | 29 ----------------------
tests/qemuxml2argvtest.c | 3 ---
6 files changed, 47 deletions(-)
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.args
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.xml
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 0769316fe999..d8cb32d77761 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -288,7 +288,6 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"vhost-user-multiqueue", /* 190 */
"migration-event",
- "qxl-vga.max_outputs",
);
@@ -1652,7 +1651,6 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxl[] = {
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxlVga[] = {
{ "vgamem_mb", QEMU_CAPS_QXL_VGA_VGAMEM },
- { "max_outputs", QEMU_CAPS_QXL_VGA_MAX_OUTPUTS },
};
struct virQEMUCapsObjectTypeProps {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 88116afc4dab..f77bd06ec38d 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -231,7 +231,6 @@ typedef enum {
QEMU_CAPS_CPU_AARCH64_OFF = 189, /* -cpu ...,aarch64=off */
QEMU_CAPS_VHOSTUSER_MULTIQUEUE = 190, /* vhost-user with -netdev queues= */
QEMU_CAPS_MIGRATION_EVENT = 191, /* MIGRATION event */
- QEMU_CAPS_QXL_VGA_MAX_OUTPUTS = 192, /* qxl-vga.max_outputs */
QEMU_CAPS_LAST, /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 34a0574be294..42906a898b36 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5684,11 +5684,6 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def,
/* QEMU accepts mebibytes for vgamem_mb. */
virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vgamem / 1024);
}
-
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_MAX_OUTPUTS) &&
- video->heads > 0) {
- virBufferAsprintf(&buf, ",max_outputs=%u", video->heads);
- }
} else if (video->vram &&
((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) ||
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.args
deleted file mode 100644
index bb477a9b4a5f..000000000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.args
+++ /dev/null
@@ -1,7 +0,0 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \
--monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \
--hda /var/lib/libvirt/images/QEMUGuest1 \
--device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16\
-,max_outputs=3,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0\
-,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.xml
deleted file mode 100644
index 9426efc917d4..000000000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<domain type='qemu'>
- <name>QEMUGuest1</name>
- <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
- <memory unit='KiB'>1048576</memory>
- <currentMemory unit='KiB'>1048576</currentMemory>
- <vcpu>1</vcpu>
- <os>
- <type arch='i686' machine='pc'>hvm</type>
- <boot dev='hd'/>
- </os>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
- <devices>
- <emulator>/usr/bin/qemu</emulator>
- <disk type='file' device='disk'>
- <driver name='qemu' type='qcow2' cache='none'/>
- <source file='/var/lib/libvirt/images/QEMUGuest1'/>
- <target dev='hda' bus='ide'/>
- <address type='drive' controller='0' bus='0' target='0' unit='0'/>
- </disk>
- <controller type='ide' index='0'/>
- <video>
- <model type='qxl' heads='3'/>
- </video>
- <memballoon model='virtio'/>
- </devices>
-</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 4cd6892fe0de..f9b30d978171 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1441,9 +1441,6 @@ mymain(void)
DO_TEST("video-qxl-device-vgamem", QEMU_CAPS_DEVICE,
QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
QEMU_CAPS_QXL_VGA_VGAMEM);
- DO_TEST("video-qxl-device-max-outputs", QEMU_CAPS_DEVICE,
- QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
- QEMU_CAPS_QXL_VGA_VGAMEM, QEMU_CAPS_QXL_VGA_MAX_OUTPUTS);
DO_TEST_FAILURE("video-qxl-sec-nodevice", QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL);
DO_TEST("video-qxl-sec-device", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_QXL_VGA,
QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
--
2.4.6
9 years, 4 months
[libvirt] [PATCH] cgroup: Drop resource partition from virSystemdMakeScopeName
by Peter Krempa
The scope name, even according to our docs is
"machine-$DRIVER\x2d$VMNAME.scope" virSystemdMakeScopeName would use the
resource partition name instead of "machine-" if it was specified thus
creating invalid scope paths.
This makes libvirt drop cgroups for a VM that uses custom resource
partition upon reconnecting since the detected scope name would not
match the expected name generated by virSystemdMakeScopeName.
The error is exposed by the following log entry:
debug : virCgroupValidateMachineGroup:302 : Name 'machine-qemu\x2dtestvm.scope' for controller 'cpu' does not match 'testvm', 'testvm.libvirt-qemu' or 'machine-test-qemu\x2dtestvm.scope'
for a "/machine/test" resource and "testvm" vm.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1238570
---
src/lxc/lxc_process.c | 6 ------
src/qemu/qemu_cgroup.c | 3 ---
src/util/vircgroup.c | 11 ++---------
src/util/vircgroup.h | 1 -
src/util/virsystemd.c | 9 ++-------
src/util/virsystemd.h | 3 +--
tests/virsystemdtest.c | 20 +++++++-------------
7 files changed, 12 insertions(+), 41 deletions(-)
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 2bdce3b..87ee484 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -1319,9 +1319,6 @@ int virLXCProcessStart(virConnectPtr conn,
* more reliable way to kill everything off if something
* goes wrong from here onwards ... */
if (virCgroupNewDetectMachine(vm->def->name, "lxc", vm->pid,
- vm->def->resource ?
- vm->def->resource->partition :
- NULL,
-1, &priv->cgroup) < 0)
goto cleanup;
@@ -1505,9 +1502,6 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm,
goto error;
if (virCgroupNewDetectMachine(vm->def->name, "lxc", vm->pid,
- vm->def->resource ?
- vm->def->resource->partition :
- NULL,
-1, &priv->cgroup) < 0)
goto error;
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 8ed74ee..ab21e12 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -855,9 +855,6 @@ qemuConnectCgroup(virQEMUDriverPtr driver,
if (virCgroupNewDetectMachine(vm->def->name,
"qemu",
vm->pid,
- vm->def->resource ?
- vm->def->resource->partition :
- NULL,
cfg->cgroupControllers,
&priv->cgroup) < 0)
goto cleanup;
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 0ef2d29..0599ba5 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -243,7 +243,6 @@ static bool
virCgroupValidateMachineGroup(virCgroupPtr group,
const char *name,
const char *drivername,
- const char *partition,
bool stripEmulatorSuffix)
{
size_t i;
@@ -258,10 +257,7 @@ virCgroupValidateMachineGroup(virCgroupPtr group,
if (virCgroupPartitionEscape(&partname) < 0)
goto cleanup;
- if (!partition)
- partition = "/machine";
-
- if (!(scopename = virSystemdMakeScopeName(name, drivername, partition)))
+ if (!(scopename = virSystemdMakeScopeName(name, drivername)))
goto cleanup;
if (virCgroupPartitionEscape(&scopename) < 0)
@@ -1498,7 +1494,6 @@ int
virCgroupNewDetectMachine(const char *name,
const char *drivername,
pid_t pid,
- const char *partition,
int controllers,
virCgroupPtr *group)
{
@@ -1508,8 +1503,7 @@ virCgroupNewDetectMachine(const char *name,
return -1;
}
- if (!virCgroupValidateMachineGroup(*group, name, drivername, partition,
- true)) {
+ if (!virCgroupValidateMachineGroup(*group, name, drivername, true)) {
VIR_DEBUG("Failed to validate machine name for '%s' driver '%s'",
name, drivername);
virCgroupFree(group);
@@ -4047,7 +4041,6 @@ int
virCgroupNewDetectMachine(const char *name ATTRIBUTE_UNUSED,
const char *drivername ATTRIBUTE_UNUSED,
pid_t pid ATTRIBUTE_UNUSED,
- const char *partition ATTRIBUTE_UNUSED,
int controllers ATTRIBUTE_UNUSED,
virCgroupPtr *group ATTRIBUTE_UNUSED)
{
diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
index e75c522..675a185 100644
--- a/src/util/vircgroup.h
+++ b/src/util/vircgroup.h
@@ -92,7 +92,6 @@ int virCgroupNewDetect(pid_t pid,
int virCgroupNewDetectMachine(const char *name,
const char *drivername,
pid_t pid,
- const char *partition,
int controllers,
virCgroupPtr *group);
diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
index 8cedf8d..54c409d 100644
--- a/src/util/virsystemd.c
+++ b/src/util/virsystemd.c
@@ -80,16 +80,11 @@ static void virSystemdEscapeName(virBufferPtr buf,
char *virSystemdMakeScopeName(const char *name,
- const char *drivername,
- const char *partition)
+ const char *drivername)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
- if (*partition == '/')
- partition++;
-
- virSystemdEscapeName(&buf, partition);
- virBufferAddChar(&buf, '-');
+ virBufferAddLit(&buf, "machine-");
virSystemdEscapeName(&buf, drivername);
virBufferAddLit(&buf, "\\x2d");
virSystemdEscapeName(&buf, name);
diff --git a/src/util/virsystemd.h b/src/util/virsystemd.h
index 7a29dba..8af2169 100644
--- a/src/util/virsystemd.h
+++ b/src/util/virsystemd.h
@@ -25,8 +25,7 @@
# include "internal.h"
char *virSystemdMakeScopeName(const char *name,
- const char *drivername,
- const char *slicename);
+ const char *drivername);
char *virSystemdMakeSliceName(const char *partition);
char *virSystemdMakeMachineName(const char *name,
diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c
index 261c4cc..d0b9335 100644
--- a/tests/virsystemdtest.c
+++ b/tests/virsystemdtest.c
@@ -340,7 +340,6 @@ static int testCreateNetwork(const void *opaque ATTRIBUTE_UNUSED)
struct testScopeData {
const char *name;
- const char *partition;
const char *expected;
};
@@ -351,9 +350,7 @@ testScopeName(const void *opaque)
int ret = -1;
char *actual = NULL;
- if (!(actual = virSystemdMakeScopeName(data->name,
- "lxc",
- data->partition)))
+ if (!(actual = virSystemdMakeScopeName(data->name, "lxc")))
goto cleanup;
if (STRNEQ(actual, data->expected)) {
@@ -472,22 +469,19 @@ mymain(void)
if (virtTestRun("Test create with network ", testCreateNetwork, NULL) < 0)
ret = -1;
-# define TEST_SCOPE(name, partition, unitname) \
+# define TEST_SCOPE(name, unitname) \
do { \
struct testScopeData data = { \
- name, partition, unitname \
+ name, unitname \
}; \
if (virtTestRun("Test scopename", testScopeName, &data) < 0) \
ret = -1; \
} while (0)
- TEST_SCOPE("demo", "/machine", "machine-lxc\\x2ddemo.scope");
- TEST_SCOPE("demo-name", "/machine", "machine-lxc\\x2ddemo\\x2dname.scope");
- TEST_SCOPE("demo!name", "/machine", "machine-lxc\\x2ddemo\\x21name.scope");
- TEST_SCOPE(".demo", "/machine", "machine-lxc\\x2d\\x2edemo.scope");
- TEST_SCOPE("demo", "/machine/eng-dept", "machine-eng\\x2ddept-lxc\\x2ddemo.scope");
- TEST_SCOPE("demo", "/machine/eng-dept/testing!stuff",
- "machine-eng\\x2ddept-testing\\x21stuff-lxc\\x2ddemo.scope");
+ TEST_SCOPE("demo", "machine-lxc\\x2ddemo.scope");
+ TEST_SCOPE("demo-name", "machine-lxc\\x2ddemo\\x2dname.scope");
+ TEST_SCOPE("demo!name", "machine-lxc\\x2ddemo\\x21name.scope");
+ TEST_SCOPE(".demo", "machine-lxc\\x2d\\x2edemo.scope");
# define TESTS_PM_SUPPORT_HELPER(name, function) \
do { \
--
2.4.5
9 years, 4 months
[libvirt] [PATCH] configure: clarify rationale for checking pkcheck
by Daniel P. Berrange
We don't need pkcheck binary, but we must detect it in order
to see if we're preferring polkit-1 over polkit-0 when both
are installed. We should also check $with_dbus to see if we
have dbus-devel available, as that's required to talk to
polkit-1.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
configure.ac | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 70b3ef3..db0ccd1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1339,15 +1339,28 @@ AC_ARG_WITH([polkit],
with_polkit0=no
with_polkit1=no
if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then
- dnl Check for new polkit first - just a binary
+ dnl Check for new polkit first. We directly talk over DBus
+ dnl but we use existance of pkcheck binary as a sign that
+ dnl we should prefer polkit-1 over polkit-0, so we check
+ dnl for it even though we don't ultimately use it
AC_PATH_PROG([PKCHECK_PATH],[pkcheck], [], [/usr/sbin:$PATH])
if test "x$PKCHECK_PATH" != "x" ; then
- AC_DEFINE_UNQUOTED([WITH_POLKIT], 1,
- [use PolicyKit for UNIX socket access checks])
- AC_DEFINE_UNQUOTED([WITH_POLKIT1], 1,
- [use PolicyKit for UNIX socket access checks])
- with_polkit="yes"
- with_polkit1="yes"
+ dnl Found pkcheck, so ensure dbus-devel is present
+ if test "x$with_dbus" = "xyes" ; then
+ AC_DEFINE_UNQUOTED([WITH_POLKIT], 1,
+ [use PolicyKit for UNIX socket access checks])
+ AC_DEFINE_UNQUOTED([WITH_POLKIT1], 1,
+ [use PolicyKit for UNIX socket access checks])
+ with_polkit="yes"
+ with_polkit1="yes"
+ else
+ if test "x$with_polkit" = "xcheck" ; then
+ with_polkit=no
+ else
+ AC_MSG_ERROR(
+ [You must install dbus to compile libvirt with polkit-1])
+ fi
+ fi
else
dnl Check for old polkit second - library + binary
PKG_CHECK_MODULES(POLKIT, polkit-dbus >= $POLKIT_REQUIRED,
--
2.4.3
9 years, 4 months
[libvirt] [PATCH] spec: Fix polkit dep on F23
by Cole Robinson
As of fedora polkit-0.113-2, polkit-devel only pulls in polkit-libs, not
full polkit, but we need the latter for pkcheck otherwise our configure
test fails.
---
libvirt.spec.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 0adf55e..40d2ccb 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -531,6 +531,8 @@ BuildRequires: cyrus-sasl-devel
%endif
%if %{with_polkit}
%if 0%{?fedora} >= 20 || 0%{?rhel} >= 7
+# F22 polkit-devel doesn't pull in polkit anymore, which we need for pkcheck
+BuildRequires: polkit >= 0.112
BuildRequires: polkit-devel >= 0.112
%else
%if 0%{?fedora} || 0%{?rhel} >= 6
--
2.4.3
9 years, 4 months