mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-09 09:14:57 +00:00
virnetdevopenvswitch: Add vmuuid notes on virNetDevOpenvswitchInterfaceSetQos
Add vmuuid notes on virNetDevOpenvswitchInterfaceSetQos, and change vmid to vmuuid. Signed-off-by: Jinsheng Zhang <zhangjl02@inspur.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
2b6bc910b7
commit
c40421f702
@ -624,6 +624,7 @@ int virNetDevOpenvswitchUpdateVlan(const char *ifname,
|
|||||||
* virNetDevOpenvswitchInterfaceSetQos:
|
* virNetDevOpenvswitchInterfaceSetQos:
|
||||||
* @ifname: on which interface
|
* @ifname: on which interface
|
||||||
* @bandwidth: rates to set (may be NULL)
|
* @bandwidth: rates to set (may be NULL)
|
||||||
|
* @vmuuid: the Domain UUID that has this interface
|
||||||
* @swapped: true if IN/OUT should be set contrariwise
|
* @swapped: true if IN/OUT should be set contrariwise
|
||||||
*
|
*
|
||||||
* Update qos configuration of an OVS port.
|
* Update qos configuration of an OVS port.
|
||||||
@ -640,7 +641,7 @@ int virNetDevOpenvswitchUpdateVlan(const char *ifname,
|
|||||||
int
|
int
|
||||||
virNetDevOpenvswitchInterfaceSetQos(const char *ifname,
|
virNetDevOpenvswitchInterfaceSetQos(const char *ifname,
|
||||||
const virNetDevBandwidth *bandwidth,
|
const virNetDevBandwidth *bandwidth,
|
||||||
const unsigned char *vmid,
|
const unsigned char *vmuuid,
|
||||||
bool swapped)
|
bool swapped)
|
||||||
{
|
{
|
||||||
virNetDevBandwidthRate *rx = NULL; /* From domain POV */
|
virNetDevBandwidthRate *rx = NULL; /* From domain POV */
|
||||||
@ -674,7 +675,7 @@ virNetDevOpenvswitchInterfaceSetQos(const char *ifname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!bandwidth->out && !bandwidth->in) {
|
if (!bandwidth->out && !bandwidth->in) {
|
||||||
if (virNetDevOpenvswitchInterfaceClearQos(ifname, vmid) < 0) {
|
if (virNetDevOpenvswitchInterfaceClearQos(ifname, vmuuid) < 0) {
|
||||||
VIR_WARN("Clean qos for interface %s failed", ifname);
|
VIR_WARN("Clean qos for interface %s failed", ifname);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -699,7 +700,7 @@ virNetDevOpenvswitchInterfaceSetQos(const char *ifname,
|
|||||||
|
|
||||||
/* find queue */
|
/* find queue */
|
||||||
cmd = virNetDevOpenvswitchCreateCmd();
|
cmd = virNetDevOpenvswitchCreateCmd();
|
||||||
virUUIDFormat(vmid, vmuuidstr);
|
virUUIDFormat(vmuuid, vmuuidstr);
|
||||||
vmid_ex_id = g_strdup_printf("external-ids:vm-id=\"%s\"", vmuuidstr);
|
vmid_ex_id = g_strdup_printf("external-ids:vm-id=\"%s\"", vmuuidstr);
|
||||||
ifname_ex_id = g_strdup_printf("external-ids:ifname=\"%s\"", ifname);
|
ifname_ex_id = g_strdup_printf("external-ids:ifname=\"%s\"", ifname);
|
||||||
virCommandAddArgList(cmd, "--no-heading", "--columns=_uuid", "find", "queue",
|
virCommandAddArgList(cmd, "--no-heading", "--columns=_uuid", "find", "queue",
|
||||||
@ -801,7 +802,7 @@ virNetDevOpenvswitchInterfaceSetQos(const char *ifname,
|
|||||||
|
|
||||||
int
|
int
|
||||||
virNetDevOpenvswitchInterfaceClearQos(const char *ifname,
|
virNetDevOpenvswitchInterfaceClearQos(const char *ifname,
|
||||||
const unsigned char *vmid)
|
const unsigned char *vmuuid)
|
||||||
{
|
{
|
||||||
char vmuuidstr[VIR_UUID_STRING_BUFLEN];
|
char vmuuidstr[VIR_UUID_STRING_BUFLEN];
|
||||||
g_autoptr(virCommand) cmd = NULL;
|
g_autoptr(virCommand) cmd = NULL;
|
||||||
@ -813,7 +814,7 @@ virNetDevOpenvswitchInterfaceClearQos(const char *ifname,
|
|||||||
|
|
||||||
/* find qos */
|
/* find qos */
|
||||||
cmd = virNetDevOpenvswitchCreateCmd();
|
cmd = virNetDevOpenvswitchCreateCmd();
|
||||||
virUUIDFormat(vmid, vmuuidstr);
|
virUUIDFormat(vmuuid, vmuuidstr);
|
||||||
vmid_ex_id = g_strdup_printf("external-ids:vm-id=\"%s\"", vmuuidstr);
|
vmid_ex_id = g_strdup_printf("external-ids:vm-id=\"%s\"", vmuuidstr);
|
||||||
virCommandAddArgList(cmd, "--no-heading", "--columns=_uuid", "find", "qos", vmid_ex_id, NULL);
|
virCommandAddArgList(cmd, "--no-heading", "--columns=_uuid", "find", "qos", vmid_ex_id, NULL);
|
||||||
virCommandSetOutputBuffer(cmd, &qos_uuid);
|
virCommandSetOutputBuffer(cmd, &qos_uuid);
|
||||||
|
@ -73,10 +73,10 @@ int virNetDevOpenvswitchUpdateVlan(const char *ifname,
|
|||||||
|
|
||||||
int virNetDevOpenvswitchInterfaceSetQos(const char *ifname,
|
int virNetDevOpenvswitchInterfaceSetQos(const char *ifname,
|
||||||
const virNetDevBandwidth *bandwidth,
|
const virNetDevBandwidth *bandwidth,
|
||||||
const unsigned char *vmid,
|
const unsigned char *vmuuid,
|
||||||
bool swapped)
|
bool swapped)
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT;
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT;
|
||||||
|
|
||||||
int virNetDevOpenvswitchInterfaceClearQos(const char *ifname,
|
int virNetDevOpenvswitchInterfaceClearQos(const char *ifname,
|
||||||
const unsigned char *vmid)
|
const unsigned char *vmuuid)
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
|
||||||
|
Loading…
Reference in New Issue
Block a user