[libvirt] [PATCH v2] esx: Allow 'vmpvscsi' as SCSI controller model
by Matthias Bolte
---
v2:
- rename 'pvscsi' to 'vmpvscsi'
- add esxVMX_SCSIControllerModelType{to,from}String to handle the difference
between VMX and XML name of the controller model
docs/drvesx.html.in | 13 ++++++++++++-
docs/schemas/domain.rng | 1 +
src/conf/domain_conf.c | 3 ++-
src/conf/domain_conf.h | 1 +
src/esx/esx_vmx.c | 25 ++++++++++++++++++-------
tests/vmx2xmldata/vmx2xml-scsi-driver.vmx | 5 +++++
tests/vmx2xmldata/vmx2xml-scsi-driver.xml | 6 ++++++
tests/xml2vmxdata/xml2vmx-scsi-driver.vmx | 5 +++++
tests/xml2vmxdata/xml2vmx-scsi-driver.xml | 5 +++++
9 files changed, 55 insertions(+), 9 deletions(-)
diff --git a/docs/drvesx.html.in b/docs/drvesx.html.in
index bc7e1a0..88c70bc 100644
--- a/docs/drvesx.html.in
+++ b/docs/drvesx.html.in
@@ -302,7 +302,13 @@ ethernet0.checkMACAddress = "false"
</dd>
<dt><code>lsisas1068</code></dt>
<dd>
- LSI Logic SAS 1068 controller.
+ LSI Logic SAS 1068 controller. <span class="since">Since 0.8.0</span>
+ </dd>
+ <dt><code>vmpvscsi</code></dt>
+ <dd>
+ Special VMware Paravirtual SCSI controller, requires VMware tools inside
+ the guest. See <a href="http://kb.vmware.com/kb/1010398">VMware KB1010398</a>
+ for details. <span class="since">Since 0.8.3</span>
</dd>
</dl>
<p>
@@ -642,5 +648,10 @@ Enter administrator password for example-vcenter.com:
VMware VMX config parameters
</a>
</li>
+ <li>
+ <a href="http://www.vmware.com/pdf/vsp_4_pvscsi_perf.pdf">
+ VMware ESX 4.0 PVSCSI Storage Performance
+ </a>
+ </li>
</ul>
</body></html>
diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index 1d56f5b..6240518 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -676,6 +676,7 @@
<value>buslogic</value>
<value>lsilogic</value>
<value>lsisas1068</value>
+ <value>vmpvscsi</value>
</choice>
</attribute>
</optional>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 378c06e..6ebf982 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -142,7 +142,8 @@ VIR_ENUM_IMPL(virDomainController, VIR_DOMAIN_CONTROLLER_TYPE_LAST,
VIR_ENUM_IMPL(virDomainControllerModel, VIR_DOMAIN_CONTROLLER_MODEL_LAST,
"buslogic",
"lsilogic",
- "lsisas1068")
+ "lsisas1068",
+ "vmpvscsi")
VIR_ENUM_IMPL(virDomainFS, VIR_DOMAIN_FS_TYPE_LAST,
"mount",
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 01da17e..4abe376 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -199,6 +199,7 @@ enum virDomainControllerModel {
VIR_DOMAIN_CONTROLLER_MODEL_BUSLOGIC,
VIR_DOMAIN_CONTROLLER_MODEL_LSILOGIC,
VIR_DOMAIN_CONTROLLER_MODEL_LSISAS1068,
+ VIR_DOMAIN_CONTROLLER_MODEL_VMPVSCSI,
VIR_DOMAIN_CONTROLLER_MODEL_LAST
};
diff --git a/src/esx/esx_vmx.c b/src/esx/esx_vmx.c
index e10e745..c69e116 100644
--- a/src/esx/esx_vmx.c
+++ b/src/esx/esx_vmx.c
@@ -428,6 +428,15 @@ def->parallels[0]...
#define ESX_BUILD_VMX_NAME(_suffix) \
snprintf(_suffix##_name, sizeof(_suffix##_name), "%s."#_suffix, prefix);
+/* directly map the virDomainControllerModel to esxVMX_SCSIControllerModel,
+ * this is good enough for now because all virDomainControllerModel values
+ * are actually SCSI controller models in the ESX case */
+VIR_ENUM_DECL(esxVMX_SCSIControllerModel)
+VIR_ENUM_IMPL(esxVMX_SCSIControllerModel, VIR_DOMAIN_CONTROLLER_MODEL_LAST,
+ "buslogic",
+ "lsilogic",
+ "lsisas1068",
+ "pvscsi");
int
@@ -740,11 +749,12 @@ esxVMX_GatherSCSIControllers(virDomainDefPtr def, int virtualDev[4],
if (controller->model != -1 &&
controller->model != VIR_DOMAIN_CONTROLLER_MODEL_BUSLOGIC &&
controller->model != VIR_DOMAIN_CONTROLLER_MODEL_LSILOGIC &&
- controller->model != VIR_DOMAIN_CONTROLLER_MODEL_LSISAS1068) {
+ controller->model != VIR_DOMAIN_CONTROLLER_MODEL_LSISAS1068 &&
+ controller->model != VIR_DOMAIN_CONTROLLER_MODEL_VMPVSCSI) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
_("Expecting domain XML attribute 'model' of entry "
"'controller' to be 'buslogic' or 'lsilogic' or "
- "'lsisas1068' but found '%s'"),
+ "'lsisas1068' or 'vmpvscsi' but found '%s'"),
virDomainControllerModelTypeToString(controller->model));
return -1;
}
@@ -1478,16 +1488,17 @@ esxVMX_ParseSCSIController(virConfPtr conf, int controller, bool *present,
*tmp = c_tolower(*tmp);
}
- *virtualDev = virDomainControllerModelTypeFromString(virtualDev_string);
+ *virtualDev = esxVMX_SCSIControllerModelTypeFromString(virtualDev_string);
if (*virtualDev == -1 ||
(*virtualDev != VIR_DOMAIN_CONTROLLER_MODEL_BUSLOGIC &&
*virtualDev != VIR_DOMAIN_CONTROLLER_MODEL_LSILOGIC &&
- *virtualDev != VIR_DOMAIN_CONTROLLER_MODEL_LSISAS1068)) {
+ *virtualDev != VIR_DOMAIN_CONTROLLER_MODEL_LSISAS1068 &&
+ *virtualDev != VIR_DOMAIN_CONTROLLER_MODEL_VMPVSCSI)) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
_("Expecting VMX entry '%s' to be 'buslogic' or 'lsilogic' "
- "or 'lsisas1068' but found '%s'"), virtualDev_name,
- virtualDev_string);
+ "or 'lsisas1068' or 'pvscsi' but found '%s'"),
+ virtualDev_name, virtualDev_string);
goto failure;
}
}
@@ -2619,7 +2630,7 @@ esxVMX_FormatConfig(esxVI_Context *ctx, virCapsPtr caps, virDomainDefPtr def,
if (scsi_virtualDev[i] != -1) {
virBufferVSprintf(&buffer, "scsi%d.virtualDev = \"%s\"\n", i,
- virDomainControllerModelTypeToString
+ esxVMX_SCSIControllerModelTypeToString
(scsi_virtualDev[i]));
}
}
diff --git a/tests/vmx2xmldata/vmx2xml-scsi-driver.vmx b/tests/vmx2xmldata/vmx2xml-scsi-driver.vmx
index cb055f6..64d7c99 100644
--- a/tests/vmx2xmldata/vmx2xml-scsi-driver.vmx
+++ b/tests/vmx2xmldata/vmx2xml-scsi-driver.vmx
@@ -6,6 +6,8 @@ scsi1.present = "true"
scsi1.virtualDev = "lsilogic"
scsi2.present = "true"
scsi2.virtualDev = "lsisas1068"
+scsi3.present = "true"
+scsi3.virtualDev = "pvscsi"
scsi0:0.present = "true"
scsi0:0.deviceType = "scsi-hardDisk"
scsi0:0.fileName = "harddisk1.vmdk"
@@ -15,3 +17,6 @@ scsi1:0.fileName = "harddisk2.vmdk"
scsi2:0.present = "true"
scsi2:0.deviceType = "scsi-hardDisk"
scsi2:0.fileName = "harddisk3.vmdk"
+scsi3:0.present = "true"
+scsi3:0.deviceType = "scsi-hardDisk"
+scsi3:0.fileName = "harddisk4.vmdk"
diff --git a/tests/vmx2xmldata/vmx2xml-scsi-driver.xml b/tests/vmx2xmldata/vmx2xml-scsi-driver.xml
index d39415d..553783b 100644
--- a/tests/vmx2xmldata/vmx2xml-scsi-driver.xml
+++ b/tests/vmx2xmldata/vmx2xml-scsi-driver.xml
@@ -26,8 +26,14 @@
<target dev='sdae' bus='scsi'/>
<address type='drive' controller='2' bus='0' unit='0'/>
</disk>
+ <disk type='file' device='disk'>
+ <source file='[datastore] directory/harddisk4.vmdk'/>
+ <target dev='sdat' bus='scsi'/>
+ <address type='drive' controller='3' bus='0' unit='0'/>
+ </disk>
<controller type='scsi' index='0' model='buslogic'/>
<controller type='scsi' index='1' model='lsilogic'/>
<controller type='scsi' index='2' model='lsisas1068'/>
+ <controller type='scsi' index='3' model='vmpvscsi'/>
</devices>
</domain>
diff --git a/tests/xml2vmxdata/xml2vmx-scsi-driver.vmx b/tests/xml2vmxdata/xml2vmx-scsi-driver.vmx
index 7cceca0..a92d7fc 100644
--- a/tests/xml2vmxdata/xml2vmx-scsi-driver.vmx
+++ b/tests/xml2vmxdata/xml2vmx-scsi-driver.vmx
@@ -11,6 +11,8 @@ scsi1.present = "true"
scsi1.virtualDev = "lsilogic"
scsi2.present = "true"
scsi2.virtualDev = "lsisas1068"
+scsi3.present = "true"
+scsi3.virtualDev = "pvscsi"
scsi0:0.present = "true"
scsi0:0.deviceType = "scsi-hardDisk"
scsi0:0.fileName = "/vmfs/volumes/datastore/directory/harddisk1.vmdk"
@@ -20,3 +22,6 @@ scsi1:0.fileName = "/vmfs/volumes/datastore/directory/harddisk2.vmdk"
scsi2:0.present = "true"
scsi2:0.deviceType = "scsi-hardDisk"
scsi2:0.fileName = "/vmfs/volumes/datastore/directory/harddisk3.vmdk"
+scsi3:0.present = "true"
+scsi3:0.deviceType = "scsi-hardDisk"
+scsi3:0.fileName = "/vmfs/volumes/datastore/directory/harddisk4.vmdk"
diff --git a/tests/xml2vmxdata/xml2vmx-scsi-driver.xml b/tests/xml2vmxdata/xml2vmx-scsi-driver.xml
index 797a26e..ac630ee 100644
--- a/tests/xml2vmxdata/xml2vmx-scsi-driver.xml
+++ b/tests/xml2vmxdata/xml2vmx-scsi-driver.xml
@@ -21,5 +21,10 @@
<source file='[datastore] directory/harddisk3.vmdk'/>
<target dev='sdae' bus='scsi'/>
</disk>
+ <disk type='file' device='disk'>
+ <driver name='vmpvscsi'/>
+ <source file='[datastore] directory/harddisk4.vmdk'/>
+ <target dev='sdat' bus='scsi'/>
+ </disk>
</devices>
</domain>
--
1.7.0.4
14 years, 3 months
[libvirt] [PATCH] Fix SEGV on exit after domainEventDeregister()
by Philipp Hahn
When the last callback is removed using domainEventDeregister(), the
events dispatcher is deregistered from the C-library, but
domainEventsCallbacks is still an empty list.
On shutdown __del__() deregisters the dispatacher again, which SEGVs
# You need the event-loop implementation from the Python examples;
# give the file a name which is importable by Python.
ln examples/domain-events/events-python/event-test.py eloop.py
python -c 'from eloop import *
import sys
def dump(*args): print " ".join(map(str, args))
virEventLoopPureStart()
c = libvirt.open("xen:///")
c.domainEventRegister(dump, None)
c.domainEventDeregister(dump)
sys.exit(0)'
domainEventDeregister() needs to delete domainEventCallbacks so subsequent
calls to __del__() and domainEventRegister() choose the right code paths.
Setting it to None is not enough, since calling domainEventRegiser() again
would trigger an TypeError.
Signed-off-by: Philipp Hahn <hahn(a)univention.de>
---
python/libvirt-override-virConnect.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
14 years, 3 months
[libvirt] problems using virt-manager with qemu-kvm to boot a windows from floppy
by John Lumby
Background :
I have an existing win2K system which consists of one boot-floppy image (boot device) and one hard-disk partition /dev/sdc1). Previously I got this running with virt-manager and qemu-0.11 with kqemu - after hitting one bug in virtinst concerning name of the floppy and applying fix from Cole
http://hg.fedorahosted.org/hg/python-virtinst/rev/4d0ea2274ffd
Yesterday:
tried running same win2k but on a different system - the machine has the Intel VT-x - OS still Fedora 13, using qemu-kvm.
I applied the above patch to this system's virt-inst, and tried basically same virt-install command other than to select virt-type of kvm instead of kqemu
virt-install --connect qemu:///system --name=OCFwin2k --ram=392 --cpuset=0 --description="win2k on OCFed disk on usb, nat network" --import --network=network=default,model=pcnet --virt-type=kvm --accelerate --vnc --vncport=5905 --video=cirrus --disk=/home/lumby/Downloads/win2k_boot.floppage,device=floppy --disk=/dev/sdc,device=disk --os-type=windows --os-variant=win2k
But this time I hit two new problems :
. another (different) one relating to the floppy - qemu-kvm couldn't find it
. wrong syntax for the usb tablet in qemu-kvm command meant no tablet.
The qemu-kvm command that virt-manager came up with was this:
/usr/bin/qemu-kvm -S -M fedora-13 -cpu n270,+x2apic -enable-kvm -m 392 -smp 1,sockets=1,cores=1,threads=1 -name OCFwin2k -uuid 8a63ef02-cea8-cc23-5a31-f98a1b0bdea1 -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/OCFwin2k.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=localtime -boot a -drive file=/home/lumby/Downloads/win2k_boot.floppage,if=none,id=drive-fdc0-0-0 -global isa-fdc.driveA=drive-fdc0-0-0 -drive file=/dev/sdc,if=none,id=drive-ide0-0-0 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -device pcnet,vlan=0,id=net0,mac=52:54:00:97:f6:b9,bus=pci.0,addr=0x4 -net tap,fd=45,vlan=0,name=hostnet0 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -device usb-tablet,id=input0 -vnc 127.0.0.1:5 -k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
I've attached at the bottom the xml that virst-inst built for this machine.
I then looked back at what qemu command the virt-manager on my other system had come up with, merged bits of that with the above, and came up with this one which worked ok. It's a whole lot simpler!
/usr/bin/qemu-kvm -M fedora-13 -m 392 -smp 1 -name OCFwin2k -localtime -boot a -drive file=/home/lumby/Downloads/win2k_boot.floppage,if=floppy,unit=0 -drive file=/dev/sdc,if=ide,bus=0,unit=0 -net nic,macaddr=52:54:00:d7:84:4e,vlan=0,name=net0 -net tap,fd=17,vlan=0,name=hostnet0 -serial pty -parallel none -usb -usbdevice tablet -vga cirrus
I think there must be a bug or two somewhere but whether in virt-manager or in virt-inst or both I don't know. If you want more information just ask.
John Lumby
content of the xml generated by the above virt-install :
[Thu, 22 Jul 2010 19:39:02 virt-install 4709] DEBUG (cli:192) Launched with command line:
/usr/sbin/virt-install --connect qemu:///system --name=OCFwin2k --ram=392 --cpuset=0 --description=win2k on OCFed disk on usb, nat network --import --network=network=default,model=pcnet --virt-type=kvm --accelerate --vnc --vncport=5905 --video=cirrus --disk=/home/lumby/Downloads/win2k_boot.floppage,device=floppy --disk=/dev/sdc,device=disk --os-type=windows --os-variant=win2k
[Thu, 22 Jul 2010 19:39:02 virt-install 4709] DEBUG (cli:216) Requesting libvirt URI qemu:///system
[Thu, 22 Jul 2010 19:39:02 virt-install 4709] DEBUG (cli:218) Received libvirt URI qemu:///system
[Thu, 22 Jul 2010 19:39:03 virt-install 4709] DEBUG (virt-install:494) Requesting virt method 'default', hv type 'kvm'.
[Thu, 22 Jul 2010 19:39:03 virt-install 4709] DEBUG (virt-install:816) Received virt method 'hvm'
[Thu, 22 Jul 2010 19:39:03 virt-install 4709] DEBUG (virt-install:817) Hypervisor name is 'kvm'
[Thu, 22 Jul 2010 19:39:03 virt-install 4709] DEBUG (virt-install:351) parse_disk: returning {'format': None, 'bus': None, 'readOnly': False, 'volInstall': None, 'path': '/home/lumby/Downloads/win2k_boot.floppage', 'device': 'floppy', 'volName': None, 'conn': <libvirt.virConnect instance at 0x93ec6ec>, 'size': None, 'driverCache': None, 'shareable': False, 'sparse': True}
[Thu, 22 Jul 2010 19:39:03 virt-install 4709] DEBUG (virt-install:351) parse_disk: returning {'format': None, 'bus': None, 'readOnly': False, 'volInstall': None, 'path': '/dev/sdc', 'device': 'disk', 'volName': None, 'conn': <libvirt.virConnect instance at 0x93ec6ec>, 'size': None, 'driverCache': None, 'shareable': False, 'sparse': True}
[Thu, 22 Jul 2010 19:39:03 virt-install 4709] DEBUG (Guest:1012) Generated install XML: None required
[Thu, 22 Jul 2010 19:39:03 virt-install 4709] DEBUG (Guest:1030) Generated boot XML:
<domain type='kvm'>
<name>OCFwin2k</name>
<currentMemory>401408</currentMemory>
<memory>401408</memory>
<uuid>8a63ef02-cea8-cc23-5a31-f98a1b0bdea1</uuid>
<description>win2k on OCFed disk on usb, nat network</description>
<os>
<type arch='i686'>hvm</type>
<boot dev='fd'/>
</os>
<features>
<acpi/><apic/><pae/>
</features>
<cpu match='exact'>
<model>n270</model>
<feature policy='force' name='x2apic'/>
</cpu>
<clock offset="localtime"/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<vcpu cpuset='0'>1</vcpu>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type='file' device='floppy'>
<driver name='qemu'/>
<source file='/home/lumby/Downloads/win2k_boot.floppage'/>
<target dev='fda' bus='fdc'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu'/>
<source dev='/dev/sdc'/>
<target dev='hda' bus='ide'/>
</disk>
<interface type='network'>
<source network='default'/>
<mac address='52:54:00:97:f6:b9'/>
<model type='pcnet'/>
</interface>
<input type='tablet' bus='usb'/>
<graphics type='vnc' port='5905' keymap='en-us'/>
<console type='pty'/>
<video>
<model type='cirrus'/>
</video>
</devices>
</domain>
[Thu, 22 Jul 2010 19:39:04 virt-install 4709] DEBUG (Guest:1070) Launching console callback
_________________________________________________________________
Look 'em in the eye: FREE Messenger video chat
http://go.microsoft.com/?linkid=9734386
14 years, 3 months
[libvirt] [PATCH] pciSharesBusWithActive fails to find multiple devices on bus
by Chris Wright
The first conditional is always true which means the iterator will
never find another device on the same bus.
if (dev->domain != check->domain ||
dev->bus != check->bus ||
----> (check->slot == check->slot &&
check->function == check->function)) <-----
The goal of that check is to verify that the device is either:
in a different pci domain
on a different bus
is the same identical device
This means libvirt may issue a secondary bus reset when there are devices
on that bus that actively in use by the host or another guest. Not good.
Fix the typo.
Cc: Alex Williamson <alex.williamson(a)redhat.com>
Cc: Don Dutile <ddutile(a)redhat.com>
Cc: Chris Lalancette <clalance(a)redhat.com>
Signed-off-by: Chris Wright <chrisw(a)redhat.com>
---
src/util/pci.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/util/pci.c b/src/util/pci.c
index b2e1673..6d0ca24 100644
--- a/src/util/pci.c
+++ b/src/util/pci.c
@@ -446,10 +446,11 @@ pciSharesBusWithActive(pciDevice *dev, pciDevice *check, void *data)
{
pciDeviceList *activeDevs = data;
+ /* Different domain, different bus, or simply identical device */
if (dev->domain != check->domain ||
dev->bus != check->bus ||
- (check->slot == check->slot &&
- check->function == check->function))
+ (dev->slot == check->slot &&
+ dev->function == check->function))
return 0;
if (activeDevs && !pciDeviceListFind(activeDevs, check))
14 years, 3 months
[libvirt] libvir: Domain error <domName>: invalid argument in virDomainGetXMLDesc
by Priya
All,
I just downloaded and installed *libvirt-bin* and this is my first email to
the group, so I apologize in advance if my questions are too naive!
So, I am trying to access VMs running on* xen3.2 hypervisor* (host with
kernel *2.6.24-24-xen*) using *virt-manager* installed on a machine
running*Ubuntu 9.04
* (client machine). I got to the point where I can connect to my virtual
machine and my domain-0 through the* virt-manager* client (meaning that I
already have *libvirt*,* ssh-askpass* downloaded and the *libvirtd* and *
xend* running on my host machine), and on the client machine I can view the
window showing the statistics of CPU utilization of my domain-0 and user
domain. The attachment shows a shapshot of the *virt-manager* on my client
machine.
Now when I try to access the GUI of either of domain-0 or the user domain
(by selecting the specific domain and clicking open) I get the following
error message in a pop-up on my client and in the libvirtd console on the
host:
"*libvir: Domain error xen_2: invalid argument in virDomainGetXMLDesc*"
I tried to Google this error, but I don't find any clear answers. It
*seems*to be a bug in the
*libvirt* implementation that has been detected and resolved already. And I
am confused as to why is it that such a recent version is still buggy?
Should I have downloded another version instead? I desperately wish to
resolve this problem and would appreciate any guidance.
Many thanks!
--
Priya Bhat
14 years, 3 months
[libvirt] Compiling C++ program with libvirt
by adrian wyssen
Hi everyone
I am trying to compile a C++ program which uses libvirt to connect to an
ESXi host. I got the code running if I wrote it in C, directly in the
hellolibvirt.c example. However, I am now trying to compile that code in a
C++ file which is not inside the example directory.
I tried to compile with the following command:
g++ -g -D debug=1 -c -llibvirt ESXWrapper.cpp
g++ -g -D debug=1 -o ESXWrapper ESXWrapper.o
The first line passes and creates ESXWrapper.o file. But when I run the
second line, it gives me the following error:
---
g++ -g -D debug=1 -c -llibvirt ESXWrapper.cpp
g++ -g -D debug=1 -o ESXWrapper ESXWrapper.o
ESXWrapper.o: In function `VPopCWrapper':
/home/wyssen/school/Dropbox/virtualPOPC-1/NEW/vpopcwrapper/ESXWrapper.cpp:124:
undefined reference to `virConnectOpenAuth'
/home/wyssen/school/Dropbox/virtualPOPC-1/NEW/vpopcwrapper/ESXWrapper.cpp:133:
undefined reference to `virConnectGetURI'
/home/wyssen/school/Dropbox/virtualPOPC-1/NEW/vpopcwrapper/ESXWrapper.cpp:144:
undefined reference to `virConnectClose'
/home/wyssen/school/Dropbox/virtualPOPC-1/NEW/vpopcwrapper/ESXWrapper.cpp:124:
undefined reference to `virConnectOpenAuth'
/home/wyssen/school/Dropbox/virtualPOPC-1/NEW/vpopcwrapper/ESXWrapper.cpp:133:
undefined reference to `virConnectGetURI'
/home/wyssen/school/Dropbox/virtualPOPC-1/NEW/vpopcwrapper/ESXWrapper.cpp:144:
undefined reference to `virConnectClose'
ESXWrapper.o: In function `showError':
/home/wyssen/school/Dropbox/virtualPOPC-1/NEW/vpopcwrapper/ESXWrapper.cpp:186:
undefined reference to `virConnCopyLastError'
/home/wyssen/school/Dropbox/virtualPOPC-1/NEW/vpopcwrapper/ESXWrapper.cpp:202:
undefined reference to `virResetError'
collect2: ld returned 1 exit status
make: *** [all] Error 1
---
My makefile is the follwing:
---
#vars
CC=g++
OUTPUTFILE=ESXWrapper
O_FILES=ESXWrapper.o
FLAGS=-g -D debug=1
.PHONY: all
all: esxwrapper
$(CC) $(FLAGS) -o $(OUTPUTFILE) $(O_FILES)
esxwrapper: ESXWrapper.cpp VPopCWrapper.h
$(CC) $(FLAGS) -c -llibvirt ESXWrapper.cpp
.PHONY: run
run: all
./bignum
.PHONY: clean
clean:
rm -f $(O_FILES)
.PHONY: clean_all
clean_all: clean
rm -f $(OUTPUTFILE)
---
Can anybody give me a hint, how to link correctly to libvirt. And also tell
me, if there are special functions to use with C++, other than the examples
provided in the source code, which are written in C.
Thank you
Adrian
14 years, 3 months
[libvirt] kvm savevm/loadvm
by Serge Hallyn
Hi,
virsh has save/restore to do a one-time save+shutdown. But it
does not expose kvm's savevm/restorevm, which let's me do
incremental snapshots. Is there a specific reason why that
is not exposed in libvirt, or is it just that noone has
implemented it?
thanks,
-serge
14 years, 3 months
[libvirt] [PATCH] lxc: Ensure to kill init process by sending SIGKILL if needed
by Ryota Ozaki
Init process may remain after sending SIGTERM for some reason.
For example, if original init program is used, it is definitely
not killed by SIGTERM.
---
src/lxc/lxc_controller.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 44bcc82..d8b7bc7 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -663,7 +663,11 @@ cleanup:
close(containerPty);
if (container > 1) {
+ int status;
kill(container, SIGTERM);
+ if (!(waitpid(container, &status, WNOHANG) == 0 &&
+ WIFEXITED(status)))
+ kill(container, SIGKILL);
waitpid(container, NULL, 0);
}
return rc;
--
1.6.6.1
14 years, 3 months
[libvirt] [PATCH] Fix incorrect use of private data in remote driver
by Daniel P. Berrange
For upstream bug
https://bugzilla.redhat.com/show_bug.cgi?id=576796
The remote driver is using the wrong privateData field in
a couple of functions. THis is harmless for stateful
drivers like QEMU/UML/LXC, but will crash with Xen
* src/remote/remote_driver.c: Fix use of privateData field
---
src/remote/remote_driver.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 7052bf1..c9129b1 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -4067,7 +4067,7 @@ remoteNetworkIsActive(virNetworkPtr network)
int rv = -1;
remote_network_is_active_args args;
remote_network_is_active_ret ret;
- struct private_data *priv = network->conn->privateData;
+ struct private_data *priv = network->conn->networkPrivateData;
remoteDriverLock(priv);
@@ -4091,7 +4091,7 @@ remoteNetworkIsPersistent(virNetworkPtr network)
int rv = -1;
remote_network_is_persistent_args args;
remote_network_is_persistent_ret ret;
- struct private_data *priv = network->conn->privateData;
+ struct private_data *priv = network->conn->networkPrivateData;
remoteDriverLock(priv);
@@ -4622,7 +4622,7 @@ remoteInterfaceIsActive(virInterfacePtr iface)
int rv = -1;
remote_interface_is_active_args args;
remote_interface_is_active_ret ret;
- struct private_data *priv = iface->conn->privateData;
+ struct private_data *priv = iface->conn->interfacePrivateData;
remoteDriverLock(priv);
@@ -5127,7 +5127,7 @@ remoteStoragePoolIsActive(virStoragePoolPtr pool)
int rv = -1;
remote_storage_pool_is_active_args args;
remote_storage_pool_is_active_ret ret;
- struct private_data *priv = pool->conn->privateData;
+ struct private_data *priv = pool->conn->storagePrivateData;
remoteDriverLock(priv);
@@ -5151,7 +5151,7 @@ remoteStoragePoolIsPersistent(virStoragePoolPtr pool)
int rv = -1;
remote_storage_pool_is_persistent_args args;
remote_storage_pool_is_persistent_ret ret;
- struct private_data *priv = pool->conn->privateData;
+ struct private_data *priv = pool->conn->storagePrivateData;
remoteDriverLock(priv);
--
1.5.5.6
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
14 years, 3 months
[libvirt] [PATCH (v2)] Fix PCI address assignment if no IDE controller is present
by Daniel P. Berrange
The previous patch was flawed because it forgot to take into
account pre-reserved addresses
The PCI slot 1 must be reserved at all times, since PIIX3 is
always present, even if no IDE device is in use for guest disks
* src/qemu/qemu_conf.c: Always reserve slot 1 for PIIX3
---
src/qemu/qemu_conf.c | 22 +++++++++++++++++-----
1 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 23e418b..0f1526d 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -2271,19 +2271,23 @@ int qemuDomainPCIAddressSetNextAddr(qemuDomainPCIAddressSetPtr addrs,
* - VirtIO balloon
* - Host device passthrough
* - Watchdog
+ *
+ * Prior to this function being invoked, qemuCollectPCIAddress() will have
+ * added all existing PCI addresses from the 'def' to 'addrs'. Thus this
+ * function must only try to reserve addresses if info.type == NONE and
+ * skip over info.type == PCI
*/
int
qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs)
{
int i;
+ bool reservedIDE = false;
/* Host bridge */
if (qemuDomainPCIAddressReserveSlot(addrs, 0) < 0)
goto error;
- /* PIIX3 (ISA bridge, IDE controller, something else unknown, USB controller)
- * hardcoded slot=1, multifunction device
- */
+ /* Verify that first IDE controller (if any) is on the PIIX3, fn 1 */
for (i = 0; i < def->ncontrollers ; i++) {
/* First IDE controller lives on the PIIX3 at slot=1, function=1 */
if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_IDE &&
@@ -2297,18 +2301,26 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs)
_("Primary IDE controller must have PCI address 0:0:1.1"));
goto error;
}
+ /* If TYPE==PCI, then then qemuCollectPCIAddress() function
+ * has already reserved the address, so we must skip */
+ reservedIDE = true;
} else {
def->controllers[i]->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
def->controllers[i]->info.addr.pci.domain = 0;
def->controllers[i]->info.addr.pci.bus = 0;
def->controllers[i]->info.addr.pci.slot = 1;
def->controllers[i]->info.addr.pci.function = 1;
- if (qemuDomainPCIAddressReserveSlot(addrs, 1) < 0)
- goto error;
}
}
}
+ /* PIIX3 (ISA bridge, IDE controller, something else unknown, USB controller)
+ * hardcoded slot=1, multifunction device
+ */
+ if (!reservedIDE &&
+ qemuDomainPCIAddressReserveSlot(addrs, 1) < 0)
+ goto error;
+
/* First VGA is hardcoded slot=2 */
if (def->nvideos > 0) {
if (def->videos[0]->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
--
1.7.1.1
14 years, 3 months