[libvirt] [PATCH] Added support for portable-rpcgen from portablexdr library
by Pavel Fedin
This patch allows to build libvirt natively under MinGW/MSYS using portablexdr library.
An updated version of portablexdr with fixed bugs is available as part of MSYS2 project.
Signed-off-by: Pavel Fedin <p.fedin(a)samsung.com>
---
configure.ac | 2 +-
src/lxc/lxc_monitor_protocol.x | 2 +-
src/rpc/genprotocol.pl | 5 ++++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index aed0934..547a405 100644
--- a/configure.ac
+++ b/configure.ac
@@ -397,7 +397,7 @@ AM_CONDITIONAL([HAVE_LIBTASN1], [test "x$ac_cv_header_libtasn1_h" = "xyes"])
AC_CHECK_LIB([intl],[gettext],[])
dnl Do we have rpcgen?
-AC_PATH_PROG([RPCGEN], [rpcgen], [no])
+AC_PATH_PROGS([RPCGEN], [rpcgen portable-rpcgen], [no])
AM_CONDITIONAL([HAVE_RPCGEN], [test "x$ac_cv_path_RPCGEN" != "xno"])
dnl Is this GLIBC's buggy rpcgen?
AM_CONDITIONAL([HAVE_GLIBC_RPCGEN],
diff --git a/src/lxc/lxc_monitor_protocol.x b/src/lxc/lxc_monitor_protocol.x
index 3b66af5..205d7c2 100644
--- a/src/lxc/lxc_monitor_protocol.x
+++ b/src/lxc/lxc_monitor_protocol.x
@@ -30,7 +30,7 @@ enum virLXCMonitorExitStatus {
};
struct virLXCMonitorExitEventMsg {
- enum virLXCMonitorExitStatus status;
+ virLXCMonitorExitStatus status;
};
struct virLXCMonitorInitEventMsg {
diff --git a/src/rpc/genprotocol.pl b/src/rpc/genprotocol.pl
index 6e6d6d4..1ac2507 100755
--- a/src/rpc/genprotocol.pl
+++ b/src/rpc/genprotocol.pl
@@ -38,7 +38,10 @@ my $target = shift;
unlink $target;
-open RPCGEN, "-|", $rpcgen, $mode, $xdrdef
+if ($rpcgen =~ /portable-rpcgen/) {
+ $rpcgen = "$rpcgen -o -";
+}
+open RPCGEN, "-|", "$rpcgen $mode $xdrdef"
or die "cannot run $rpcgen $mode $xdrdef: $!";
open TARGET, ">$target"
or die "cannot create $target: $!";
--
1.9.5.msysgit.0
9 years, 9 months
[libvirt] [PATCH] conf: storage: Fix duplicate check for gluster pools
by Peter Krempa
The pool name has to be the same too to warrant rejecting a pool
definition as duplicate. This regression was introduced in commit
2184ade3a0546b915252cb3b6a5dc88e9a8d2ccf.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1236438
---
src/conf/storage_conf.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 4bbed4f..4fa065d 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -2471,13 +2471,22 @@ virStoragePoolSourceFindDuplicate(virConnectPtr conn,
if (STREQ(pool->def->target.path, def->target.path))
matchpool = pool;
break;
- case VIR_STORAGE_POOL_NETFS:
+
case VIR_STORAGE_POOL_GLUSTER:
+ if (STREQ(pool->def->source.name, def->source.name) &&
+ STREQ(pool->def->source.dir, def->source.dir) &&
+ virStoragePoolSourceMatchSingleHost(&pool->def->source,
+ &def->source))
+ matchpool = pool;
+ break;
+
+ case VIR_STORAGE_POOL_NETFS:
if (STREQ(pool->def->source.dir, def->source.dir) &&
virStoragePoolSourceMatchSingleHost(&pool->def->source,
&def->source))
matchpool = pool;
break;
+
case VIR_STORAGE_POOL_SCSI:
if (pool->def->source.adapter.type ==
VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_FC_HOST &&
--
2.4.1
9 years, 9 months
[libvirt] [PATCH] qemu: Close the agent connection only on agent channel events
by Peter Krempa
processSerialChangedEvent processes events for all channels. Commit
2af51483 broke all agent interaction if a channel other than the agent
closes since it did not check that the event actually originated from
the guest agent channel.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1236924
Fixes up: https://bugzilla.redhat.com/show_bug.cgi?id=890648
---
src/qemu/qemu_driver.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2b530c8..353be31 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4448,10 +4448,20 @@ processSerialChangedEvent(virQEMUDriverPtr driver,
if (newstate == VIR_DOMAIN_CHR_DEVICE_STATE_DISCONNECTED &&
virDomainObjIsActive(vm) && priv->agent) {
- /* Close agent monitor early, so that other threads
- * waiting for the agent to reply can finish and our
- * job we acquire below can succeed. */
- qemuAgentNotifyClose(priv->agent);
+ /* peek into the domain definition to find the channel */
+ if (virDomainDefFindDevice(vm->def, devAlias, &dev, true) == 0 &&
+ dev.type == VIR_DOMAIN_DEVICE_CHR &&
+ dev.data.chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
+ dev.data.chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO &&
+ STREQ_NULLABLE(dev.data.chr->target.name, "org.qemu.guest_agent.0"))
+ /* Close agent monitor early, so that other threads
+ * waiting for the agent to reply can finish and our
+ * job we acquire below can succeed. */
+ qemuAgentNotifyClose(priv->agent);
+
+ /* now discard the data, since it may possibly change once we unlock
+ * while entering the job */
+ memset(&dev, 0, sizeof(dev));
}
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
--
2.4.1
9 years, 9 months
[libvirt] [PATCH] vz: fix SDK event dispatching
by nshirokovskiy@virtuozzo.com
From: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
Current version of SDK event dispatcing is incorrect. For most VM events (add,
delete etc) issuer type is PIE_DISPATCHER. Actually analyzing issuer type
doesn't have any benifints so this patch get rid of it. All dispatching is done
only on event type.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
src/vz/vz_sdk.c | 58 +++++++++++++++---------------------------------------
1 files changed, 16 insertions(+), 42 deletions(-)
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 98f7a57..2ca74c4 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -1697,21 +1697,33 @@ prlsdkHandlePerfEvent(vzConnPtr privconn,
return PRL_ERR_SUCCESS;
}
-static void
-prlsdkHandleVmEvent(vzConnPtr privconn, PRL_HANDLE prlEvent)
+static PRL_RESULT
+prlsdkEventsHandler(PRL_HANDLE prlEvent, PRL_VOID_PTR opaque)
{
+ vzConnPtr privconn = opaque;
PRL_RESULT pret = PRL_ERR_FAILURE;
+ PRL_HANDLE_TYPE handleType;
char uuidstr[VIR_UUID_STRING_BUFLEN + 2];
unsigned char uuid[VIR_UUID_BUFLEN];
PRL_UINT32 bufsize = ARRAY_CARDINALITY(uuidstr);
PRL_EVENT_TYPE prlEventType;
- pret = PrlEvent_GetType(prlEvent, &prlEventType);
+ pret = PrlHandle_GetType(prlEvent, &handleType);
prlsdkCheckRetGoto(pret, cleanup);
+ /* Currently, there is no need to handle anything but events */
+ if (handleType != PHT_EVENT)
+ goto cleanup;
+
+ if (privconn == NULL)
+ goto cleanup;
+
pret = PrlEvent_GetIssuerId(prlEvent, uuidstr, &bufsize);
prlsdkCheckRetGoto(pret, cleanup);
+ pret = PrlEvent_GetType(prlEvent, &prlEventType);
+ prlsdkCheckRetGoto(pret, cleanup);
+
if (prlsdkUUIDParse(uuidstr, uuid) < 0)
goto cleanup;
@@ -1736,44 +1748,7 @@ prlsdkHandleVmEvent(vzConnPtr privconn, PRL_HANDLE prlEvent)
prlEvent = PRL_INVALID_HANDLE;
break;
default:
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Can't handle event of type %d"), prlEventType);
- }
-
- cleanup:
- PrlHandle_Free(prlEvent);
- return;
-}
-
-static PRL_RESULT
-prlsdkEventsHandler(PRL_HANDLE prlEvent, PRL_VOID_PTR opaque)
-{
- vzConnPtr privconn = opaque;
- PRL_RESULT pret = PRL_ERR_FAILURE;
- PRL_HANDLE_TYPE handleType;
- PRL_EVENT_ISSUER_TYPE prlIssuerType = PIE_UNKNOWN;
-
- pret = PrlHandle_GetType(prlEvent, &handleType);
- prlsdkCheckRetGoto(pret, cleanup);
-
- /* Currently, there is no need to handle anything but events */
- if (handleType != PHT_EVENT)
- goto cleanup;
-
- if (privconn == NULL)
- goto cleanup;
-
- PrlEvent_GetIssuerType(prlEvent, &prlIssuerType);
- prlsdkCheckRetGoto(pret, cleanup);
-
- switch (prlIssuerType) {
- case PIE_VIRTUAL_MACHINE:
- prlsdkHandleVmEvent(privconn, prlEvent);
- // above function takes own of event
- prlEvent = PRL_INVALID_HANDLE;
- break;
- default:
- VIR_DEBUG("Skipping event of issuer type %d", prlIssuerType);
+ VIR_DEBUG("Skipping event of type %d", prlEventType);
}
cleanup:
@@ -1781,7 +1756,6 @@ prlsdkEventsHandler(PRL_HANDLE prlEvent, PRL_VOID_PTR opaque)
return PRL_ERR_SUCCESS;
}
-
int prlsdkSubscribeToPCSEvents(vzConnPtr privconn)
{
PRL_RESULT pret = PRL_ERR_UNINITIALIZED;
--
1.7.1
9 years, 9 months
[libvirt] [PATCH] Fix typo incomaptible -> incompatible
by Andrea Bolognani
---
src/cpu/cpu_x86.c | 4 ++--
src/libvirt-domain-snapshot.c | 2 +-
src/qemu/qemu_driver.c | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 2a14705..f5f7697 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -1507,14 +1507,14 @@ x86Compute(virCPUDefPtr host,
static virCPUCompareResult
x86Compare(virCPUDefPtr host,
virCPUDefPtr cpu,
- bool failIncomaptible)
+ bool failIncompatible)
{
virCPUCompareResult ret;
char *message = NULL;
ret = x86Compute(host, cpu, NULL, &message);
- if (failIncomaptible && ret == VIR_CPU_COMPARE_INCOMPATIBLE) {
+ if (failIncompatible && ret == VIR_CPU_COMPARE_INCOMPATIBLE) {
ret = VIR_CPU_COMPARE_ERROR;
if (message) {
virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s", message);
diff --git a/src/libvirt-domain-snapshot.c b/src/libvirt-domain-snapshot.c
index 4625e03..b7c566f 100644
--- a/src/libvirt-domain-snapshot.c
+++ b/src/libvirt-domain-snapshot.c
@@ -1048,7 +1048,7 @@ virDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot,
* new hypervisor instance rather than reusing the existing hypervisor
* (since this would terminate all connections to the domain, such as
* such as VNC or Spice graphics) - this condition arises from active
- * snapshots that are provably ABI incomaptible, as well as from
+ * snapshots that are provably ABI incompatible, as well as from
* inactive snapshots with a @flags request to start the domain after
* the revert.
*
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2b530c8..bdf9b15 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -12948,7 +12948,7 @@ qemuConnectCompareCPU(virConnectPtr conn,
virQEMUDriverPtr driver = conn->privateData;
int ret = VIR_CPU_COMPARE_ERROR;
virCapsPtr caps = NULL;
- bool failIncomaptible;
+ bool failIncompatible;
virCheckFlags(VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE,
VIR_CPU_COMPARE_ERROR);
@@ -12956,14 +12956,14 @@ qemuConnectCompareCPU(virConnectPtr conn,
if (virConnectCompareCPUEnsureACL(conn) < 0)
goto cleanup;
- failIncomaptible = !!(flags & VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE);
+ failIncompatible = !!(flags & VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE);
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
if (!caps->host.cpu ||
!caps->host.cpu->model) {
- if (failIncomaptible) {
+ if (failIncompatible) {
virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s",
_("cannot get host CPU capabilities"));
} else {
@@ -12971,7 +12971,7 @@ qemuConnectCompareCPU(virConnectPtr conn,
ret = VIR_CPU_COMPARE_INCOMPATIBLE;
}
} else {
- ret = cpuCompareXML(caps->host.cpu, xmlDesc, failIncomaptible);
+ ret = cpuCompareXML(caps->host.cpu, xmlDesc, failIncompatible);
}
cleanup:
--
2.4.3
9 years, 9 months
[libvirt] [PATCH] qemu: Fix assignment of the default spicevmc channel name
by Jiri Denemark
Make sure we only assign the default spicevmc channel name to spicevmc
virtio channels. Caused by commits 3269ee65 and 1133ee2b, which moved
the assignment from XML parsing code to QEMU but failed to keep the
logic.
https://bugzilla.redhat.com/show_bug.cgi?id=1179680
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_command.c | 4 ++-
.../qemuxml2argv-channel-virtio-default.args | 16 ++++++++++
.../qemuxml2argv-channel-virtio-default.xml | 36 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 3 ++
4 files changed, 58 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-default.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-default.xml
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 2209cf6..9b06a49 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6427,7 +6427,9 @@ qemuBuildVirtioSerialPortDevStr(virDomainDefPtr def,
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SPICEVMC))) {
virBufferAsprintf(&buf, ",chardev=char%s,id=%s",
dev->info.alias, dev->info.alias);
- if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL) {
+ if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
+ (dev->source.type == VIR_DOMAIN_CHR_TYPE_SPICEVMC ||
+ dev->target.name)) {
virBufferAsprintf(&buf, ",name=%s", dev->target.name
? dev->target.name : "com.redhat.spice.0");
}
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-default.args b/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-default.args
new file mode 100644
index 0000000..7908445
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-default.args
@@ -0,0 +1,16 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-no-acpi \
+-boot c \
+-device virtio-serial-pci,id=virtio-serial1,bus=pci.0,addr=0xa \
+-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x3 \
+-usb \
+-hda /dev/HostVG/QEMUGuest1 \
+-chardev pty,id=charchannel0 \
+-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0 \
+-chardev spicevmc,id=charchannel1,name=vdagent \
+-device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,\
+name=com.redhat.spice.0 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-default.xml b/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-default.xml
new file mode 100644
index 0000000..74baded
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-default.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static' cpuset='1-4,8-20,525'>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='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <controller type='virtio-serial' index='1'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <channel type='pty'>
+ <target type='virtio'/>
+ </channel>
+ <channel type="spicevmc">
+ <target type="virtio"/>
+ </channel>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index a212d30..4154601 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1110,6 +1110,9 @@ mymain(void)
DO_TEST("channel-spicevmc-old",
QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_SPICEVMC);
+ DO_TEST("channel-virtio-default",
+ QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG,
+ QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC);
DO_TEST("smartcard-host",
QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE,
--
2.4.5
9 years, 9 months
[libvirt] [PATCH] qemuxml2argv: Remove CPU models from unrelated tests
by Jiri Denemark
Proper Haswell CPU model handling is tested in several
qemuxml2argv-cpu-* which are run in a special environment. Let's remove
the CPU model from other tests to make them less fragile.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
.../qemuxml2argv-hugepages-numa.args | 1 -
.../qemuxml2argv-hugepages-numa.xml | 3 +--
.../qemuxml2argv-interface-server.xml | 25 +---------------------
3 files changed, 2 insertions(+), 27 deletions(-)
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args
index b697942..37511b1 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args
@@ -2,7 +2,6 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \
/usr/bin/qemu-system-x86_64 \
-S \
-M pc-i440fx-2.3 \
--cpu Haswell \
-m size=1048576k,slots=16,maxmem=1099511627776k \
-smp 2 \
-object memory-backend-file,id=ram-node0,prealloc=yes,\
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.xml b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.xml
index 8c1f19c..8cda5c6 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.xml
@@ -17,8 +17,7 @@
<apic/>
<pae/>
</features>
- <cpu mode='custom' match='exact'>
- <model fallback='allow'>Haswell</model>
+ <cpu>
<numa>
<cell id='0' cpus='0-1' memory='1048576' unit='KiB'/>
</numa>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-interface-server.xml b/tests/qemuxml2argvdata/qemuxml2argv-interface-server.xml
index 9edf773..a92aff4 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-interface-server.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-interface-server.xml
@@ -19,30 +19,7 @@
<apic/>
<pae/>
</features>
- <cpu mode='custom' match='exact'>
- <model fallback='allow'>Haswell</model>
- <vendor>Intel</vendor>
- <feature policy='require' name='tm2'/>
- <feature policy='require' name='est'/>
- <feature policy='require' name='vmx'/>
- <feature policy='require' name='osxsave'/>
- <feature policy='require' name='smx'/>
- <feature policy='require' name='ss'/>
- <feature policy='require' name='ds'/>
- <feature policy='require' name='vme'/>
- <feature policy='require' name='dtes64'/>
- <feature policy='require' name='abm'/>
- <feature policy='require' name='ht'/>
- <feature policy='require' name='acpi'/>
- <feature policy='require' name='pbe'/>
- <feature policy='require' name='tm'/>
- <feature policy='require' name='pdcm'/>
- <feature policy='require' name='pdpe1gb'/>
- <feature policy='require' name='ds_cpl'/>
- <feature policy='require' name='rdrand'/>
- <feature policy='require' name='f16c'/>
- <feature policy='require' name='xtpr'/>
- <feature policy='require' name='monitor'/>
+ <cpu>
<numa>
<cell id='0' cpus='0' memory='1048576' unit='KiB'/>
<cell id='1' cpus='1' memory='1048576' unit='KiB'/>
--
2.4.5
9 years, 9 months
[libvirt] Libvirt - updates backing file permission of qcow2 image on launching instance
by Agrawal, Ankit
Hi All,
I am trying to fix a race condition between imagebackend and imagecache in nova (openstack) while creating an instance using qcow2 image backend. On creating a qcow2 image libvirt stores the base/backing file path reference while copying the image at instance disk info. While spawning the instance nova usage this base file reference as a backing file to launch instance.
When base file is created in nova image cache directory its owner is set to openstack (a nova user) but on launching the instance from guest.launch, libvirt updates the base/backing file owner from openstack to libvirt-qemu which causes permission error if we try to use that base file later.
Can someone please help me to understand why libvirt is updating the owner of base file stored in image cache directory, is it a bug in libvirt or the expected behaviour?
Thanks & Regards,
Ankit Agrawal
______________________________________________________________________
Disclaimer: This email and any attachments are sent in strictest confidence
for the sole use of the addressee and may contain legally privileged,
confidential, and proprietary data. If you are not the intended recipient,
please advise the sender by replying promptly to this email and then delete
and destroy this email and any attachments without any further use, copying
or forwarding.
9 years, 9 months
[libvirt] [PATCH] storage: Set correct vol->type at VolCreate
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1227664
If the requested format type for the new entry in the file system pool
is a 'dir', then be sure to set the vol->type correctly as would be done
when the pool is refreshed.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/storage/storage_backend_fs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
index b751687..0eebac3 100644
--- a/src/storage/storage_backend_fs.c
+++ b/src/storage/storage_backend_fs.c
@@ -1051,7 +1051,10 @@ virStorageBackendFileSystemVolCreate(virConnectPtr conn ATTRIBUTE_UNUSED,
virStorageVolDefPtr vol)
{
- vol->type = VIR_STORAGE_VOL_FILE;
+ if (vol->target.format == VIR_STORAGE_FILE_DIR)
+ vol->type = VIR_STORAGE_VOL_DIR;
+ else
+ vol->type = VIR_STORAGE_VOL_FILE;
VIR_FREE(vol->target.path);
if (virAsprintf(&vol->target.path, "%s/%s",
--
2.1.0
9 years, 9 months