[libvirt] [PATCH] Use sockpeercred on OpenBSD.
by Jasper Lievisse Adriaanse
>From 0f352c0577f76a64924636a8c9ba72de5862b6d6 Mon Sep 17 00:00:00 2001
From: Jasper Lievisse Adriaanse <jasper(a)humppa.nl>
Date: Tue, 4 Sep 2012 16:59:55 +0200
Subject: [PATCH] Use sockpeercred on OpenBSD.
---
src/rpc/virnetsocket.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 5a48300..27ead13 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -988,7 +988,11 @@ int virNetSocketGetUNIXIdentity(virNetSocketPtr sock,
gid_t *gid,
pid_t *pid)
{
+#if defined (__OpenBSD__)
+ struct sockpeercred cr;
+#else
struct ucred cr;
+#endif
socklen_t cr_len = sizeof(cr);
virMutexLock(&sock->lock);
--
1.7.6
12 years, 2 months
[libvirt] [PATCH] Rename iolimit to blockio.
by Viktor Mihajlovski
After discussion with DB we decided to rename the new iolimit
element as it creates the impression it would be there to
limit (i.e. throttle) I/O instead of specifying immutable
characteristics of a block device.
This is also backed by the fact that the term I/O Limits has
vanished from newer storage admin documentation.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
docs/formatdomain.html.in | 6 ++--
docs/schemas/domaincommon.rng | 6 ++--
src/conf/domain_conf.c | 30 +++++++++---------
src/conf/domain_conf.h | 2 +-
src/qemu/qemu_capabilities.c | 4 +-
src/qemu/qemu_capabilities.h | 2 +-
src/qemu/qemu_command.c | 10 +++---
tests/qemuhelptest.c | 8 ++--
.../qemuxml2argv-disk-blockio.args | 9 +++++
.../qemuxml2argvdata/qemuxml2argv-disk-blockio.xml | 33 ++++++++++++++++++++
.../qemuxml2argv-disk-iolimits.args | 9 -----
.../qemuxml2argv-disk-iolimits.xml | 33 --------------------
tests/qemuxml2argvtest.c | 4 +-
13 files changed, 78 insertions(+), 78 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.xml
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 5cb5a56..503685f 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1288,7 +1288,7 @@
<driver name='qemu' type='raw'/>
<source dev='/dev/sda'/>
<geometry cyls='16383' heads='16' secs='63' trans='lba'/>
- <iolimits logical_block_size='512' physical_block_size='4096'/>
+ <blockio logical_block_size='512' physical_block_size='4096'/>
<target dev='hda' bus='ide'/>
</disk>
</devices>
@@ -1657,8 +1657,8 @@
BIOS-Translation-Modus (none, lba or auto)</dd>
</dl>
</dd>
- <dt><code>iolimits</code></dt>
- <dd>If present, the <code>iolimits</code> element allows
+ <dt><code>blockio</code></dt>
+ <dd>If present, the <code>blockio</code> element allows
to override any of the block device properties listed below.
<span class="since">Since 0.10.2 (QEMU and KVM)</span>
<dl>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index abd0e8f..c2c6184 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -890,7 +890,7 @@
<ref name="geometry"/>
</optional>
<optional>
- <ref name="diskIoLimits"/>
+ <ref name="diskBlockIo"/>
</optional>
</interleave>
</define>
@@ -1116,8 +1116,8 @@
</optional>
</element>
</define>
- <define name="diskIoLimits">
- <element name="iolimits">
+ <define name="diskBlockIo">
+ <element name="blockio">
<optional>
<attribute name="logical_block_size">
<data type="integer"/>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index c34a0a8..8952b69 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3439,8 +3439,8 @@ virDomainDiskDefParseXML(virCapsPtr caps,
def->geometry.sectors = 0;
def->geometry.trans = VIR_DOMAIN_DISK_TRANS_DEFAULT;
- def->iolimits.logical_block_size = 0;
- def->iolimits.physical_block_size = 0;
+ def->blockio.logical_block_size = 0;
+ def->blockio.physical_block_size = 0;
ctxt->node = node;
@@ -3580,12 +3580,12 @@ virDomainDiskDefParseXML(virCapsPtr caps,
goto error;
}
}
- } else if (xmlStrEqual(cur->name, BAD_CAST "iolimits")) {
+ } else if (xmlStrEqual(cur->name, BAD_CAST "blockio")) {
logical_block_size =
virXMLPropString(cur, "logical_block_size");
if (logical_block_size &&
virStrToLong_ui(logical_block_size, NULL, 0,
- &def->iolimits.logical_block_size) < 0) {
+ &def->blockio.logical_block_size) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("invalid logical block size '%s'"),
logical_block_size);
@@ -3595,7 +3595,7 @@ virDomainDiskDefParseXML(virCapsPtr caps,
virXMLPropString(cur, "physical_block_size");
if (physical_block_size &&
virStrToLong_ui(physical_block_size, NULL, 0,
- &def->iolimits.physical_block_size) < 0) {
+ &def->blockio.physical_block_size) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("invalid physical block size '%s'"),
physical_block_size);
@@ -11406,21 +11406,21 @@ static void virDomainDiskGeometryDefFormat(virBufferPtr buf,
virBufferAddLit(buf, "/>\n");
}
}
-static void virDomainDiskIolimitsDefFormat(virBufferPtr buf,
- virDomainDiskDefPtr def)
+static void virDomainDiskBlockIoDefFormat(virBufferPtr buf,
+ virDomainDiskDefPtr def)
{
- if (def->iolimits.logical_block_size > 0 ||
- def->iolimits.physical_block_size > 0) {
- virBufferAddLit(buf," <iolimits");
- if (def->iolimits.logical_block_size > 0) {
+ if (def->blockio.logical_block_size > 0 ||
+ def->blockio.physical_block_size > 0) {
+ virBufferAddLit(buf," <blockio");
+ if (def->blockio.logical_block_size > 0) {
virBufferAsprintf(buf,
" logical_block_size='%u'",
- def->iolimits.logical_block_size);
+ def->blockio.logical_block_size);
}
- if (def->iolimits.physical_block_size > 0) {
+ if (def->blockio.physical_block_size > 0) {
virBufferAsprintf(buf,
" physical_block_size='%u'",
- def->iolimits.physical_block_size);
+ def->blockio.physical_block_size);
}
virBufferAddLit(buf, "/>\n");
}
@@ -11599,7 +11599,7 @@ virDomainDiskDefFormat(virBufferPtr buf,
}
virDomainDiskGeometryDefFormat(buf, def);
- virDomainDiskIolimitsDefFormat(buf, def);
+ virDomainDiskBlockIoDefFormat(buf, def);
/* For now, mirroring is currently output-only: we only output it
* for live domains, therefore we ignore it on input except for
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index f9f4865..3995c2d 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -572,7 +572,7 @@ struct _virDomainDiskDef {
struct {
unsigned int logical_block_size;
unsigned int physical_block_size;
- } iolimits;
+ } blockio;
virDomainBlockIoTuneInfo blkdeviotune;
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 2ba7956..ed85b6f 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -172,7 +172,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
"bridge", /* 100 */
"lsi",
"virtio-scsi-pci",
- "iolimits",
+ "blockio",
"disable-s3",
"disable-s4", /* 105 */
@@ -1512,7 +1512,7 @@ qemuCapsParseDeviceStr(const char *str, virBitmapPtr flags)
*/
if (strstr(str, ".logical_block_size") &&
strstr(str, ".physical_block_size"))
- qemuCapsSet(flags, QEMU_CAPS_IOLIMITS);
+ qemuCapsSet(flags, QEMU_CAPS_BLOCKIO);
if (strstr(str, "PIIX4_PM.disable_s3="))
qemuCapsSet(flags, QEMU_CAPS_DISABLE_S3);
if (strstr(str, "PIIX4_PM.disable_s4="))
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index a7b3a06..49d64e5 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -138,7 +138,7 @@ enum qemuCapsFlags {
QEMU_CAPS_NETDEV_BRIDGE = 100, /* bridge helper support */
QEMU_CAPS_SCSI_LSI = 101, /* -device lsi */
QEMU_CAPS_VIRTIO_SCSI_PCI = 102, /* -device virtio-scsi-pci */
- QEMU_CAPS_IOLIMITS = 103, /* -device ...logical_block_size & co */
+ QEMU_CAPS_BLOCKIO = 103, /* -device ...logical_block_size & co */
QEMU_CAPS_DISABLE_S3 = 104, /* S3 BIOS Advertisement on/off */
QEMU_CAPS_DISABLE_S4 = 105, /* S4 BIOS Advertisement on/off */
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index e739f34..a83d6de 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2637,13 +2637,13 @@ qemuBuildDriveDevStr(virDomainDefPtr def,
virBufferAsprintf(&opt, ",id=%s", disk->info.alias);
if (bootindex && qemuCapsGet(qemuCaps, QEMU_CAPS_BOOTINDEX))
virBufferAsprintf(&opt, ",bootindex=%d", bootindex);
- if (qemuCapsGet(qemuCaps, QEMU_CAPS_IOLIMITS)) {
- if (disk->iolimits.logical_block_size > 0)
+ if (qemuCapsGet(qemuCaps, QEMU_CAPS_BLOCKIO)) {
+ if (disk->blockio.logical_block_size > 0)
virBufferAsprintf(&opt, ",logical_block_size=%u",
- disk->iolimits.logical_block_size);
- if (disk->iolimits.physical_block_size > 0)
+ disk->blockio.logical_block_size);
+ if (disk->blockio.physical_block_size > 0)
virBufferAsprintf(&opt, ",physical_block_size=%u",
- disk->iolimits.physical_block_size);
+ disk->blockio.physical_block_size);
}
if (virBufferError(&opt)) {
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index a391edd..0d884f4 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -541,7 +541,7 @@ mymain(void)
QEMU_CAPS_VIRTIO_BLK_SCSI,
QEMU_CAPS_VIRTIO_BLK_SG_IO,
QEMU_CAPS_CPU_HOST,
- QEMU_CAPS_IOLIMITS);
+ QEMU_CAPS_BLOCKIO);
DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -609,7 +609,7 @@ mymain(void)
QEMU_CAPS_DRIVE_COPY_ON_READ,
QEMU_CAPS_CPU_HOST,
QEMU_CAPS_SCSI_CD,
- QEMU_CAPS_IOLIMITS);
+ QEMU_CAPS_BLOCKIO);
DO_TEST("qemu-1.0", 1000000, 0, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -682,7 +682,7 @@ mymain(void)
QEMU_CAPS_SCSI_CD,
QEMU_CAPS_IDE_CD,
QEMU_CAPS_SCSI_LSI,
- QEMU_CAPS_IOLIMITS);
+ QEMU_CAPS_BLOCKIO);
DO_TEST("qemu-1.1.0", 1001000, 0, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -763,7 +763,7 @@ mymain(void)
QEMU_CAPS_NETDEV_BRIDGE,
QEMU_CAPS_SCSI_LSI,
QEMU_CAPS_VIRTIO_SCSI_PCI,
- QEMU_CAPS_IOLIMITS);
+ QEMU_CAPS_BLOCKIO);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args
new file mode 100644
index 0000000..5fb1367
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args
@@ -0,0 +1,9 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \
+-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-ide0-0-1 \
+-device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
+-drive file=/tmp/idedisk.img,if=none,id=drive-ide0-0-2 \
+-device ide-hd,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2,\
+logical_block_size=512,physical_block_size=512 \
+-usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.xml
new file mode 100644
index 0000000..52c9704
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.xml
@@ -0,0 +1,33 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>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='cdrom'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='1'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <source file='/tmp/idedisk.img'/>
+ <target dev='hdc' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='2'/>
+ <blockio logical_block_size='512' physical_block_size='512'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <controller type='ide' index='1'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args
deleted file mode 100644
index 5fb1367..0000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args
+++ /dev/null
@@ -1,9 +0,0 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \
-/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults \
--monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \
--drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-ide0-0-1 \
--device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
--drive file=/tmp/idedisk.img,if=none,id=drive-ide0-0-2 \
--device ide-hd,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2,\
-logical_block_size=512,physical_block_size=512 \
--usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml
deleted file mode 100644
index 440984b..0000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<domain type='qemu'>
- <name>QEMUGuest1</name>
- <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
- <memory unit='KiB'>219136</memory>
- <currentMemory unit='KiB'>219136</currentMemory>
- <vcpu placement='static'>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='cdrom'>
- <source dev='/dev/HostVG/QEMUGuest1'/>
- <target dev='hda' bus='ide'/>
- <address type='drive' controller='0' bus='0' target='0' unit='1'/>
- </disk>
- <disk type='file' device='disk'>
- <source file='/tmp/idedisk.img'/>
- <target dev='hdc' bus='ide'/>
- <address type='drive' controller='0' bus='0' target='0' unit='2'/>
- <iolimits logical_block_size='512' physical_block_size='512'/>
- </disk>
- <controller type='usb' index='0'/>
- <controller type='ide' index='0'/>
- <controller type='ide' index='1'/>
- <memballoon model='virtio'/>
- </devices>
-</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index c655957..47c3f6c 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -793,9 +793,9 @@ mymain(void)
QEMU_CAPS_IDE_CD);
DO_TEST("disk-geometry", QEMU_CAPS_DRIVE);
- DO_TEST("disk-iolimits",
+ DO_TEST("disk-blockio",
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_IDE_CD, QEMU_CAPS_IOLIMITS);
+ QEMU_CAPS_IDE_CD, QEMU_CAPS_BLOCKIO);
VIR_FREE(driver.stateDir);
virCapabilitiesFree(driver.caps);
--
1.7.0.4
12 years, 2 months
[libvirt] [PATCH] qemu: Do not require auth scheme in graphics events
by Jiri Denemark
Only VNC_{{DIS,}CONNECTED,INITIALIZED} and SPICE_INITIALIZED events are
documented to support server/auth field and even there it is marked as
optional. Emit "" auth scheme in case QEMU didn't send it.
---
src/qemu/qemu_monitor_json.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 643431c..bab6ca2 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -685,8 +685,9 @@ static void qemuMonitorJSONHandleGraphics(qemuMonitorPtr mon, virJSONValuePtr da
authScheme = virJSONValueObjectGetString(server, "auth");
if (!authScheme) {
- VIR_WARN("missing auth scheme in graphics event");
- return;
+ /* not all events are required to contain auth scheme */
+ VIR_DEBUG("missing auth scheme in graphics event");
+ authScheme = "";
}
localFamily = virJSONValueObjectGetString(server, "family");
--
1.7.12
12 years, 2 months
[libvirt] Fwd: Compiling a simple code which include libvirt
by Rahul Bansal
I ran 'sudo make install' in /path/to/libvirt. But same error is coming.
Maybe following will be helpful:
-> I extracted the libvirt.0.10.1 in ~/Downloads
-> And I am running the code in ~/Downloads/libvirt-0.10.1
-> I ran 'sudo make install' in the above directory.
On 2 September 2012 16:24, Michal Privoznik <mprivozn(a)redhat.com> wrote:
> On 02.09.2012 09:53, Rahul Bansal wrote:
> > /* example ex1.c */
> > /* compile with: gcc -g -Wall ex1.c -o ex -lvirt */
> > #include <stdio.h>
> > #include <stdlib.h>
> > #include "include/libvirt/libvirt.h"
>
> since you are including this path assume you use
> -I/path/to/libvirt/source and don't have libvirt installed in your
> system. Hence you need to provide linker the path where it will find the
> library:
> gcc -I/path/to/libvirt -L/path/to/libvirt/src -lvirt ex1.c -o ex1
>
> or just install libvirt ('sudo make install' in /path/to/libvirt) and
> then you can drop both -I and -L arguments.
>
> > int main(int argc, char *argv[])
> > {
> > virConnectPtr conn;
> > conn = virConnectOpen("qemu:///system");
> > if (conn == NULL) {
> > fprintf(stderr, "Failed to open connection to qemu:///system\n");
> > return 1;
> > }
> > virConnectClose(conn);
> > return 0;
> > }
>
>
12 years, 2 months
[libvirt] [PATCH 00/45 v3] Atomic APIs to list objects
by Osier Yang
v3 - v4:
* Except a few patches are pushed, it's just rebasing on the top
v2 - v3:
* Various document fixes/improvements (Suggested by Laine and Eric)
* Destroy virdomainlist.[ch], and folder all list helper funcs
into its own *_conf.[ch]
* Improve the helpers to get the object list. See
https://www.redhat.com/archives/libvir-list/2012-July/msg01267.html
* Rebased on top of commit 3df9626 by Peter and the virReportError
series by Daniel.
* Rebased on top of virsh split series. (I'm luck there is no
change on those commands since v2).
Except the already supported APIs for domain and domain snapshot,
this series add the APIs for the left objects, including storage
pool, storage vol, network, interface, node device, nwfilter, and
secret.
* Storage pool:
- Support filtering the returned pool objects by active|inactive,
persistent|transient, autostart|no-autostart, and pool types.
- New options for virsh, --type to accept multiple pool types.
* Storage vol:
- Simply returns all the vol objects of a pool.
* Network:
- Support filtering the results using flags active|inactive,
persistent|transient, autostart|no-autostart
- New options for virsh.
* Interface:
- Support filtering the results using flags active|inactive.
It's still O(n) underlying, as interface driver doesn't manage
the objects itself, but using netcf lib instead. And netcf
APIs don't support returning the struct yet.
* Node Device:
- Support filtering the results using capabilities type of
the devices.
- Extend --cap to accept multiple capability type.
* Network Filter:
- Simply returns all the objects.
* Secret:
- Simply returns all the objects.
Osier Yang (45):
list: Define new API virStorageListAllStoragePools
list: Add helpers for listing storage pool objects
list: Implement the RPC calls for virConnectListAllStoragePools
list: Implement listAllStoragePools for storage driver
list: Implement listAllStoragePools for test driver
list: Add helper to convert strings separated by ', ' to array
virsh: Fix the wrong doc for pool-list
list: Change MATCH for common use in virsh
list: Use virConnectListAllStoragePools in virsh
python: Expose virStorageListAllStoragePools to python binding
list: Define new API virStoragePoolListAllVolumes
list: Implemente RPC calls for virStoragePoolListAllVolumes
list: Implement virStoragePoolListAllVolumes for storage driver
list: Implement virStoragePoolListAllVolumes for test driver
list: Use virStoragePoolListAllVolumes in virsh
list: Expose virStoragePoolListAllVolumes to Python binding
list: Define new API virConnectListAllNetworks
list: Implement RPC calls for virConnectListAllNetworks
list: Add helpers to list network objects
list: Implement listAllNetworks for network driver
list: Implement listAllNetworks for test driver
list: Use virConnectListAllNetworks in virsh
list: Expose virConnectListAllNetworks to Python binding
list: Define new API virConnectListAllInterfaces
list: Implemente RPC calls for virConnectListAllInterfaces
list: Implement listAllInterfaces
list: Use virConnectListAllInterfaces in virsh
list: Expose virConnectListAllInterfaces to Python binding
list: Define new API virConnectListAllNodeDevices
list: Implemente RPC calls for virConnectListAllNodeDevices
list: Add helpers for listing node devices
list: Implement listAllNodeDevices
list: Expose virConnectListAllNodeDevices to Python binding
virsh: Fix a bug of nodedev-list
list: Use virConnectListAllNodeDevices in virsh
list: Define new API virConnectListAllNWFilters
list: Implement RPC calls for virConnectListAllNWFilters
list: Implement listAllNWFilters
list: Use virConnectListAllNWFilters in virsh
list: Expose virConnectListAllNWFilters to Python binding
list: Define new API virConnectListAllSecrets
list: Implement RPC calls for virConnectListAllSecrets
list: Implement listAllSecrets
list: Use virConnectListAllSecrets in virsh
list: Expose virConnectListAllSecrets to Python binding
daemon/remote.c | 382 ++++++++++++++++++++++
include/libvirt/libvirt.h.in | 101 ++++++-
python/generator.py | 11 +-
python/libvirt-override-api.xml | 44 +++-
python/libvirt-override-virConnect.py | 72 +++++
python/libvirt-override-virStoragePool.py | 11 +
python/libvirt-override.c | 337 ++++++++++++++++++++
src/conf/network_conf.c | 91 ++++++
src/conf/network_conf.h | 22 ++
src/conf/node_device_conf.c | 103 ++++++
src/conf/node_device_conf.h | 16 +
src/conf/storage_conf.c | 116 +++++++
src/conf/storage_conf.h | 35 ++
src/driver.h | 35 ++-
src/interface/netcf_driver.c | 135 ++++++++
src/libvirt.c | 487 ++++++++++++++++++++++++++++-
src/libvirt_private.syms | 4 +
src/libvirt_public.syms | 7 +
src/network/bridge_driver.c | 17 +
src/node_device/node_device_driver.c | 15 +
src/node_device/node_device_driver.h | 3 +
src/node_device/node_device_hal.c | 1 +
src/node_device/node_device_udev.c | 1 +
src/nwfilter/nwfilter_driver.c | 56 ++++
src/remote/remote_driver.c | 449 ++++++++++++++++++++++++++
src/remote/remote_protocol.x | 80 +++++-
src/remote_protocol-structs | 85 +++++
src/secret/secret_driver.c | 59 ++++-
src/storage/storage_driver.c | 85 +++++
src/test/test_driver.c | 101 ++++++
tools/virsh-domain-monitor.c | 2 -
tools/virsh-domain.c | 19 +-
tools/virsh-interface.c | 259 +++++++++++-----
tools/virsh-network.c | 351 ++++++++++++++++-----
tools/virsh-nodedev.c | 302 ++++++++++++++++---
tools/virsh-nwfilter.c | 163 ++++++++--
tools/virsh-pool.c | 441 ++++++++++++++++++++------
tools/virsh-secret.c | 182 +++++++++--
tools/virsh-volume.c | 197 +++++++++---
tools/virsh.c | 56 +++-
tools/virsh.pod | 51 +++-
41 files changed, 4521 insertions(+), 463 deletions(-)
create mode 100644 python/libvirt-override-virStoragePool.py
--
1.7.7.3
12 years, 2 months
[libvirt] [PATCH 0/2] Add range checking for scheduler tunables
by Peter Krempa
Peter Krempa (2):
qemu: clean up qemuSetSchedulerParametersFlags()
qemu: Add range checking for scheduler tunables
src/qemu/qemu_driver.c | 96 ++++++++++++++++++++++++++++++--------------------
1 file changed, 58 insertions(+), 38 deletions(-)
--
1.7.12
12 years, 2 months
[libvirt] [PATCH] qemu: Fix reboot with guest agent
by Jiri Denemark
When reboot using qemu guest agent was requested, qemu driver kept
waiting for SHUTDOWN event from qemu. However, such event is never
emitted during guest reboot and qemu driver would keep waiting forever.
---
src/qemu/qemu_agent.c | 5 ++++-
src/qemu/qemu_agent.h | 3 ++-
src/qemu/qemu_process.c | 6 ++++++
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index 51e60d2..804c424 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -1294,7 +1294,10 @@ int qemuAgentShutdown(qemuAgentPtr mon,
if (!cmd)
return -1;
- mon->await_event = QEMU_AGENT_EVENT_SHUTDOWN;
+ if (mode == QEMU_AGENT_SHUTDOWN_REBOOT)
+ mon->await_event = QEMU_AGENT_EVENT_RESET;
+ else
+ mon->await_event = QEMU_AGENT_EVENT_SHUTDOWN;
ret = qemuAgentCommand(mon, cmd, &reply,
VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK);
diff --git a/src/qemu/qemu_agent.h b/src/qemu/qemu_agent.h
index 528fee1..18740ba 100644
--- a/src/qemu/qemu_agent.h
+++ b/src/qemu/qemu_agent.h
@@ -55,7 +55,8 @@ void qemuAgentClose(qemuAgentPtr mon);
typedef enum {
QEMU_AGENT_EVENT_NONE = 0,
QEMU_AGENT_EVENT_SHUTDOWN,
- QEMU_AGENT_EVENT_SUSPEND
+ QEMU_AGENT_EVENT_SUSPEND,
+ QEMU_AGENT_EVENT_RESET,
} qemuAgentEvent;
void qemuAgentNotifyEvent(qemuAgentPtr mon,
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 5c3b89e..93653c6 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -511,9 +511,15 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
{
struct qemud_driver *driver = qemu_driver;
virDomainEventPtr event;
+ qemuDomainObjPrivatePtr priv;
virDomainObjLock(vm);
+
event = virDomainEventRebootNewFromObj(vm);
+ priv = vm->privateData;
+ if (priv->agent)
+ qemuAgentNotifyEvent(priv->agent, QEMU_AGENT_EVENT_RESET);
+
virDomainObjUnlock(vm);
if (event) {
--
1.7.12
12 years, 2 months
[libvirt] None seclabel question
by Marcelo Cerri
Hi,
I was discussing with Jiri Denemark about the current behavior of none
seclabels with multiple security drivers and I'd like to hear more
opinions about how this should work.
Currently, a none security label can be defined specifically to each
enabled security driver. For example, using a default configuration (in
which SELinux is enabled as default driver and DAC is enabled due to
privileged mode), a guest definition can contain the following seclabel:
<seclabel type='none' model='selinux'/>
This will disable SELinux labeling and will keep labeling enabled for
any other security drivers (DAC in this case).
So, my question is: should none seclabels affect specific drivers (as
done now) or just one none seclabel should be accepted affecting all
security drivers in use?
Regards,
Marcelo
12 years, 2 months
[libvirt] [PATCH 0/2] Support for Block Device IO Limits
by Viktor Mihajlovski
Depending on the hypervisor (e.g. QEMU) it is possible to override
certain properties of a block device. In Linux these are called
IO limits and can be observed in the guest's sysfs under
/sys/block/<dev>/queue.
This patch set enables libvirt to override the logical and physical
block size for QEMU guests.
I wasn't expecting the 0.10.1 release *that* early, so I have added
the since 0.10.1 in formatdomain.html.in :-) calling for a v2 patch.
Still I wanted to collect review feedback.
Viktor Mihajlovski (2):
conf: Support for Block Device IO Limits
qemu: Support for Block Device IO Limits.
docs/formatdomain.html.in | 18 +++++++
docs/schemas/domaincommon.rng | 17 +++++++
src/conf/domain_conf.c | 49 ++++++++++++++++++++
src/conf/domain_conf.h | 5 ++
src/qemu/qemu_capabilities.c | 11 ++++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 8 +++
tests/qemuhelptest.c | 12 +++--
.../qemuxml2argv-disk-iolimits.args | 9 ++++
.../qemuxml2argv-disk-iolimits.xml | 33 +++++++++++++
tests/qemuxml2argvtest.c | 3 +
11 files changed, 162 insertions(+), 4 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml
12 years, 2 months