[libvirt] [libvirt-glib 1/2] Fix gvir_config_domain_disk_set_target_bus API
by Christophe Fergeau
The bus type is actually an enum, let's reflect that in
libvirt-gconfig API
---
libvirt-gconfig/libvirt-gconfig-domain-disk.c | 8 ++++++--
libvirt-gconfig/libvirt-gconfig-domain-disk.h | 13 ++++++++++++-
libvirt-gconfig/libvirt-gconfig.sym | 1 +
libvirt-gconfig/tests/test-domain-create.c | 2 +-
4 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-disk.c b/libvirt-gconfig/libvirt-gconfig-domain-disk.c
index 502cf43..b52f4a5 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-disk.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-disk.c
@@ -159,14 +159,18 @@ void gvir_config_domain_disk_set_driver_type(GVirConfigDomainDisk *disk,
}
void gvir_config_domain_disk_set_target_bus(GVirConfigDomainDisk *disk,
- const char *bus)
+ GVirConfigDomainDiskBus bus)
{
GVirConfigObject *node;
g_return_if_fail(GVIR_IS_CONFIG_DOMAIN_DISK(disk));
node = gvir_config_object_add_child(GVIR_CONFIG_OBJECT(disk), "target");
g_return_if_fail(GVIR_IS_CONFIG_OBJECT(node));
- gvir_config_object_set_attribute(node, "bus", bus, NULL);
+ gvir_config_object_set_attribute_with_type(node,
+ "bus",
+ GVIR_TYPE_CONFIG_DOMAIN_DISK_BUS,
+ bus,
+ NULL);
g_object_unref(G_OBJECT(node));
}
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-disk.h b/libvirt-gconfig/libvirt-gconfig-domain-disk.h
index b90b2bc..bc63dfe 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-disk.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-disk.h
@@ -64,6 +64,17 @@ typedef enum {
} GVirConfigDomainDiskType;
typedef enum {
+ GVIR_CONFIG_DOMAIN_DISK_BUS_IDE,
+ GVIR_CONFIG_DOMAIN_DISK_BUS_FDC,
+ GVIR_CONFIG_DOMAIN_DISK_BUS_SCSI,
+ GVIR_CONFIG_DOMAIN_DISK_BUS_VIRTIO,
+ GVIR_CONFIG_DOMAIN_DISK_BUS_XEN,
+ GVIR_CONFIG_DOMAIN_DISK_BUS_USB,
+ GVIR_CONFIG_DOMAIN_DISK_BUS_UML,
+ GVIR_CONFIG_DOMAIN_DISK_BUS_SATA
+} GVirConfigDomainDiskBus;
+
+typedef enum {
GVIR_CONFIG_DOMAIN_DISK_GUEST_DEVICE_DISK,
GVIR_CONFIG_DOMAIN_DISK_GUEST_DEVICE_FLOPPY,
GVIR_CONFIG_DOMAIN_DISK_GUEST_DEVICE_CDROM
@@ -94,7 +105,7 @@ void gvir_config_domain_disk_set_driver_name(GVirConfigDomainDisk *disk,
void gvir_config_domain_disk_set_driver_type(GVirConfigDomainDisk *disk,
const char *driver_type);
void gvir_config_domain_disk_set_target_bus(GVirConfigDomainDisk *disk,
- const char *bus);
+ GVirConfigDomainDiskBus bus);
void gvir_config_domain_disk_set_target_dev(GVirConfigDomainDisk *disk,
const char *dev);
G_END_DECLS
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index 6adc2c2..d0c35d2 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -54,6 +54,7 @@ LIBVIRT_GCONFIG_0.0.1 {
gvir_config_domain_device_get_type;
gvir_config_domain_disk_get_type;
+ gvir_config_domain_disk_bus_get_type;
gvir_config_domain_disk_guest_device_type_get_type;
gvir_config_domain_disk_snapshot_type_get_type;
gvir_config_domain_disk_type_get_type;
diff --git a/libvirt-gconfig/tests/test-domain-create.c b/libvirt-gconfig/tests/test-domain-create.c
index 42aa09b..ea3a3ea 100644
--- a/libvirt-gconfig/tests/test-domain-create.c
+++ b/libvirt-gconfig/tests/test-domain-create.c
@@ -100,7 +100,7 @@ int main(void)
gvir_config_domain_disk_set_source(disk, "/tmp/foo/bar");
gvir_config_domain_disk_set_driver_name(disk, "qemu");
gvir_config_domain_disk_set_driver_type(disk, "qcow2");
- gvir_config_domain_disk_set_target_bus(disk, "ide");
+ gvir_config_domain_disk_set_target_bus(disk, GVIR_CONFIG_DOMAIN_DISK_BUS_IDE);
gvir_config_domain_disk_set_target_dev(disk, "hda");
devices = g_list_append(devices, GVIR_CONFIG_DOMAIN_DEVICE(disk));
--
1.7.7.3
13 years
[libvirt] Expand GVirConfigDomainInterface a bit
by Christophe Fergeau
Hi,
This patch series add setters for the GVirConfigDomainInterface properties which
are common to all classes deriving from GVirConfigDomainInterface. It also adds
GVirConfigDomainInterfaceUser so that it's possible to create <interface
type="user"> nodes.
Christophe
13 years
[libvirt] [PATCH] virsh: Free returned MIME type string
by Michal Privoznik
In terms of documentation to virDomainScreenshot, caller MUST free
returned value. But virsh was not.
---
Pushing under trivial rule.
tools/virsh.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index d859b3a..d58b827 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -3097,6 +3097,7 @@ cleanup:
if (st)
virStreamFree(st);
VIR_FORCE_CLOSE(fd);
+ VIR_FREE(mime);
return ret;
}
--
1.7.3.4
13 years
[libvirt] [PATCH] storage: Activate/deactivate logical volumes only on local node
by Osier Yang
From: Rommer <rommer(a)active.by>
Current "-ay | -an" has problems on pool starting/refreshing if
the volumes are clustered. Rommer has posted a patch to list 2
months ago.
https://www.redhat.com/archives/libvir-list/2011-October/msg01116.html
But IMO we shouldn't skip the inactived vols. So this is a squashed
patch by Rommer.
Signed-off-by: Rommer <rommer(a)active.by>
---
src/storage/storage_backend_logical.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
index 1420ede..6a235f6 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -51,7 +51,7 @@ virStorageBackendLogicalSetActive(virStoragePoolObjPtr pool,
const char *cmdargv[4];
cmdargv[0] = VGCHANGE;
- cmdargv[1] = on ? "-ay" : "-an";
+ cmdargv[1] = on ? "-aly" : "-aln";
cmdargv[2] = pool->def->source.name;
cmdargv[3] = NULL;
--
1.7.1
13 years
[libvirt] [PATCH v2 0/4] Interface pools and passthrough mode
by Shradha Shah
Interface Pools and Passthrough mode:
Current Method:
The passthrough mode uses a macvtap direct connection to connect each guest to the network. The physical interface to be used is picked from among those listed in <interface> sub elements of the <forward> element.
The current specification for <forward> extends to allow 0 or more <interface> sub-elements:
Example:
<forward mode='passthrough' dev='eth10'/>
<interface dev='eth10'/>
<interface dev='eth12'/>
<interface dev='eth18'/>
<interface dev='eth20'/>
</forward>
However with an ethernet card with 64 VF's or more, the above method gets tedious on the system.
On the other hand, just parameterizing a string (eth%d) is inadequate, eg, when there are multiple non-contiguous ranges.
Proposed Method:
The 4 patches provided:
i) Introduce a new element 'pf' to implicitly create an interface pool of all the Virtual Functions attached to the specified Physical Function.
ii) Modify the networkAllocateActualDevice, networkNotifyActualDevice and networkReleaseActualDevice API to use the above mentioned interface pool in the passthrough mode.
Hence Libvirt will now support both the methods mentioned below:
* Explicit interface list. App inputs:
<forward mode='passthrough'>
<interface dev='eth10'/>
<interface dev='eth11'/>
<interface dev='eth12'/>
<interface dev='eth13'/>
</forward>
libvirt does not change XML
* Automatically interface list from PF. App inputs:
<forward mode='passthrough'>
<pf dev='eth0'/>
</forward>
libvirt expands XML to be
<forward mode='passthrough'>
<pf dev='eth0'/>
<interface dev='eth10'/>
<interface dev='eth11'/>
<interface dev='eth12'/>
<interface dev='eth13'/>
</forward>
In the above case we need to differentiate between the implicit and explicit interface pool, which can be done by comparing the dumpxml from active and inactive domains.
This will need the addition of the flag VIR_NETWORK_XML_INACTIVE to virNetworkGetXMLDesc() as mentioned in a previous suggestion.
I will post this as a separate patch series.
Shradha Shah (4):
Added function pciSysfsFile to enable access to the PCI SYSFS files.
Added Function virNetDevGetVirtualFunctions
Adding the element pf to network xml.
Functionality to implicitly get interface pool from SR-IOV PF.
docs/schemas/network.rng | 7 +++
src/conf/network_conf.c | 69 ++++++++++++++++++++++++++++++--
src/conf/network_conf.h | 3 +
src/network/bridge_driver.c | 93 +++++++++++++++++++++++++++++++++---------
src/util/pci.c | 39 ++++++++++++++++++
src/util/pci.h | 7 +++
src/util/virnetdev.c | 83 ++++++++++++++++++++++++++++++++++++++
src/util/virnetdev.h | 6 +++
8 files changed, 283 insertions(+), 24 deletions(-)
--
1.7.4.4
13 years
[libvirt] [PATCH] security: don't try to label network disks
by Josh Durgin
Network disks don't have paths to be resolved or files to be checked
for ownership. ee3efc41e6233e625aa03003bf3127319ccd546f checked this
for some image label functions, but was partially reverted in a
refactor. This finishes adding the check to each security driver's
set and restore label methods for images.
Signed-off-by: Josh Durgin <josh.durgin(a)dreamhost.com>
---
src/security/security_apparmor.c | 3 +++
src/security/security_dac.c | 6 ++++++
src/security/security_selinux.c | 3 +++
3 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index db7e7dc..3a01a21 100644
--- a/src/security/security_apparmor.c
+++ b/src/security/security_apparmor.c
@@ -606,6 +606,9 @@ AppArmorRestoreSecurityImageLabel(virSecurityManagerPtr mgr,
virDomainObjPtr vm,
virDomainDiskDefPtr disk ATTRIBUTE_UNUSED)
{
+ if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
+ return 0;
+
return reload_profile(mgr, vm, NULL, false);
}
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 0e75319..9f8a320 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -180,6 +180,9 @@ virSecurityDACSetSecurityImageLabel(virSecurityManagerPtr mgr,
if (!priv->dynamicOwnership)
return 0;
+ if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
+ return 0;
+
return virDomainDiskDefForeachPath(disk,
virSecurityManagerGetAllowDiskFormatProbing(mgr),
false,
@@ -199,6 +202,9 @@ virSecurityDACRestoreSecurityImageLabelInt(virSecurityManagerPtr mgr,
if (!priv->dynamicOwnership)
return 0;
+ if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
+ return 0;
+
/* Don't restore labels on readoly/shared disks, because
* other VMs may still be accessing these
* Alternatively we could iterate over all running
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index 78c0d45..6ef61c7 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -636,6 +636,9 @@ SELinuxSetSecurityImageLabel(virSecurityManagerPtr mgr,
if (secdef->norelabel)
return 0;
+ if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
+ return 0;
+
return virDomainDiskDefForeachPath(disk,
allowDiskFormatProbing,
true,
--
1.7.1
13 years
Re: [libvirt] macvtap support in libvirt 0.9.8
by Amit Tewari
Hi all,
When I see dmesg on host machine it gives error- "macvtap0: no IPv6
routers present"
Is this error causing saome problem..
Even if guest starts it gives error "Bringing up interface eth0: Device
eth0 does not seem to be present, delaying initialization.
[FAILED]"
Is this dmesg = - "macvtap0: no IPv6 routers present" the cause???
________________________________
From: libvir-list-bounces(a)redhat.com
[mailto:libvir-list-bounces@redhat.com] On Behalf Of Amit Tewari
Sent: Monday, December 12, 2011 3:50 PM
To: libvir-list(a)redhat.com
Subject: Re: [libvirt] macvtap support in libvirt 0.9.8
Hi all,
Please ignore my previous mail..
This is my test scenario
My test environment
Host os=rhel6.1
Guest os = rhel6.1
Libvirt=0.9.8
Kvm hypervisor
I am creating a macvtap interface on host machine at eth0 interface
#ip link show macvtap0
51: macvtap0@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq
state UNKNOWN qlen 500
link/ether 1e:aa:f7:43:7e:3d brd ff:ff:ff:ff:ff:ff
I have made this entry in guest xml file
<interface type='direct'>
<mac address=1e:aa:f7:43:7e:3d'/>
<source dev='eth0' mode='bridge'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</interface>
Now when I start the guest
#virsh start guest
It gives following message
error: Failed to start domain guest
error: Cannot set interface flags on 'macvtap1': Device or resource busy
Please let me know what else we need to do to make macvtap work on kvm.
________________________________
From: libvir-list-bounces(a)redhat.com
[mailto:libvir-list-bounces@redhat.com] On Behalf Of Amit Tewari
Sent: Monday, December 12, 2011 3:22 PM
To: libvir-list(a)redhat.com
Subject: [libvirt] macvtap support in libvirt 0.9.8
Hi all,
My test environment
Host os=rhel6.1
Guest os = rhel6.1
Libvirt=0.9.8
Kvm hypervisor
I am creating a macvtap interface on host machine at eth0 interface
#ip link show macvtap0
51: macvtap0@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq
state UNKNOWN qlen 500
link/ether 1e:aa:f7:43:7e:3d brd ff:ff:ff:ff:ff:ff
I have made this entry in guest xml file
<interface type='direct'>
<mac address=1e:aa:f7:43:7e:3d'/>
<source dev='eth0' mode='bridge'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</interface>
Now when I start the guest
#virsh start guest
It gives following message
"Bringing up interface eth0: Device eth0 does not seem to be present,
delaying initialization.
[FAILED]"
Guest eth interface does not create. what is the problem.
Please let me know what else we need to do to make macvtap work on kvm.
DISCLAIMER:
------------------------------------------------------------------------
-----------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and
intended
for the named recipient(s) only.
It shall not attach any liability on the originator or NECHCL or its
affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily
reflect the
opinions of NECHCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure,
modification,
distribution and / or publication of
this message without the prior written consent of the author of this
e-mail is
strictly prohibited. If you have
received this email in error please delete it and notify the sender
immediately. .
------------------------------------------------------------------------
-----------------------------------------------
DISCLAIMER:
------------------------------------------------------------------------
-----------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and
intended
for the named recipient(s) only.
It shall not attach any liability on the originator or NECHCL or its
affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily
reflect the
opinions of NECHCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure,
modification,
distribution and / or publication of
this message without the prior written consent of the author of this
e-mail is
strictly prohibited. If you have
received this email in error please delete it and notify the sender
immediately. .
------------------------------------------------------------------------
-----------------------------------------------
DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and
intended
for the named recipient(s) only.
It shall not attach any liability on the originator or NECHCL or its
affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the
opinions of NECHCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is
strictly prohibited. If you have
received this email in error please delete it and notify the sender
immediately. .
-----------------------------------------------------------------------------------------------------------------------
13 years
[libvirt] [PATCH 1/1] Fix make uninstall
by Dave Allan
Make uninstall currently fails with the following message:
rmdir /etc/sasl2/
rmdir: failed to remove `/etc/sasl2/': Directory not empty
That's fine (correct in fact) so force the command to return success
with || :
---
daemon/Makefile.am | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 22a9d38..023410e 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -351,7 +351,7 @@ install-data-sasl:
uninstall-data-sasl:
rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
- rmdir $(DESTDIR)$(sysconfdir)/sasl2/
+ rmdir $(DESTDIR)$(sysconfdir)/sasl2/ || :
else
install-data-sasl:
uninstall-data-sasl:
--
1.7.4.4
13 years
[libvirt] macvtap support in libvirt 0.9.8
by Amit Tewari
Hi all,
My test environment
Host os=rhel6.1
Guest os = rhel6.1
Libvirt=0.9.8
Kvm hypervisor
I am creating a macvtap interface on host machine at eth0 interface
#ip link show macvtap0
51: macvtap0@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq
state UNKNOWN qlen 500
link/ether 1e:aa:f7:43:7e:3d brd ff:ff:ff:ff:ff:ff
I have made this entry in guest xml file
<interface type='direct'>
<mac address=1e:aa:f7:43:7e:3d'/>
<source dev='eth0' mode='bridge'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</interface>
Now when I start the guest
#virsh start guest
It gives following message
"Bringing up interface eth0: Device eth0 does not seem to be present,
delaying initialization.
[FAILED]"
Guest eth interface does not create. what is the problem.
Please let me know what else we need to do to make macvtap work on kvm.
DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and
intended
for the named recipient(s) only.
It shall not attach any liability on the originator or NECHCL or its
affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the
opinions of NECHCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is
strictly prohibited. If you have
received this email in error please delete it and notify the sender
immediately. .
-----------------------------------------------------------------------------------------------------------------------
13 years
Re: [libvirt] virsh console giving Error
by Amit Tewari
Hi,
I added this (in /etc/grub.conf)
----
console=tty0 console=ttyS0,115200
-----
But still same error is coming.
-----Original Message-----
From: libvir-list-bounces(a)redhat.com
[mailto:libvir-list-bounces@redhat.com] On Behalf Of Amit Tewari
Sent: Monday, December 12, 2011 12:36 PM
To: Kashyap Chamarthy
Cc: libvir-list(a)redhat.com
Subject: Re: [libvirt] virsh console giving Error
Hi,
I am using libvirt 0.9.7
-----Original Message-----
From: Kashyap Chamarthy [mailto:kchamart@redhat.com]
Sent: Monday, December 12, 2011 12:32 PM
To: Amit Tewari
Cc: libvir-list(a)redhat.com
Subject: Re: [libvirt] virsh console giving Error
On 12/12/2011 12:16 PM, Amit Tewari wrote:
> Hi all,
>
> Following is my test environment
>
> Host os= rhel6.1
>
> Guest os=rhel6.1
>
> Hypervisor - kvm
>
>
>
> I have a created a guest machine using virt-install command. And it
has created guest
> successfully.
>
> But now when I issue following command
>
> #virsh console guest
>
>
>
> Following error is displayed -
>
>
>
> "Error: internal error character device (null) is not using a PTY"
>
>
>
> Please let me no how can I avoid this error.
You have not specified what distribution, version of libvirt are you
using.
First, can you ensure if you have serial console set up in your guest by
checking if you
have the below directives in your guest kernel's command line options
(in /etc/grub.conf)
----
console=tty0 console=ttyS0,115200
----
If not, you can add it by running the below (ensure the guest is
shut-off):
# virt-edit guest /etc/grub.conf
'virt-edit' tool comes with libguestfs-tools-c package.
--
/kashyap
>
>
>
> Regards
>
> Amit Tewari
>
>
>
> --
> libvir-list mailing list
> libvir-list(a)redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
DISCLAIMER:
------------------------------------------------------------------------
-----------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and
intended
for the named recipient(s) only.
It shall not attach any liability on the originator or NECHCL or its
affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily
reflect the
opinions of NECHCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure,
modification,
distribution and / or publication of
this message without the prior written consent of the author of this
e-mail is
strictly prohibited. If you have
received this email in error please delete it and notify the sender
immediately. .
------------------------------------------------------------------------
-----------------------------------------------
--
libvir-list mailing list
libvir-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and
intended
for the named recipient(s) only.
It shall not attach any liability on the originator or NECHCL or its
affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the
opinions of NECHCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is
strictly prohibited. If you have
received this email in error please delete it and notify the sender
immediately. .
-----------------------------------------------------------------------------------------------------------------------
13 years