[PATCH] get_dominfo: Use VIR_DOMAIN_XML_SECURE more wisely

Currently, even if we are connected RO to the libvirtd, we try to dump domain XML with secure information (VIR_DOMAIN_XML_SECURE flag). This is, however, forbidden in libvirt. With RO connection, we should not use the SECURE flag at all. --- libxkutil/device_parsing.c | 9 +++++++-- libxkutil/misc_util.c | 2 +- libxkutil/misc_util.h | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libxkutil/device_parsing.c b/libxkutil/device_parsing.c index 7900e06..ffdf682 100644 --- a/libxkutil/device_parsing.c +++ b/libxkutil/device_parsing.c @@ -31,6 +31,7 @@ #include <libcmpiutil/libcmpiutil.h> #include "device_parsing.h" +#include "misc_util.h" #include "xmlgen.h" #include "../src/svpc_types.h" @@ -1283,8 +1284,12 @@ int get_dominfo(virDomainPtr dom, struct domain **dominfo) char *xml; int ret = 0; int start; - xml = virDomainGetXMLDesc(dom, - VIR_DOMAIN_XML_INACTIVE | VIR_DOMAIN_XML_SECURE); + int flags = VIR_DOMAIN_XML_INACTIVE; + + if (!is_read_only()) + flags |= VIR_DOMAIN_XML_SECURE; + + xml = virDomainGetXMLDesc(dom, flags); if (xml == NULL) { CU_DEBUG("Failed to get dom xml with libvirt API."); diff --git a/libxkutil/misc_util.c b/libxkutil/misc_util.c index 9e7e0d5..2164dd0 100644 --- a/libxkutil/misc_util.c +++ b/libxkutil/misc_util.c @@ -219,7 +219,7 @@ static int libvirt_cim_config_get(LibvirtcimConfigProperty *prop) } #endif -static int is_read_only(void) +int is_read_only(void) { static LibvirtcimConfigProperty prop = { "readonly", CONFIG_BOOL, {0}, 0}; diff --git a/libxkutil/misc_util.h b/libxkutil/misc_util.h index fd4f191..056c327 100644 --- a/libxkutil/misc_util.h +++ b/libxkutil/misc_util.h @@ -153,6 +153,7 @@ int virt_set_status(const CMPIBroker *broker, #define REF2STR(r) CMGetCharPtr(CMObjectPathToString(r, NULL)) /* get libvirt-cim config */ +int is_read_only(void); const char *get_mig_ssh_tmp_key(void); bool get_disable_kvm(void); const char *get_lldptool_query_options(void); -- 1.8.1.5

https://bugzilla.redhat.com/show_bug.cgi?id=859122 libvirt-cim installs open-pegasus' specific providers in sblim-sfcb repository staging directory and causing problem when creating sfcb repository. --- libvirt-cim.spec.in | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libvirt-cim.spec.in b/libvirt-cim.spec.in index 7b6221e..a027246 100644 --- a/libvirt-cim.spec.in +++ b/libvirt-cim.spec.in @@ -133,9 +133,6 @@ then -n root/interop \ -r %{INTEROP_REG} -m %{INTEROP_MOF} -v >/dev/null 2>&1 || true %{_datadir}/%{name}/provider-register.sh -t sfcb \ - -n root/PG_InterOp \ - -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} -v >/dev/null 2>&1 || true -%{_datadir}/%{name}/provider-register.sh -t sfcb \ -n root/cimv2\ -r %{CIMV2_REG} -m %{CIMV2_MOF} -v >/dev/null 2>&1 || true fi @@ -165,9 +162,6 @@ then -n root/interop \ -r %{INTEROP_REG} -m %{INTEROP_MOF} >/dev/null 2>&1 || true %{_datadir}/%{name}/provider-register.sh -d -t sfcb \ - -n root/PG_InterOp \ - -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} >/dev/null 2>&1 || true -%{_datadir}/%{name}/provider-register.sh -d -t sfcb \ -n root/cimv2 \ -r %{CIMV2_REG} -m %{CIMV2_MOF} >/dev/null 2>&1 || true fi -- 1.8.1.5

On 08/08/2013 05:51 AM, Michal Privoznik wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=859122
libvirt-cim installs open-pegasus' specific providers in sblim-sfcb repository staging directory and causing problem when creating sfcb repository. --- libvirt-cim.spec.in | 6 ------ 1 file changed, 6 deletions(-)
ACK John

On 08/08/2013 05:51 AM, Michal Privoznik wrote:
Currently, even if we are connected RO to the libvirtd, we try to dump domain XML with secure information (VIR_DOMAIN_XML_SECURE flag). This is, however, forbidden in libvirt. With RO connection, we should not use the SECURE flag at all. --- libxkutil/device_parsing.c | 9 +++++++-- libxkutil/misc_util.c | 2 +- libxkutil/misc_util.h | 1 + 3 files changed, 9 insertions(+), 3 deletions(-)
ACK Although my cimtest is failing as a result of another bug added to the top of the libvirt git tree. I have chased that bug a bit and notified the For anyone pulling up a top of tree, don't run: VirtualSystemManagementService and 30_dynamic_disk_mod.py John
participants (2)
-
John Ferlan
-
Michal Privoznik