[libvirt] [PATCH] [PATCH v13-pre1] add 802.1Qbh and 802.1Qbg handling
by Scott Feldman
From: Scott Feldman <scofeldm(a)cisco.com>
Stefan, I was doing more testing and have some fixes for the bh paths. This
patch is on top of your V12 patch...
- some minor cleanups
- if association fails due to timeout, disassociate the port profile,
otherwise association state-machine will be "in-progress" potentially
forever.
- don't pass mac/vlan/uuids/profile when disassociating. ifindex and vf
are enough
Signed-off-by: Scott Feldman <scofeldm(a)cisco.com>
---
src/util/macvtap.c | 75 ++++++++++++++++++++++++++++++----------------------
1 files changed, 43 insertions(+), 32 deletions(-)
diff --git a/src/util/macvtap.c b/src/util/macvtap.c
index 71c6169..9ca6203 100644
--- a/src/util/macvtap.c
+++ b/src/util/macvtap.c
@@ -963,11 +963,11 @@ getPortProfileStatus(struct nlattr **tb, int32_t vf,
if (tb[IFLA_PORT_SELF]) {
if (nla_parse_nested(tb_port, IFLA_PORT_MAX, tb[IFLA_PORT_SELF],
ifla_port_policy)) {
- msg = _("error parsing IFLA_VF_SELF part");
+ msg = _("error parsing IFLA_PORT_SELF part");
goto err_exit;
}
} else {
- msg = _("IFLA_VF_SELF is missing");
+ msg = _("IFLA_PORT_SELF is missing");
goto err_exit;
}
} else {
@@ -1266,7 +1266,7 @@ doPortProfileOpCommon(bool nltarget_kernel,
vf,
op);
- if (rc != 0) {
+ if (rc) {
macvtapError(VIR_ERR_INTERNAL_ERROR, "%s",
_("sending of PortProfileRequest failed."));
return rc;
@@ -1278,7 +1278,7 @@ doPortProfileOpCommon(bool nltarget_kernel,
goto err_exit;
rc = getPortProfileStatus(tb, vf, instanceId, nltarget_kernel,
is8021Qbg, &status);
- if (rc != 0)
+ if (rc)
goto err_exit;
if (status == PORT_PROFILE_RESPONSE_SUCCESS ||
status == PORT_VDP_RESPONSE_SUCCESS) {
@@ -1478,16 +1478,11 @@ doPortProfileOp8021Qbh(const char *ifname,
char *physfndev;
unsigned char hostuuid[VIR_UUID_BUFLEN];
int32_t vf;
- int op = PORT_REQUEST_ASSOCIATE;
bool nltarget_kernel = true;
int ifindex;
int vlanid = -1;
const unsigned char *macaddr = NULL;
- rc = virGetHostUUID(hostuuid);
- if (rc)
- goto err_exit;
-
rc = getPhysfn(ifname, &vf, &physfndev);
if (rc)
goto err_exit;
@@ -1499,35 +1494,51 @@ doPortProfileOp8021Qbh(const char *ifname,
switch (virtPortOp) {
case ASSOCIATE:
- op = PORT_REQUEST_ASSOCIATE;
+ rc = virGetHostUUID(hostuuid);
+ if (rc)
+ goto err_exit;
+
+ rc = doPortProfileOpCommon(nltarget_kernel, NULL, ifindex,
+ macaddr,
+ vlanid,
+ virtPort->u.virtPort8021Qbh.profileID,
+ NULL,
+ vm_uuid,
+ hostuuid,
+ vf,
+ PORT_REQUEST_ASSOCIATE);
+ if (rc == -ETIMEDOUT)
+ /* Association timed out, disassociate */
+ doPortProfileOpCommon(nltarget_kernel, NULL, ifindex,
+ NULL,
+ 0,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ vf,
+ PORT_REQUEST_DISASSOCIATE);
+ if (!rc)
+ ifaceUp(ifname);
break;
+
case DISASSOCIATE:
- op = PORT_REQUEST_DISASSOCIATE;
+ rc = doPortProfileOpCommon(nltarget_kernel, NULL, ifindex,
+ NULL,
+ 0,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ vf,
+ PORT_REQUEST_DISASSOCIATE);
+ ifaceDown(ifname);
break;
+
default:
macvtapError(VIR_ERR_INTERNAL_ERROR,
- _("operation type %d not supported"), op);
+ _("operation type %d not supported"), virtPortOp);
rc = 1;
- goto err_exit;
- }
-
- rc = doPortProfileOpCommon(nltarget_kernel, NULL, ifindex,
- macaddr,
- vlanid,
- virtPort->u.virtPort8021Qbh.profileID,
- NULL,
- vm_uuid,
- hostuuid,
- vf,
- op);
-
- switch (virtPortOp) {
- case ASSOCIATE:
- ifaceUp(ifname);
- break;
- case DISASSOCIATE:
- ifaceDown(ifname);
- break;
}
err_exit:
14 years, 6 months
[libvirt] [PATCH 1/2] Add --source-format argument to virsh pool-define-as and pool-create-as
by Justin Clift
Hi all,
When creating pools from dedicated disks, the existing pool-define-as
and pool-create-as commands are a bit non-optimal.
Ideally, a person would be able to specify all of the required options
directly on the command line instead of having to edit the XML.
At the moment, there is no way to specify the format type (ie gpt) so it
gets included in the XML the pool is constructed with.
Please find attached a simple (tested) patch to add an optional
"--source-format 'type'" to virsh. This is patched against current git
master and will apply cleanly.
Also created a Red Hat BZ ticket for this (#597790) for tracking.
Regards and best wishes,
Justin Clift
--
Salasaga - Open Source eLearning IDE
http://www.salasaga.org
14 years, 6 months
[libvirt] Mounting /dev/tty* to the Virtual Domain.
by Kumar L Srikanth-B22348
Hi All,
How to mount /dev/tty* files to the Virtual Domain '/dev' directory.
Some of the packages are not installing in the Virtual Domain, due the
absence of these files in the /dev directory.
In the rootfs directory, '/dev' directory shows lot of files, but after
mounting to the rootfs to '/' directory of Virtual Domain, some tty*
files are missing.
How to mount those tty files to the Virtual Domain?
Regards,
Srikanth.
14 years, 6 months
[libvirt] Unable to telnet in the Virtual Domain.
by Kumar L Srikanth-B22348
Hi Ozaki,
I need some help regarding telnet in the Virtual Domain.
I created a Virtual Domain using libvirt and able to start the same with
some ip address. I also installed telnet server in the Domain and able
to start telnet service.
When I execute the command 'telnet 127.0.0.1', I am able to get the
username/password prompt. After issuing the user credentials, I am
getting the following error:
cannot make/remove an entry for the specified session
connection closed by foreign host.
Can you please let me know, where I am going wrong?
Regards,
Srikanth.
14 years, 6 months
[libvirt] sound hardware?
by Brandon Thomas
Are there any plans for adding functionality so that the pulse-audio
server can be used as a sound hardware device?
Brandon
14 years, 6 months