[Libvirt-cim] [PATCH 3 of 3] Add support for defining a net device with the target device set
Sharad Mishra
snmishra at us.ibm.com
Sun Jan 31 20:19:35 UTC 2010
+1
Sharad Mishra
System x Enablement
Linux Technology Center
IBM
Kaitlin Rupert
<kaitlin at linux.vn
et.ibm.com>, To
Sent by: libvirt-cim at redhat.com
libvirt-cim-bounc cc
es at redhat.com
Subject
[Libvirt-cim] [PATCH 3 of 3] Add
01/28/2010 03:59 support for defining a net device
PM with the target device set
Please respond to
List for
discussion and
development of
libvirt CIM
<libvirt-cim at redh
at.com>
# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1264722331 28800
# Node ID 5b37fac8372729a7da9817a8fc0661159fc710b8
# Parent 0273f86ebd7b6e54ec606d0a2a9aa54ce40246f1
Add support for defining a net device with the target device set
Also provide template RASDs with the VirtualDevice attribute exposed.
Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>
diff -r 0273f86ebd7b -r 5b37fac83727 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Thu Jan 28 15:45:31
2010 -0800
+++ b/src/Virt_SettingsDefineCapabilities.c Thu Jan 28 15:45:31
2010 -0800
@@ -546,6 +546,7 @@
const char *net_type,
const char *net_name,
uint64_t num_nics,
+ const char *device,
const char *model,
struct inst_list *list)
{
@@ -565,6 +566,10 @@
(CMPIValue *)&num_nics, CMPI_uint64);
if (model != NULL)
+ CMSetProperty(inst, "VirtualDevice",
+ (CMPIValue *)device, CMPI_chars);
+
+ if (model != NULL)
CMSetProperty(inst, "ResourceSubType",
(CMPIValue *)model, CMPI_chars);
@@ -584,6 +589,7 @@
CMPIStatus s = {CMPI_RC_OK, NULL};
int i,j;
const char *type[] = {"network", "bridge", "user"};
+ const char *device[] = {"vtap1", NULL};
const char *model[] = {"e1000", NULL};
const char *name[] = {NULL, "br0", NULL};
@@ -622,6 +628,7 @@
type[i],
name[i],
num_nics,
+ device[j],
model[j],
list);
if (s.rc != CMPI_RC_OK)
diff -r 0273f86ebd7b -r 5b37fac83727
src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Thu Jan 28 15:45:31
2010 -0800
+++ b/src/Virt_VirtualSystemManagementService.c Thu Jan 28 15:45:31
2010 -0800
@@ -752,6 +752,13 @@
dev->dev.net.type = strdup(USER_TYPE);
} else
return "Invalid Network Type specified";
+
+ free(dev->dev.net.device);
+ if (cu_get_str_prop(inst, "VirtualDevice", &val) != CMPI_RC_OK)
+ dev->dev.net.device = NULL;
+ else
+ dev->dev.net.device = strdup(val);
+
free(dev->dev.net.model);
if (cu_get_str_prop(inst, "ResourceSubType", &val) != CMPI_RC_OK)
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim at redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20100131/5961b172/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20100131/5961b172/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic28337.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20100131/5961b172/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20100131/5961b172/attachment-0002.gif>
More information about the Libvirt-cim
mailing list