[libvirt] [PATCH 0/7] Resolve issues saving domain to NFS root squashed client
by John Ferlan
Lots of details here:
https://bugzilla.redhat.com/show_bug.cgi?id=1158034
During my investigation I uncovered some other "issues" which are covered
by the first 4 patches. The issues are error path related.
The first two patches could be combined, but for now they're apart so
that it's proveable that they resolve a single issue. Hopefully mkletzan
can take a look at these to ensure they fit with the "spirit" of the
changes they're fixing. With these fixes in place the error from virfile
through qemu will be displayed...
The third and fourth patches can be combined. Realistically only the
third one is necessary as it resolves an issue introduced by the ref'd
gnulib change (eblake has already read about it). The fourth takes eblake's
suggestion to me in order to take the next step to avoid the throw-away
waitpid loop in virFileOpenForked and replace it by more inline logic.
Since this is code introduced by laine, I'm hoping he'll be able to take
a look-see. It's not required for the series, but nice to have. The
third patch allows us to be able to get the "correct" EACCES error back
from the vfork'd child, while the forth tries to make it clearer.
The fifth and sixth patches resolve the problem from the above ref'd
bz. Essentially what's happening is that when there's a root squashed
nfs client to which the 'virsh save $dom $file' is being saved, the
attempt by the second virOpenFileAs to open or chmod the $file can
fail because the file generated by the first call may not be able to
be opened, written, or chown'd due to whatever was set by that first call.
The fifth patch is there because I found that if a 'save' file existed
initially and a 'virsh save $dom $file' failed - the $file was deleted
(and of course the subsequent 'virsh save $dom $file' would succeed).
Since we didn't create the file, we shouldn't delete it
The seventh patch isn't required, but I was hoping it might generate
some discussion as to whether it's the right thing to do. If we don't
set the VIR_FILE_OPEN_FORCE_MODE flag on the virFileOpenAs call, then
the subsequent virFileOpenForceOwnerMode will not change the protection
bits. So why pass something different if the end result is not change?
I looked at other virOpenFileAs paths that are creating and found only
one where the bit was set in virStorageBackendCreateRaw. Perhaps this
patch generates other patches to "really" save mode bits when CREAT is
being used.
An eight patch was considered, but I dropped it. I was going to add
an S_IROTH to the bits being passed on that nfs root squash path. This
was being considered because the above ref'd bz uses an nfs pool in
order to save the file into. That pool used different protections on
files when first created and once/if a pool-refresh or libvirtd restart/
reload is done - the pool will fail to start because of the save file's
protections. Setting other+read "resolved" or "work-around" that, but
I don't really think that's the right thing to do. Altough, it is
NFS and well not necessarily secure.
John Ferlan (7):
qemu: Save/restore error in error path for qemuDomainSaveInternal
qemu: Adjust EndAsyncJob for qemuDomainSaveInternal error path
virfile: Need to check for ENOTCONN from recvfd failure
virfile: Adjust error path for virFileOpenForked
qemu: Don't unconditionally delete file in qemuOpenFileAs
qemu: remove failed create prior to root squash share path
qemu: qemuOpenFileAs - set flag VIR_FILE_OPEN_FORCE_MODE
src/qemu/qemu_driver.c | 24 +++++++++++++++---
src/util/virfile.c | 66 +++++++++++++++++++++++++++++---------------------
2 files changed, 60 insertions(+), 30 deletions(-)
--
2.1.0
9 years, 9 months
[libvirt] Build failed in Jenkins: libvirt-syntax-check #3103
by Jenkins CI
See <http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/3103/>
------------------------------------------
Started by upstream project "libvirt-build" build number 3538
Building on master in workspace <http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/ws/>
[workspace] $ /bin/sh -xe /tmp/hudson8816773861766117951.sh
+ make syntax-check
GEN bracket-spacing-check
GFDL_version
1.47 GFDL_version
TAB_in_indentation
0.52 TAB_in_indentation
Wundef_boolean
0.28 Wundef_boolean
avoid_attribute_unused_in_header
0.33 avoid_attribute_unused_in_header
avoid_ctype_macros
0.75 avoid_ctype_macros
avoid_if_before_free
6.51 avoid_if_before_free
avoid_strcase
0.66 avoid_strcase
avoid_write
0.73 avoid_write
bindtextdomain
0.43 bindtextdomain
cast_of_argument_to_free
0.73 cast_of_argument_to_free
cast_of_x_alloc_return_value
0.63 cast_of_x_alloc_return_value
changelog
0.29 changelog
const_long_option
0.69 const_long_option
copyright_check
0.80 copyright_check
copyright_format
1.84 copyright_format
copyright_usage
1.86 copyright_usage
correct_id_types
0.69 correct_id_types
curly_braces_style
1.36 curly_braces_style
error_message_period
0.61 error_message_period
error_message_warn_fatal
0.58 error_message_warn_fatal
flags_debug
1.29 flags_debug
flags_usage
src/util/virnetdevmacvlan.c:1069: unsigned int flags ATTRIBUTE_UNUSED)
maint.mk: flags should be checked with virCheckFlags
make: *** [sc_flags_usage] Error 1
Build step 'Execute shell' marked build as failure
9 years, 9 months
[libvirt] [PATCH v5 0/2] Allow UEFI paths to be specified at compile time
by Michal Privoznik
diff to v4:
- added check for list consistence to configure too
- slightly reformatted C parsing code
2/2 has been ACKed meanwhile, so sending it just for completeness.
Michal Privoznik (2):
qemu: Allow UEFI paths to be specified at compile time
qemu: Add AAVMF to the list of known UEFIs
configure.ac | 17 ++++++
src/qemu/qemu.conf | 12 +++-
src/qemu/qemu_conf.c | 67 +++++++++++++++++++---
src/qemu/test_libvirtd_qemu.aug.in | 1 +
.../domaincaps-qemu_1.6.50-1.xml | 1 +
tests/domaincapstest.c | 16 +++---
6 files changed, 97 insertions(+), 17 deletions(-)
--
2.0.5
9 years, 9 months
[libvirt] [PATCH] Fix syntax-check
by Ján Tomko
My commit 08d1ae1 broke syntax-check by adding ATTRIBUTE_UNUSED
to the flags parameter.
Rename the parameter to unused_flags to bypass the check.
---
Pushed as a build fix.
src/util/virnetdevmacvlan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index 6a8a923..72e1f65 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -1066,7 +1066,7 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname ATTRIBUTE_UNUSED,
char **res_ifname ATTRIBUTE_UNUSED,
virNetDevVPortProfileOp vmop ATTRIBUTE_UNUSED,
char *stateDir ATTRIBUTE_UNUSED,
- unsigned int flags ATTRIBUTE_UNUSED)
+ unsigned int unused_flags ATTRIBUTE_UNUSED)
{
virReportSystemError(ENOSYS, "%s",
_("Cannot create macvlan devices on this platform"));
--
2.0.5
9 years, 9 months
[libvirt] [PATCH v3 0/9] qemu: support hot-plug/unplug RNG device
by Luyao Huang
qemu already support hot-plug and hot-unplug RNG device.
These patch will make libvirt support hot-plug/unplug RNG device for qemu driver.
v3:
-fix a wrong use of virJSONValueObjectCreate
-merge some new functions use qemu monitor in one patch
-merge tests fix in the patch which need fix tests
v2:
-remove a commit about add 4 new func in libvirt_private.syms and move them to
the commit which use these functions
-impove some commit subject
-improve the logic in virDomainRNGRemove
-remove qemuDomainRNGInsert
-unexport qemuDomainRNGRemove
-add a check if chardev and backend object ID have the same basic alias name
-rename need_remove to remove_chardev in qemuDomainAttachRNGDevice
-add qemu capability check for RNG device backend
Luyao Huang (9):
qemu: Add helper to assign RNG device aliases
qemu: refactor qemuBuildRNGDeviceArgs to allow reuse in RNG hotplug
conf: Introduce function to compare RNG devices.
conf: add 3 functions for insert,remove and find a RNG device
qemu: add id when build RNG device and rename object id
qemu: add functions for attach/detach RNG device via qemu monitor
audit: export virDomainAuditRNG
qemu: Implement RNG device hotplug on live level
qemu: Implement RNG device hotunplug on live level
src/conf/domain_audit.c | 2 +-
src/conf/domain_audit.h | 7 +
src/conf/domain_conf.c | 76 +++++++
src/conf/domain_conf.h | 9 +
src/libvirt_private.syms | 6 +
src/qemu/qemu_command.c | 69 ++++---
src/qemu/qemu_command.h | 5 +
src/qemu/qemu_driver.c | 12 +-
src/qemu/qemu_hotplug.c | 218 ++++++++++++++++++++-
src/qemu/qemu_hotplug.h | 7 +-
src/qemu/qemu_monitor.c | 43 ++++
src/qemu/qemu_monitor.h | 7 +
src/qemu/qemu_monitor_json.c | 43 ++++
src/qemu/qemu_monitor_json.h | 5 +
.../qemuxml2argv-aarch64-virt-virtio.args | 4 +-
.../qemuxml2argv-arm-vexpressa9-virtio.args | 4 +-
.../qemuxml2argv-arm-virt-virtio.args | 4 +-
.../qemuxml2argv-s390-piix-controllers.args | 2 +-
.../qemuxml2argv-s390-usb-none.args | 2 +-
.../qemuxml2argv-virtio-rng-ccw.args | 4 +-
.../qemuxml2argv-virtio-rng-default.args | 4 +-
.../qemuxml2argv-virtio-rng-egd.args | 4 +-
.../qemuxml2argv-virtio-rng-multiple.args | 8 +-
.../qemuxml2argv-virtio-rng-random.args | 4 +-
24 files changed, 501 insertions(+), 48 deletions(-)
--
1.8.3.1
9 years, 9 months
[libvirt] [PATCH] cpu: add Freescale ppc64 CPU models
by Olivia Yin
When running Openstack on Freescale ppc64 board, got libvirtError as before:
nova.openstack.common.threadgroup libvirtError: XML error: Missing CPU model name.
This patch is to add Freescale ppc64 CPU models.
Signed-off-by: Olivia Yin <hong-hua.yin(a)freescale.com>
---
src/cpu/cpu_map.xml | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
index bd9b056..707cf88 100644
--- a/src/cpu/cpu_map.xml
+++ b/src/cpu/cpu_map.xml
@@ -600,6 +600,7 @@
<arch name='ppc64'>
<!-- vendor definitions -->
<vendor name='IBM'/>
+ <vendor name='Freescale'/>
<!-- IBM-based CPU models -->
<model name='POWER7'>
@@ -657,5 +658,40 @@
<pvr value='0x004d0000'/>
</model>
+<!-- Freescale-based CPU models -->
+ <model name='POWERPC_e5500_v10'>
+ <vendor name='Freescale'/>
+ <pvr value='0x80240010'/>
+ </model>
+
+ <model name='POWERPC_e5500_v11'>
+ <vendor name='Freescale'/>
+ <pvr value='0x80240011'/>
+ </model>
+
+ <model name='POWERPC_e5500_v12'>
+ <vendor name='Freescale'/>
+ <pvr value='0x80240012'/>
+ </model>
+
+ <model name='POWERPC_e5500_v1020'>
+ <vendor name='Freescale'/>
+ <pvr value='0x80241020'/>
+ </model>
+
+ <model name='POWERPC_e6500_v10'>
+ <vendor name='Freescale'/>
+ <pvr value='0x80400010'/>
+ </model>
+
+ <model name='POWERPC_e6500_v20'>
+ <vendor name='Freescale'/>
+ <pvr value='0x80400020'/>
+ </model>
+
+ <model name='POWERPC_e6500_v120'>
+ <vendor name='Freescale'/>
+ <pvr value='0x80400120'/>
+ </model>
</arch>
</cpus>
--
2.1.0.27.g96db324
9 years, 9 months
[libvirt] [PATCH v2] conf: Disallow emulatorpin when numatune's in effect
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1170492
In one of our previous commits (dc8b7ce7) we've done a functional
change even though it was intended as pure refactor. The problem is,
that the following XML:
<vcpu placement='static' current='2'>6</vcpu>
<cputune>
<emulatorpin cpuset='1-3'/>
</cputune>
gets translated into this one:
<vcpu placement='auto' current='2'>6</vcpu>
<cputune>
<emulatorpin cpuset='1-3'/>
</cputune>
<numatune>
<memory mode='strict' placement='auto'/>
</numatune>
We should not change the vcpu placement mode.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
diff to v1:
-Martin's review worked in
src/conf/domain_conf.c | 3 +-
.../qemuxml2argv-cputune-numatune.xml | 35 ++++++++++++++++++++++
.../qemuxml2xmlout-cputune-numatune.xml | 32 ++++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
4 files changed, 70 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-numatune.xml
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9ff3819..fbc0e96 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13173,7 +13173,8 @@ virDomainDefParseXML(xmlDocPtr xml,
ctxt) < 0)
goto error;
- if (virDomainNumatuneHasPlacementAuto(def->numatune) && !def->cpumask)
+ if (virDomainNumatuneHasPlacementAuto(def->numatune) &&
+ !def->cpumask && !def->cputune.vcpupin && !def->cputune.emulatorpin)
def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO;
if ((n = virXPathNodeSet("./resource", ctxt, &nodes)) < 0) {
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.xml b/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.xml
new file mode 100644
index 0000000..9759b48
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.xml
@@ -0,0 +1,35 @@
+<domain type='kvm'>
+ <name>dummy2</name>
+ <uuid>4d92ec27-9ebf-400b-ae91-20c71c647c19</uuid>
+ <memory unit='KiB'>131072</memory>
+ <currentMemory unit='KiB'>65536</currentMemory>
+ <vcpu placement='auto' current='2'>6</vcpu>
+ <cputune>
+ <emulatorpin cpuset='1-3'/>
+ </cputune>
+ <numatune>
+ <memory mode='strict' placement='auto'/>
+ </numatune>
+ <os>
+ <type arch='x86_64' machine='pc-q35-2.3'>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-system-x86_64</emulator>
+ <controller type='sata' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <controller type='pci' index='1' model='dmi-to-pci-bridge'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
+ </controller>
+ <controller type='pci' index='2' model='pci-bridge'>
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
+ </controller>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-numatune.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-numatune.xml
new file mode 100644
index 0000000..b33f57f
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-numatune.xml
@@ -0,0 +1,32 @@
+<domain type='kvm'>
+ <name>dummy2</name>
+ <uuid>4d92ec27-9ebf-400b-ae91-20c71c647c19</uuid>
+ <memory unit='KiB'>131072</memory>
+ <currentMemory unit='KiB'>65536</currentMemory>
+ <vcpu placement='auto' current='2'>6</vcpu>
+ <numatune>
+ <memory mode='strict' placement='auto'/>
+ </numatune>
+ <os>
+ <type arch='x86_64' machine='pc-q35-2.3'>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-system-x86_64</emulator>
+ <controller type='sata' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <controller type='pci' index='1' model='dmi-to-pci-bridge'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
+ </controller>
+ <controller type='pci' index='2' model='pci-bridge'>
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
+ </controller>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 4abb303..9ceda58 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -310,6 +310,7 @@ mymain(void)
DO_TEST("blkiotune-device");
DO_TEST("cputune");
DO_TEST("cputune-zero-shares");
+ DO_TEST_DIFFERENT("cputune-numatune");
DO_TEST("smp");
DO_TEST("iothreads");
--
2.0.5
9 years, 9 months
[libvirt] [PATCH] Remove flag checking in MacVLanCreate helper stub
by Ján Tomko
When compiling without WITH_MACVTAP, we can get:
'unsupported flags (0x1) in function
virNetDevMacVLanCreateWithVPortProfile'
on an attempt to start a domain.
Remove the flag check to reach the more helpful error:
Cannot create macvlan devices on this platform
https://bugzilla.redhat.com/show_bug.cgi?id=1186928
---
src/util/virnetdevmacvlan.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index f2eae06..6a8a923 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -1066,9 +1066,8 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname ATTRIBUTE_UNUSED,
char **res_ifname ATTRIBUTE_UNUSED,
virNetDevVPortProfileOp vmop ATTRIBUTE_UNUSED,
char *stateDir ATTRIBUTE_UNUSED,
- unsigned int flags)
+ unsigned int flags ATTRIBUTE_UNUSED)
{
- virCheckFlags(0, -1);
virReportSystemError(ENOSYS, "%s",
_("Cannot create macvlan devices on this platform"));
return -1;
--
2.0.5
9 years, 9 months
[libvirt] [PATCH] virsh: man: Document behavior of some blkdeviotune's flags when querying
by Peter Krempa
--live and --config can't be specified together when querying the
configuration, but are valid when setting. The man page was hinting that
they are valid always.
---
tools/virsh.pod | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 1591341..804458e 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -1100,9 +1100,10 @@ cannot be mixed with non-zero values for read or write.
If I<--live> is specified, affect a running guest.
If I<--config> is specified, affect the next boot of a persistent guest.
If I<--current> is specified, affect the current guest state.
-Both I<--live> and I<--config> flags may be given, but I<--current> is
-exclusive. If no flag is specified, behavior is different depending
-on hypervisor.
+When setting the disk io parameters both I<--live> and I<--config> flags may be
+given, but I<--current> is exclusive. For querying only one of I<--live>,
+I<--config> or I<--current> can be specified. If no flag is specified, behavior
+is different depending on hypervisor.
=item B<blockjob> I<domain> I<path> { [I<--abort>] [I<--async>] [I<--pivot>] |
[I<--info>] [I<--raw>] [I<--bytes>] | [I<bandwidth>] }
--
2.2.2
9 years, 9 months
[libvirt] [PATCH] qemu: fix cannot set graphic passwd via qemuDomainSaveImageDefineXML
by Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1183890
When we try to update a xml to a image file, we will clear the
graphics passwd settings, because we do not pass VIR_DOMAIN_XML_SECURE
to qemuDomainDefCopy, qemuDomainDefFormatBuf won't format the passwd.
Add VIR_DOMAIN_XML_SECURE flag when we call qemuDomainDefCopy
in qemuDomainSaveImageUpdateDef.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/qemu/qemu_driver.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 5994558..abe3b9f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5613,7 +5613,8 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver,
if (!(newdef_migr = qemuDomainDefCopy(driver,
newdef,
- VIR_DOMAIN_XML_MIGRATABLE)))
+ VIR_DOMAIN_XML_MIGRATABLE |
+ VIR_DOMAIN_XML_SECURE)))
goto cleanup;
if (!virDomainDefCheckABIStability(def, newdef_migr)) {
--
1.8.3.1
9 years, 10 months